isPrimitiveType() public static method

This method will return true when the given type identifier is in the list of primitive types.
Since: 0.9.6
public static isPrimitiveType ( string $image ) : boolean
$image string The type image.
return boolean
コード例 #1
0
 /**
  * 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 \PDepend\Source\AST\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 (Type::isPrimitiveType($annotation) === true) {
             return $this->builder->buildAstPrimitiveType(Type::getPrimitiveType($annotation));
         } elseif (Type::isArrayType($annotation) === true) {
             return $this->builder->buildAstTypeArray();
         }
     }
     return null;
 }
コード例 #2
0
 /**
  * testIsPrimitiveTypeReturnsFalseForNotMatchingInput
  *
  * @return void
  */
 public function testIsPrimitiveTypeReturnsFalseForNotMatchingInput()
 {
     $this->assertFalse(Type::isPrimitiveType('input'));
 }