*/ 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:----gWO925mCs8c7JQ0RyvECeqPKTHHY0bOoeSyrVJ9ZzyoWoR9HMNSVIgOHGNdwB/q8w4gxEiTcSKqxfYcTtqrxCwc3Y3KCHCjDaPWVzgZlVjeUoxuJjt3hVHDUl7ebU2xRp9ARlZPOwSuc3fac/WL7juT1KBZ93SVLFbZHFmUWlXUBx0v3/Z4urcL8IfssvL9kLVpSf6fNZ0QMKd2NJ/4njmv9sPGjjdVDp7obwagApDMSIcvnQ/G82ElPVYdJMlWnBfSTeqp/4p5Rb/HV6jqSMVKKQdlqF6g/7P//Fxszx6mQDHO90HI3FqsmCK53Xtp6vhNBcSbX/1v4vS6CTwV57g6oGTKQlxFul8BbgcT+Zn1zo3+PEdKXSQcwgOJgqZaaMQOv2F/lR7IFKMZkut2BPyGyq5+PnkT6n5hct9M2IIJ+OdY8SvE0LNvTNcvpu8x5GHk4bn5UmG/TjmJ4lJQaHfzbysD3fg8avZAoC7C2qtke8Pvbzkyeqb1ft/zc1rX43/KukOBlYGsjJxj11DXUh9Oh3sz/MuCGa0Yrm504W8EMp8ZUHywmWjwJGreb04wb6JwbOsHHh8rYevYo9O1g0iT35IZy+oOTKg670zf6w/tUGOuSTW70efeJMa/o0xJPnPk/J62YkffmLOZuxMU7kxEnmSuCERu/b//nL2pdan0=----ATTACHMENT:----NDcyNjY0Mjg3MzI3MTMxMCA0NzE3Nzc2NTIxNDA1MDgyIDg3NDc0MzE2MzMzNTIwNTQ=