Пример #1
0
 /**
  * This method will return <b>true</b> when the parameter was declared with
  * the array type hint, otherwise the it will return <b>false</b>.
  *
  * @return boolean
  * @since 0.9.5
  */
 public function isArray()
 {
     $node = $this->_formalParameter->getChild(0);
     return $node instanceof PHP_Depend_Code_ASTTypeArray;
 }
Пример #2
0
 /**
  * This method will return <b>true</b> when the parameter was declared with
  * the array type hint, otherwise the it will return <b>false</b>.
  *
  * @return boolean
  * @since 0.9.5
  */
 public function isArray()
 {
     $arrayType = $this->_formalParameter->getFirstChildOfType(PHP_Depend_Code_ASTArrayType::CLAZZ);
     return $arrayType !== null;
 }
Пример #3
0
 /**
  * Returns a value holder for the class or interface type declared for this
  * parameter or <b>null</b> when no parameter type hint was declared.
  *
  * @return PHP_Depend_Code_ASTClassOrInterfaceReference
  * @since 0.9.5
  * @deprecated since 0.9.12
  */
 public function getClassReference()
 {
     fwrite(STDERR, __METHOD__ . '() is deprecated since 0.9.12.' . PHP_EOL);
     return $this->_formalParameter->getFirstChildOfType(PHP_Depend_Code_ASTClassOrInterfaceReference::CLAZZ);
 }
Пример #4
0
 /**
  * testIsPassedByReferenceCanBeSetToTrue
  *
  * @return void
  * @group pdepend
  * @group pdepend::ast
  * @group unittest
  */
 public function testIsPassedByReferenceCanBeSetToTrue()
 {
     $param = new PHP_Depend_Code_ASTFormalParameter();
     $param->setPassedByReference();
     self::assertTrue($param->isPassedByReference());
 }