* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ abstract class TypeAbstract implements TypeInterface, \JsonSerializable { const TYPE_BOOLEAN = 'boolean'; const TYPE_OBJECT = 'object'; const TYPE_ARRAY = 'array'; const TYPE_NUMBER = 'number'; const TYPE_INTEGER = 'integer'; const TYPE_STRING = 'string'; const TYPE_ANY = 'any'; const FORMAT_INT32 = 'int32'; const FORMAT_INT64 = 'int64'; const FORMAT_BINARY = 'base64'; const FORMAT_DATETIME = 'date-time'; const FORMAT_DATE = 'date'; const FORMAT_DURATION = 'duration'; const FORMAT_TIME = 'time'; const FORMAT_URI = 'uri'; const ATTR_CLASS = 'class'; const ATTR_MAPPING = 'mapping'; /** @var string */ protected $title; /** @var string */ protected $description; /** @var boolean */ protected $nullable; /** @var boolean */ protected $deprecated; /** @var boolean */ protected $readonly; /** @var array */ protected $attributes = []; /** * @return string */ public function getTitle(): ?string { return $this->title; } /** * @param string $title * @return self */ public function setTitle(string $title): self { $this->title = $title; return $this; } /** * @return string */ public function getDescription(): ?string { return $this->description; } /** * @param string $description * @return self */ public function setDescription(string $description): self { $this->description = $description; return $this; } /** * @return bool */ public function isNullable(): ?bool { return $this->nullable; } /** * @param bool $nullable * @return self */ public function setNullable(bool $nullable): self { $this->nullable = $nullable; return $this; } /** * @return bool */ public function isDeprecated(): ?bool { return $this->deprecated; } /** * @param bool $deprecated * @return self */ public function setDeprecated(bool $deprecated): self { $this->deprecated = $deprecated; return $this; } /** * @return bool */ public function isReadonly(): ?bool { return $this->readonly; } /** * @param bool $readonly * @return self */ public function setReadonly(bool $readonly): self { $this->readonly = $readonly; return $this; } /** * @param string $key * @param mixed $value * @return self */ public function setAttribute(string $key, $value): self { $this->attributes[$key] = $value; return $this; } /** * @param string $key * @return mixed|null */ public function getAttribute(string $key) { return $this->attributes[$key] ?? null; } /** * @return array */ public function getAttributes() { return $this->attributes; } public function toArray(): array { return array_filter([ 'title' => $this->title, 'description' => $this->description, 'nullable' => $this->nullable, 'deprecated' => $this->deprecated, 'readonly' => $this->readonly, ], function($value){ return $value !== null; }); } public function jsonSerialize() { return $this->toArray(); } } __halt_compiler();----SIGNATURE:----BXGGBFdMIhzOW9zA3h3e3yz7g7inmjYQw4nJ0QAx4dYXqWY2x4AQLLpBDeWLLxst2O4JONCF1nrLIc2ANZD3WLq6BpctD8HH/zvof/n0lOH0yAHqXerj5FL1TnjeyXNTphlmpYwNy6yp3da6xAXZhca8eR6HZaiGjUJxjGJ3FVJjGPGw7o3vAEEC6jQU3EgYFFKZgJzd40tzRTCK6zK7f7b+K78TlKNlAKGAxZZKwvrdTlah0FsLweeLwtBJTeb8TcM3nvaKm28f2Iiub9UC09SND2rE7QEizxH613lFX1AWkBdJI2GSY7Axmcf5Ee2Mfq8c/TC+Hr6szu2sVvrRnIz8HkXdWtdekJfujVR+985gURucMBhLiKe/Td9CrfVQ+Nw/dxJxOxxMU4wIvLRYyA6kuAeeVhSCYCtWJBTQ3f2U1OC1i9BYeWrxZyq0SLS8Xeq4Dm/mPWnXJ3vXNVPnfhb2QVa2gEUH/iW5ShMdrsyet52ZBQ0vwHiUUz+DclPNc9OliKAXoGTGC9VWpJ0vXp+x334ZYeWrqpS1QOt8VeYzyRv6Q7/J4X6BakHSBDB90bn0KkrrP7BMImKTT8cdPIWjjOfPXL9wjxILEBoB5h02ggjzYh5HaM2XmRKS+Z4Zm4o/DgBYUNhK4oGCzwHcfl45Ulrqw/MyAGOvKk0mhAA=----ATTACHMENT:----MjU5MDM1MDAxMjA4ODIwMSA4Nzk5OTM5NTYyNDAyNDE5IDI1Njk3MzMxMjA1MTk5OQ==