Пример #1
0
 public function getDisplayName()
 {
     if ($this->keyType->equals($this->registry->getNativeType('generic_array_key')) && $this->elementType->equals($this->registry->getNativeType('generic_array_value'))) {
         return 'array';
     }
     if (empty($this->itemTypes)) {
         return 'array<' . $this->keyType . ',' . $this->elementType . '>';
     }
     return sprintf('array<%s,%s,%s>', $this->keyType, $this->elementType, json_encode(array_map('strval', $this->itemTypes), JSON_FORCE_OBJECT));
 }
Пример #2
0
 public function equals(PhpType $that)
 {
     if (parent::equals($that)) {
         return true;
     }
     if ($that->isUnknownType()) {
         return true;
     }
     return false;
 }