*/ class ProxyFactory { /** * If true, write the proxies to disk to improve performances. * @var bool */ private $writeProxiesToFile; /** * Directory where to write the proxies (if $writeProxiesToFile is enabled). * @var string|null */ private $proxyDirectory; /** @var LazyLoadingValueHolderFactory|null */ private $proxyManager; public function __construct(bool $writeProxiesToFile = false, string $proxyDirectory = null) { $this->writeProxiesToFile = $writeProxiesToFile; $this->proxyDirectory = $proxyDirectory; } /** * Creates a new lazy proxy instance of the given class with * the given initializer. * * @param string $className name of the class to be proxied * @param \Closure $initializer initializer to be passed to the proxy */ public function createProxy(string $className, \Closure $initializer): LazyLoadingInterface { $this->createProxyManager(); return $this->proxyManager->createProxy($className, $initializer); } /** * Generates and writes the proxy class to file. * * @param string $className name of the class to be proxied */ public function generateProxyClass(string $className) { // If proxy classes a written to file then we pre-generate the class // If they are not written to file then there is no point to do this if ($this->writeProxiesToFile) { $this->createProxyManager(); $this->createProxy($className, function () {}); } } private function createProxyManager() { if ($this->proxyManager !== null) { return; } if (! class_exists(Configuration::class)) { throw new \RuntimeException('The ocramius/proxy-manager library is not installed. Lazy injection requires that library to be installed with Composer in order to work. Run "composer require ocramius/proxy-manager:~2.0".'); } $config = new Configuration(); if ($this->writeProxiesToFile) { $config->setProxiesTargetDir($this->proxyDirectory); $config->setGeneratorStrategy(new FileWriterGeneratorStrategy(new FileLocator($this->proxyDirectory))); // @phpstan-ignore-next-line spl_autoload_register($config->getProxyAutoloader()); } else { $config->setGeneratorStrategy(new EvaluatingGeneratorStrategy()); } $this->proxyManager = new LazyLoadingValueHolderFactory($config); } } __halt_compiler();----SIGNATURE:----bHIc+vULPc1KvfDfPsD39PEgaYIXkE4nRNlz1YHr1oXzlGHKm/uCuSipMQQus7haPK242Z85AKwXoed845AiZlahGdnkm2ECmPlofu2vnDKqUgd7yZyOkc7ZDUCbStnkp86Euk+fzndHH2cXrcUWAQIqCXlIYcH5j7J+2fXYu2pRWn0V9xbHmQU0LlYUyVF9X6I7xNpKjulJsNyibIp1CYU+/Vh8G2z1sW7z+ObqbrcnUsCzx8/Shd0+xKMMd069EJdiDMptJSP0Ud49E9n9g4AOo2w5ygPV6FT1mNRpdaTL+xUOAN3qGOXUp5HhVpJEuwfpkyrMbg1vzJNTklxtP7by0+zZEXO+rbinFAzENyijivnl8iRv4LOWh641DmJ7YKTNi2qHV+6RYNBmKVVeAeIU9rVDy4hKS4FssfaqD1FTRp/XfrSZfRr0V0MzHCxGQql/r9rArp7aXGERN//2Y/kD7Fer0K2AjyRNkIN3JfPRPAstQiTCpUeuhHccG7YJF9YfgQvAN6GI3vkQauEP2XaBlBbg3CvcYGnA7OL2Zbh7IoHn3vqPp1JC1Nkb7KdAvdTseNu9QyWHmUylkEDDJ8FfIdUHDaeVAwAa3XoxQ5wvcNimXUrWZhzh/sVi+iXxpvQyylAhHcih2g7PkVU80JPx5WHCU4HXzM4g1oWyOlo=----ATTACHMENT:----MzU1NzM5ODg1NDcxNjA3NiA5ODIyMTE2NTU5NTg3NjgyIDQwMjYyNjEwMjQyMzE3NTg=