getIdentifier() public method

Gets a unique string representation of the type.
public getIdentifier ( ) : string
return string
 protected function assertEqualTypes(IType $expected, IType $actual, $message = '')
 {
     $this->assertSame($expected->getIdentifier(), $actual->getIdentifier(), $message);
     $this->assertTrue($expected->isEqualTo($actual), $message);
     $this->assertTrue($actual->isEqualTo($expected), $message);
     $this->assertSame($expected, $actual, $message);
 }
Esempio n. 2
0
 protected function getAncestorTypes(IType $type)
 {
     $ancestorTypes = [$type->getIdentifier() => $type];
     if (!$type->hasParentType()) {
         return $ancestorTypes;
     }
     if ($type instanceof ICompositeType) {
         foreach ($type->getComposedTypes() as $composedType) {
             $ancestorTypes += $this->getAncestorTypes($composedType);
         }
     } else {
         $parentType = $type->getParentType();
         $ancestorTypes[$parentType->getIdentifier()] = $parentType;
         $ancestorTypes += $this->getAncestorTypes($parentType);
     }
     return $ancestorTypes;
 }
Esempio n. 3
0
 public function isEqualTo(IType $type)
 {
     return $this->identifier === $type->getIdentifier();
 }