コード例 #1
0
ファイル: Type.php プロジェクト: ablyler/phan
 /**
  * @return Type
  * Get a new type which is the generic array version of
  * this type. For instance, 'int' will produce 'int[]'.
  */
 public function asGenericArrayType() : Type
 {
     if ($this->name == 'array' || $this->name == 'mixed' || strpos($this->name, '[]') !== false) {
         return ArrayType::instance();
     }
     return GenericArrayType::fromElementType($this);
 }
コード例 #2
0
ファイル: UnionTypeTest.php プロジェクト: tpunt/phan
 public function testGenericArrayType()
 {
     $type = GenericArrayType::fromElementType(GenericArrayType::fromElementType(IntType::instance()));
     $this->assertEquals($type->genericArrayElementType()->__toString(), "int[]");
 }