/** * Generates the provided `$proxyClassName` from the given `$className` and `$proxyParameters` * @param string $proxyClassName * @param string $className * @param array $proxyParameters * * @return void */ private function generateProxyClass($proxyClassName, $className, array $proxyParameters) { $className = $this->configuration->getClassNameInflector()->getUserClassName($className); $phpClass = new ClassGenerator($proxyClassName); $this->getGenerator()->generate(new ReflectionClass($className), $phpClass); $phpClass = $this->configuration->getClassSignatureGenerator()->addSignature($phpClass, $proxyParameters); $this->configuration->getGeneratorStrategy()->generate($phpClass); $this->configuration->getProxyAutoloader()->__invoke($proxyClassName); }
/** * @covers \ProxyManager\Configuration::getClassSignatureGenerator * @covers \ProxyManager\Configuration::setClassSignatureGenerator */ public function testSetGetClassSignatureGenerator() { $this->assertInstanceOf('ProxyManager\\Signature\\ClassSignatureGeneratorInterface', $this->configuration->getClassSignatureGenerator()); /* @var $classSignatureGenerator \ProxyManager\Signature\ClassSignatureGeneratorInterface */ $classSignatureGenerator = $this->getMock('ProxyManager\\Signature\\ClassSignatureGeneratorInterface'); $this->configuration->setClassSignatureGenerator($classSignatureGenerator); $this->assertSame($classSignatureGenerator, $this->configuration->getClassSignatureGenerator()); }