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)); }
public function equals(PhpType $that) { if (parent::equals($that)) { return true; } if ($that->isUnknownType()) { return true; } return false; }