コード例 #1
0
ファイル: Parser.php プロジェクト: rouffj/pdepend
 /**
  * This method will extract the type information of a property from it's
  * doc comment information. The returned value will be <b>null</b> when no
  * type information exists.
  *
  * @return PHP_Depend_Code_ASTType
  * @since 0.9.6
  */
 private function _parseFieldDeclarationType()
 {
     // Skip, if ignore annotations is set
     if ($this->_ignoreAnnotations === true) {
         return null;
     }
     $reference = $this->_parseFieldDeclarationClassOrInterfaceReference();
     if ($reference !== null) {
         return $reference;
     }
     $annotations = $this->_parseVarAnnotation($this->_docComment);
     foreach ($annotations as $annotation) {
         if (PHP_Depend_Util_Type::isPrimitiveType($annotation) === true) {
             return $this->builder->buildASTPrimitiveType(PHP_Depend_Util_Type::getPrimitiveType($annotation));
         } else {
             if (PHP_Depend_Util_Type::isArrayType($annotation) === true) {
                 return $this->builder->buildASTTypeArray();
             }
         }
     }
     return null;
 }
コード例 #2
0
ファイル: TypeTest.php プロジェクト: KingNoosh/Teknik
 /**
  * testIsPrimitiveTypeReturnsFalseForNotMatchingInput
  *
  * @return void
  */
 public function testIsPrimitiveTypeReturnsFalseForNotMatchingInput()
 {
     self::assertFalse(PHP_Depend_Util_Type::isPrimitiveType('input'));
 }