allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
14
vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php
vendored
Normal file
14
vendor/php-http/discovery/src/Exception/ClassInstantiationFailedException.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?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
|
||||
{
|
||||
}
|
||||
51
vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php
vendored
Normal file
51
vendor/php-http/discovery/src/Exception/DiscoveryFailedException.php
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
47
vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php
vendored
Normal file
47
vendor/php-http/discovery/src/Exception/NoCandidateFoundException.php
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
16
vendor/php-http/discovery/src/Exception/NotFoundException.php
vendored
Normal file
16
vendor/php-http/discovery/src/Exception/NotFoundException.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?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
|
||||
{
|
||||
}
|
||||
12
vendor/php-http/discovery/src/Exception/PuliUnavailableException.php
vendored
Normal file
12
vendor/php-http/discovery/src/Exception/PuliUnavailableException.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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
|
||||
{
|
||||
}
|
||||
15
vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php
vendored
Normal file
15
vendor/php-http/discovery/src/Exception/StrategyUnavailableException.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?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
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user