* @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:----gv+kh+7Agtk1KmHu0rcEQm+B9QZGc4t0EyVdViS2T7GQYWiKQR2gjTrFDzTqbcmm/8bqRjIe32AT9H5eXGwAZ6TTHR9IkwX+aEpm+d442UH48z/+SfRFypYd2Hd5f47xE6GW/gCB34Oh/vu5lWyie2+PuP/IaQsHQx7TstpJ83Q9GOtfFXy6faqNTSCBkntI4sDMfMVKPsHyNssPqk6iEXPKNw/fZVVj0zJWWmvEbIesjvLrSiwnZK7j0ayhsmWRN3ZTJznsgQsEKzUSIM1gkmtfRZt6JBquTBBIbRnoB7cp1sGKOmwyncOvfZg+qI3SL0GuogcyyYF7hEWcahT8s6UqLqo9iDsYTHUhGOa1U5L1KAATJRQ/dtLElmjZ0UpYVEnQlb1fFhvHEwdSPeeMLRjL8HO6k2vVGszVPulwxbjgCfBC4A3RKJ8gEQNIWL+ZIepuCaYMzuMUl1pEKv0LC/xbtmtDrFzko7RSsf7VQ/8uFSmcv7GCBqzOp/IUFtyIxWlc/pagScttSaw7QunuQh5C97fGl4sJiIrVFhMgfRqwq2yiGLiEDT6lXxehtFax2cOLpR0rP11LtCrCPpdvHSILex22scGmmEig7GUhTouH6lh8Y6bPSwAJxLrr8MoyMXG1calG+rfNRgwGO7RiLfAOS8Z6P+rq7Ig6fgCYOKc=----ATTACHMENT:----Mzg2NDMxMzUxNDcwMzIxIDQxMzUwNjc3NTM2NTYyNTUgNjIwMzY4OTI1MDczOTkyMQ==