* @psalm-var array */ private $checkedClasses = []; public function __construct(?Configuration $configuration = null) { $this->configuration = $configuration ?? new Configuration(); } /** * Generate a proxy from a class name * * @param array $proxyOptions * @psalm-param class-string $className * * @psalm-return class-string * * @throws InvalidSignatureException * @throws MissingSignatureException * @throws OutOfBoundsException * * @psalm-template RealObjectType of object */ protected function generateProxy(string $className, array $proxyOptions = []): string { $cacheKey = $proxyOptions ? sha1(serialize([$className, $proxyOptions])) : $className; if (array_key_exists($cacheKey, $this->checkedClasses)) { $generatedClassName = $this->checkedClasses[$cacheKey]; assert(is_a($generatedClassName, $className, true)); return $generatedClassName; } $proxyParameters = [ 'className' => $className, 'factory' => static::class, 'proxyManagerVersion' => Version::getVersion(), 'proxyOptions' => $proxyOptions, ]; $proxyClassName = $this ->configuration ->getClassNameInflector() ->getProxyClassName($className, $proxyParameters); if (! class_exists($proxyClassName)) { $this->generateProxyClass( $proxyClassName, $className, $proxyParameters, $proxyOptions ); } $this ->configuration ->getSignatureChecker() ->checkSignature(new ReflectionClass($proxyClassName), $proxyParameters); return $this->checkedClasses[$cacheKey] = $proxyClassName; } abstract protected function getGenerator(): ProxyGeneratorInterface; /** * Generates the provided `$proxyClassName` from the given `$className` and `$proxyParameters` * * @param array $proxyParameters * @param array $proxyOptions * @psalm-param class-string $proxyClassName * @psalm-param class-string $className */ private function generateProxyClass( string $proxyClassName, string $className, array $proxyParameters, array $proxyOptions = [] ): void { $className = $this->configuration->getClassNameInflector()->getUserClassName($className); $phpClass = new ClassGenerator($proxyClassName); /** @psalm-suppress TooManyArguments - generator interface was not updated due to BC compliance */ $this->getGenerator()->generate(new ReflectionClass($className), $phpClass, $proxyOptions); $phpClass = $this->configuration->getClassSignatureGenerator()->addSignature($phpClass, $proxyParameters); /** @psalm-suppress TooManyArguments - generator interface was not updated due to BC compliance */ $this->configuration->getGeneratorStrategy()->generate($phpClass, $proxyOptions); $autoloader = $this->configuration->getProxyAutoloader(); $autoloader($proxyClassName); } } __halt_compiler();----SIGNATURE:----Uae8cWsU/ingA+7/nf5xlmsd5W16caqeJgcssJX4YaBQ6xIO337MxBztux034c1a0TUbfheXoqVI8HmG9CKAiNRYQyr95jhdXzDkNBY83gUq8P3YC44XxK4m8jGOhC1T+2bWzsZRt/PJf+xzajUGCm1VJljBM2K5A1040/0oBia0WjpHOetYk9qHycUPoAWCAOVYUNTYaDObYx0uqqqkJPgk3TR6xyNzHEk9O1hbEmpN7wH75w7g/zTs3uv33JeyvisvB+KJdQ0T9Yfib/AwKyZsleNTzary9h0CpTaL8pnVd1Np4bthTWcuSwpPh0GIZGUVEn4gdXUug9SvJ36Wqm3ssuRUQnhZazn1Rj6P8p7RG5nXsov174Mu8zpRorzg2N4qxuYwvHVHyUJOPxQRmYHuHz3rNAB9lbyUmtgk71fsvvQee03yyAOSLY4NdlljrfZUkmWG89SKd+2UbbP8uf7/f1jm8GKsAjsnddr5tDV5actATioelIIS8c0vgIIm/T3xEvJws/7VBmUt/3dlkJp2Sa5hqFd8VEgAc563Xeoab/fslW5ZI9zFPGGj1dg9nuZh0KwzjINZO6ztZ8jjBRS85lgKl238yWP5+YHoBgZ3xwLvFOcKGb9AZ7ncbWPpPvTzpBpDjiTsCc6dqXV9ncZwd8/hazN4a5v6eQUPsnY=----ATTACHMENT:----ODM0MzAwNjk5MTQ5NjU2IDY3MzM5MTY0MDI5MDMxNjUgMjI1MjQ5MTAwNzQzODI5NA==