/** * fromReflection() * * @param Zend_Reflection_Parameter $reflectionParameter * @return Zend_CodeGenerator_Php_Parameter */ public static function fromReflection(Zend_Reflection_Parameter $reflectionParameter) { $param = new Zend_CodeGenerator_Php_Parameter(); $param->setName($reflectionParameter->getName()); if ($reflectionParameter->isArray()) { $param->setType('array'); } else { $typeClass = $reflectionParameter->getClass(); if ($typeClass !== null) { $param->setType($typeClass->getName()); } } $param->setPosition($reflectionParameter->getPosition()); if ($reflectionParameter->isOptional()) { $param->setDefaultValue($reflectionParameter->getDefaultValue()); } $param->setPassedByReference($reflectionParameter->isPassedByReference()); return $param; }
public function testPositionGetterAndSetterPersistValue() { $this->_parameter->setPosition(2); $this->assertEquals(2, $this->_parameter->getPosition()); }