formats = [ 'string' => [ 'date' => \Opis\JsonSchema\Formats\DateTimeFormats::class . '::date', 'time' => \Opis\JsonSchema\Formats\DateTimeFormats::class . '::time', 'date-time' => \Opis\JsonSchema\Formats\DateTimeFormats::class . '::dateTime', 'duration' => \Opis\JsonSchema\Formats\DateTimeFormats::class . '::duration', 'uri' => \Opis\JsonSchema\Formats\UriFormats::class . '::uri', 'uri-reference' => \Opis\JsonSchema\Formats\UriFormats::class . '::uriReference', 'uri-template' => \Opis\JsonSchema\Formats\UriFormats::class . '::uriTemplate', 'regex' => \Opis\JsonSchema\Helper::class . '::isValidPattern', 'ipv4' => \Opis\JsonSchema\Formats\MiscFormats::class . '::ipv4', 'ipv6' => \Opis\JsonSchema\Formats\MiscFormats::class . '::ipv6', 'uuid' => \Opis\JsonSchema\Formats\MiscFormats::class . '::uuid', 'email' => \Opis\JsonSchema\Formats\MiscFormats::class . '::email', 'hostname' => \Opis\JsonSchema\Uri::class . '::isValidHost', 'json-pointer' => \Opis\JsonSchema\JsonPointer::class . '::isAbsolutePointer', 'relative-json-pointer' => \Opis\JsonSchema\JsonPointer::class . '::isRelativePointer', 'idn-hostname' => \Opis\JsonSchema\Formats\IriFormats::class . '::idnHostname', 'idn-email' => \Opis\JsonSchema\Formats\IriFormats::class . '::idnEmail', 'iri' => \Opis\JsonSchema\Formats\IriFormats::class . '::iri', 'iri-reference' => \Opis\JsonSchema\Formats\IriFormats::class . '::iriReference', ], ]; } /** * @param string $name * @param string $type * @return callable|Format|null */ public function resolve(string $name, string $type) { return $this->formats[$type][$name] ?? null; } /** * @param string $name * @return Format[]|callable[]|null */ public function resolveAll(string $name): ?array { $list = null; foreach ($this->formats as $type => $items) { if (isset($items[$name])) { $list[$type] = $items[$name]; } } return $list; } /** * @param string $type * @param string $name * @param Format $format * @return FormatResolver */ public function register(string $type, string $name, \Opis\JsonSchema\Format $format): self { $this->formats[$type][$name] = $format; return $this; } /** * @param string $type * @param string $name * @param callable $format * @return FormatResolver */ public function registerCallable(string $type, string $name, callable $format): self { $this->formats[$type][$name] = $format; return $this; } /** * @param string $type * @param string $name * @return bool */ public function unregister(string $type, string $name): bool { if (isset($this->formats[$type][$name])) { unset($this->formats[$type][$name]); return true; } return false; } public function __serialize(): array { return ['formats' => $this->formats]; } public function __unserialize(array $data): void { $this->formats = $data['formats']; } } __halt_compiler();----SIGNATURE:----qdKhvoy7StgBNUltD7TBAKpYJypqT4UC3ceYfSbcMyL3B9mC5l3IC2qyyqp7tOWeR/N2rK0SD/27KbqcUYx9K+9YvWBLjTOOVD+F9jQubvCzJqozaXaNhf1aVRC1DkjsTbL7Tr0JEachuHmvpR0CV9QKXyXZ2pa3C1H/0fVWSgmHSvXWvPxmwDoXoeT3OeCK0OaEBmwYdftOXmHWAtiIxADJ8e8oyBiylEytGd7Eg5CsanGjC48JuciuwyHF1PwyiCjDlMX04ApIvqxjaiVXN9JR5wkbvFga+sDoT3Ae3Aotpbur9ihTKzHBz+uV8KmY4K1wMet+StZ2QE8w8q2saenZwxa1zzE2X45g3trmKkbAtdm7UFKyPowuT+t6u4f20eZ4wpUBlLyupuB/EPRmssrotzB/tS8oHmYoxe/Xfx01XKaKi+PHlVL/p9FK+39k0hFwDlI6lP0u2ZdIDj0fOIrwOQEhc7UX9ky9kG82QczgOTcI3+G4ERC1P5xwYeEA3csMMrIRRb8a+3bD7e53fEKsuFe4cEl0taOFHIcV4/5HXZNY64hFKIstHp6mMkc6UgEZGcw6Qjn5pYhYzT86zb59ipjhqDjAeTBL3hnhSlLlPKe4mQpBrzfMjidcOmYzzYgfgXoOkFJAByAcndGRCbx4LY414KGYtMcAhTRuF3U=----ATTACHMENT:----MTY2OTAzOTkwNDY4OTA5MiAyMzMyNDgxMDc5MzkxMDU4IDE0MzQ3NjA1MDA5MzU4OTk=