예제 #1
0
 /**
  * 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;
 }
예제 #2
0
 public function testPositionGetterAndSetterPersistValue()
 {
     $this->_parameter->setPosition(2);
     $this->assertEquals(2, $this->_parameter->getPosition());
 }