* @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:----GrP3uYeNnFFM9wc5fG9BP4PJ2BaSDEcONSB5A1AZV1t3XAPts4oO0dNpgEbjarjBp1A31CBLPHGMbblGxTcn3bjV0ZQY5uAHal/JxAtoyRj84B1OPoU15vL1DHxdpxUum7qP7AA78iS1pXssGC32NdT+56XxBC4jZTBGnaITO/7HpX+wgH+E+axjs7OEWrxXvaBlpnjQkYyp+vkou+gqhh6IrmbFQ9e7/78s+zmdKfZ0w6s15b8O0aDt8HYiM/NUkjMX22BHFdqvyuY9yHrD2fh1ArKR6K5sjyQigPBwk4vaBpXVt6eOf5q2+Iu79bjTqSnAQi76+nqrkOJ+V+wY4FyQCPQaG8V0qdW3/5qopl4cXUCOgRlQj4+3tcrggaKAzRLsYLjo9vwbDoZu9U7BPvu346mp2uoh+S/ChUIeuIBXUPUZ8oLgLNo2AGvKCv7TiL9i41OLuKkulNqRzPDxbf3FM1aPdORfqQH2DO0qcerWyQiX+y5i3KF/9Ba/lRXP3JLR3c6gwTAZADXe+tFCaLOs4lPIgGJCUj1iyHZCNShOpB7b0+4/S+CwMsI9dP2c3vrOejoky7GwmT3DNbZdB5OM3YUc3m3P5yNX//uU3soRcMR9HHfvJhz8tz2n4oZj71E3zdmWvyD60eitT9bmgS7NiF5ghPN17jILxvk7VDA=----ATTACHMENT:----NTkwODc2MDk4MjgwNDE0OCA3MTU5NzM4NDM0NTk5ODQgNDQyNTUwNjMxNjMwNDgxNQ==