* @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:----QIDVas8MvvuTuBa8Lss2yjuOrisQgtuaQGxhsDcgC/5HEAUJKkWuiM6aPN6U8TzIEofBA94RnReCTkMu3w7vHOvIKHnH2kTyYNHpcbiN9gCbR7EAOGizA1ZoQVplJQnpLsb+BTYhba6stNU6nxCnDG+sEChZuHxVpTgTP3KLUmvmOyn2HsdADog8EITG+28WmiRomgHiV4gdCy6dT5VVLUyhgjgHbgOfTWa1ya7duhVrCSkX0cvRg0gXb837vPbBqKMO6aznqGP9Ui7Z6ALgzEiXliecTq0fCOOZLo5muHG8x36TV0Stc/eQTqqHuWZYuS8ToIG3eGKIcSkXDv4gHf/vkx8PKJ8CFLq0zZMKweBZcZl7vC0eGzQUbshvApXvCw2jED2RDrlXMAeujH4cCHv1jbBna7uC2on2+mGF1CKYU75HZXg9annq3V8AA6nFlZ+c6IZIVEc6L3ieVjKoR7yzX1s031ANUL6RAgPUojhTA+ZLznT4bVOTDnnS1CK1HukfGqE0BhoJ0L+NP5Sthpo9oiaZWui6bnkQVcwBz7tRK7NM1hIcDYRpTRs5W88rLsrvGvcNuqAUGHCfk1CjtkLbYQZQy5SIdMhCl/Bf6TzsHkAlH54PQYo/LQFvOxN4U69CS9x5osFwBypxyE1tZtCELwacw+sJIUDNdHPhxIQ=----ATTACHMENT:----MTMzNDA0OTA5MTgwNjc0MSA0NDc2NTk5NzQwMjQ2MjQxIDI3MDE3MTYwNDI5MzkyOTg=