From 0226e0ca0dc70f9a0310b3eef045ee1c1e0ca3ac Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 13 Dec 2022 20:00:46 +0300 Subject: split into a separate repo --- .../src/Exceptions/FileinfoSupportMissing.php | 20 ++++++++++ .../src/Exceptions/IdnSupportMissing.php | 20 ++++++++++ .../src/Exceptions/IdnaConversionFailed.php | 46 ++++++++++++++++++++++ .../uri-interfaces/src/Exceptions/SyntaxError.php | 20 ++++++++++ 4 files changed, 106 insertions(+) create mode 100644 vendor/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php create mode 100644 vendor/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php create mode 100644 vendor/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php create mode 100644 vendor/league/uri-interfaces/src/Exceptions/SyntaxError.php (limited to 'vendor/league/uri-interfaces/src/Exceptions') diff --git a/vendor/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php b/vendor/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php new file mode 100644 index 0000000..0105b2d --- /dev/null +++ b/vendor/league/uri-interfaces/src/Exceptions/FileinfoSupportMissing.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace League\Uri\Exceptions; + +use League\Uri\Contracts\UriException; + +class FileinfoSupportMissing extends \RuntimeException implements UriException +{ +} diff --git a/vendor/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php b/vendor/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php new file mode 100644 index 0000000..8ff3b53 --- /dev/null +++ b/vendor/league/uri-interfaces/src/Exceptions/IdnSupportMissing.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace League\Uri\Exceptions; + +use League\Uri\Contracts\UriException; + +class IdnSupportMissing extends \RuntimeException implements UriException +{ +} diff --git a/vendor/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php b/vendor/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php new file mode 100644 index 0000000..80259f3 --- /dev/null +++ b/vendor/league/uri-interfaces/src/Exceptions/IdnaConversionFailed.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace League\Uri\Exceptions; + +use League\Uri\Idna\IdnaInfo; + +final class IdnaConversionFailed extends SyntaxError +{ + /** @var IdnaInfo|null */ + private $idnaInfo; + + private function __construct(string $message, IdnaInfo $idnaInfo = null) + { + parent::__construct($message); + $this->idnaInfo = $idnaInfo; + } + + public static function dueToIDNAError(string $domain, IdnaInfo $idnaInfo): self + { + return new self( + 'The host `'.$domain.'` is invalid : '.implode(', ', $idnaInfo->errorList()).' .', + $idnaInfo + ); + } + + public static function dueToInvalidHost(string $domain): self + { + return new self('The host `'.$domain.'` is not a valid IDN host'); + } + + public function idnaInfo(): ?IdnaInfo + { + return $this->idnaInfo; + } +} diff --git a/vendor/league/uri-interfaces/src/Exceptions/SyntaxError.php b/vendor/league/uri-interfaces/src/Exceptions/SyntaxError.php new file mode 100644 index 0000000..1b5e4cb --- /dev/null +++ b/vendor/league/uri-interfaces/src/Exceptions/SyntaxError.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace League\Uri\Exceptions; + +use League\Uri\Contracts\UriException; + +class SyntaxError extends \InvalidArgumentException implements UriException +{ +} -- cgit v1.2.3