diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2024-10-01 16:00:34 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2024-10-01 16:00:34 +0300 |
| commit | 884fd92f1320d17daebb772297da03fb2cfa59b8 (patch) | |
| tree | 3aa80af1df6ffa1d70f21f9fc4411f451c8b6c56 /vendor/php-http/discovery/src/Exception | |
| parent | 8fcc68baf5b0ff964a0a4a045353462586e0e316 (diff) | |
drop opentelemetry
Diffstat (limited to 'vendor/php-http/discovery/src/Exception')
6 files changed, 0 insertions, 155 deletions
diff --git a/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php b/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php deleted file mode 100644 index e95bf5d82..000000000 --- a/vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -namespace Http\Discovery\Exception; - -use Http\Discovery\Exception; - -/** - * Thrown when a class fails to instantiate. - * - * @author Tobias Nyholm <tobias.nyholm@gmail.com> - */ -final class ClassInstantiationFailedException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php b/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php deleted file mode 100644 index 304b7276e..000000000 --- a/vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php +++ /dev/null @@ -1,51 +0,0 @@ -<?php - -namespace Http\Discovery\Exception; - -use Http\Discovery\Exception; - -/** - * Thrown when all discovery strategies fails to find a resource. - * - * @author Tobias Nyholm <tobias.nyholm@gmail.com> - */ -final class DiscoveryFailedException extends \Exception implements Exception -{ - /** - * @var \Exception[] - */ - private $exceptions; - - /** - * @param string $message - * @param \Exception[] $exceptions - */ - public function __construct($message, array $exceptions = []) - { - $this->exceptions = $exceptions; - - parent::__construct($message); - } - - /** - * @param \Exception[] $exceptions - */ - public static function create($exceptions) - { - $message = 'Could not find resource using any discovery strategy. Find more information at http://docs.php-http.org/en/latest/discovery.html#common-errors'; - foreach ($exceptions as $e) { - $message .= "\n - ".$e->getMessage(); - } - $message .= "\n\n"; - - return new self($message, $exceptions); - } - - /** - * @return \Exception[] - */ - public function getExceptions() - { - return $this->exceptions; - } -} diff --git a/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php b/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php deleted file mode 100644 index 32f65db7b..000000000 --- a/vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php - -namespace Http\Discovery\Exception; - -use Http\Discovery\Exception; - -/** - * When we have used a strategy but no candidates provided by that strategy could be used. - * - * @author Tobias Nyholm <tobias.nyholm@gmail.com> - */ -final class NoCandidateFoundException extends \Exception implements Exception -{ - /** - * @param string $strategy - */ - public function __construct($strategy, array $candidates) - { - $classes = array_map( - function ($a) { - return $a['class']; - }, - $candidates - ); - - $message = sprintf( - 'No valid candidate found using strategy "%s". We tested the following candidates: %s.', - $strategy, - implode(', ', array_map([$this, 'stringify'], $classes)) - ); - - parent::__construct($message); - } - - private function stringify($mixed) - { - if (is_string($mixed)) { - return $mixed; - } - - if (is_array($mixed) && 2 === count($mixed)) { - return sprintf('%s::%s', $this->stringify($mixed[0]), $mixed[1]); - } - - return is_object($mixed) ? get_class($mixed) : gettype($mixed); - } -} diff --git a/vendor/php-http/discovery/src/Exception/NotFoundException.php b/vendor/php-http/discovery/src/Exception/NotFoundException.php deleted file mode 100644 index ef8b9c584..000000000 --- a/vendor/php-http/discovery/src/Exception/NotFoundException.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -namespace Http\Discovery\Exception; - -use Http\Discovery\Exception; - -/** - * Thrown when a discovery does not find any matches. - * - * @final do NOT extend this class, not final for BC reasons - * - * @author Márk Sági-Kazár <mark.sagikazar@gmail.com> - */ -/* final */ class NotFoundException extends \RuntimeException implements Exception -{ -} diff --git a/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php b/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php deleted file mode 100644 index a6ade7332..000000000 --- a/vendor/php-http/discovery/src/Exception/PuliUnavailableException.php +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -namespace Http\Discovery\Exception; - -/** - * Thrown when we can't use Puli for discovery. - * - * @author Tobias Nyholm <tobias.nyholm@gmail.com> - */ -final class PuliUnavailableException extends StrategyUnavailableException -{ -} diff --git a/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php b/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php deleted file mode 100644 index 89ecf3523..000000000 --- a/vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -namespace Http\Discovery\Exception; - -use Http\Discovery\Exception; - -/** - * This exception is thrown when we cannot use a discovery strategy. This is *not* thrown when - * the discovery fails to find a class. - * - * @author Tobias Nyholm <tobias.nyholm@gmail.com> - */ -class StrategyUnavailableException extends \RuntimeException implements Exception -{ -} |