/** * @override enforces generation of \ProxyManager\Generator\MethodGenerator * * {@inheritDoc} */ public static function fromReflection(MethodReflection $reflectionMethod) { /* @var $method self */ $method = new static(); $method->setSourceContent($reflectionMethod->getContents(false)); $method->setSourceDirty(false); if ($reflectionMethod->getDocComment() != '') { $method->setDocBlock(DocBlockGenerator::fromReflection($reflectionMethod->getDocBlock())); } $method->setFinal($reflectionMethod->isFinal()); $method->setVisibility(self::extractVisibility($reflectionMethod)); foreach ($reflectionMethod->getParameters() as $reflectionParameter) { $method->setParameter(ParameterGenerator::fromReflection($reflectionParameter)); } $method->setStatic($reflectionMethod->isStatic()); $method->setName($reflectionMethod->getName()); $method->setBody($reflectionMethod->getBody()); $method->setReturnsReference($reflectionMethod->returnsReference()); return $method; }
public function testGeneratesDefaultParameterForInternalPhpClasses() { $parameter = ParameterGenerator::fromReflection(new ParameterReflection(array('Phar', 'compress'), 1)); $this->assertNull($parameter->getDefaultValue()->getValue()); }
public function testGeneratesDefaultParameterForInternalPhpClasses() { $parameter = ParameterGenerator::fromReflection(new ParameterReflection(array('Phar', 'compress'), 1)); $this->assertSame('null', strtolower((string) $parameter->getDefaultValue())); }