Update website
This commit is contained in:
parent
4413528994
commit
1d90fbf296
6865 changed files with 1091082 additions and 0 deletions
24
vendor/symfony/http-client/Exception/ClientException.php
vendored
Normal file
24
vendor/symfony/http-client/Exception/ClientException.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface;
|
||||
|
||||
/**
|
||||
* Represents a 4xx response.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class ClientException extends \RuntimeException implements ClientExceptionInterface
|
||||
{
|
||||
use HttpExceptionTrait;
|
||||
}
|
21
vendor/symfony/http-client/Exception/EventSourceException.php
vendored
Normal file
21
vendor/symfony/http-client/Exception/EventSourceException.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class EventSourceException extends \RuntimeException implements DecodingExceptionInterface
|
||||
{
|
||||
}
|
78
vendor/symfony/http-client/Exception/HttpExceptionTrait.php
vendored
Normal file
78
vendor/symfony/http-client/Exception/HttpExceptionTrait.php
vendored
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\ResponseInterface;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
trait HttpExceptionTrait
|
||||
{
|
||||
private $response;
|
||||
|
||||
public function __construct(ResponseInterface $response)
|
||||
{
|
||||
$this->response = $response;
|
||||
$code = $response->getInfo('http_code');
|
||||
$url = $response->getInfo('url');
|
||||
$message = sprintf('HTTP %d returned for "%s".', $code, $url);
|
||||
|
||||
$httpCodeFound = false;
|
||||
$isJson = false;
|
||||
foreach (array_reverse($response->getInfo('response_headers')) as $h) {
|
||||
if (str_starts_with($h, 'HTTP/')) {
|
||||
if ($httpCodeFound) {
|
||||
break;
|
||||
}
|
||||
|
||||
$message = sprintf('%s returned for "%s".', $h, $url);
|
||||
$httpCodeFound = true;
|
||||
}
|
||||
|
||||
if (0 === stripos($h, 'content-type:')) {
|
||||
if (preg_match('/\bjson\b/i', $h)) {
|
||||
$isJson = true;
|
||||
}
|
||||
|
||||
if ($httpCodeFound) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Try to guess a better error message using common API error formats
|
||||
// The MIME type isn't explicitly checked because some formats inherit from others
|
||||
// Ex: JSON:API follows RFC 7807 semantics, Hydra can be used in any JSON-LD-compatible format
|
||||
if ($isJson && $body = json_decode($response->getContent(false), true)) {
|
||||
if (isset($body['hydra:title']) || isset($body['hydra:description'])) {
|
||||
// see http://www.hydra-cg.com/spec/latest/core/#description-of-http-status-codes-and-errors
|
||||
$separator = isset($body['hydra:title'], $body['hydra:description']) ? "\n\n" : '';
|
||||
$message = ($body['hydra:title'] ?? '').$separator.($body['hydra:description'] ?? '');
|
||||
} elseif ((isset($body['title']) || isset($body['detail']))
|
||||
&& (\is_scalar($body['title'] ?? '') && \is_scalar($body['detail'] ?? ''))) {
|
||||
// see RFC 7807 and https://jsonapi.org/format/#error-objects
|
||||
$separator = isset($body['title'], $body['detail']) ? "\n\n" : '';
|
||||
$message = ($body['title'] ?? '').$separator.($body['detail'] ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
parent::__construct($message, $code);
|
||||
}
|
||||
|
||||
public function getResponse(): ResponseInterface
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
}
|
21
vendor/symfony/http-client/Exception/InvalidArgumentException.php
vendored
Normal file
21
vendor/symfony/http-client/Exception/InvalidArgumentException.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class InvalidArgumentException extends \InvalidArgumentException implements TransportExceptionInterface
|
||||
{
|
||||
}
|
23
vendor/symfony/http-client/Exception/JsonException.php
vendored
Normal file
23
vendor/symfony/http-client/Exception/JsonException.php
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
|
||||
|
||||
/**
|
||||
* Thrown by responses' toArray() method when their content cannot be JSON-decoded.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class JsonException extends \JsonException implements DecodingExceptionInterface
|
||||
{
|
||||
}
|
24
vendor/symfony/http-client/Exception/RedirectionException.php
vendored
Normal file
24
vendor/symfony/http-client/Exception/RedirectionException.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface;
|
||||
|
||||
/**
|
||||
* Represents a 3xx response.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class RedirectionException extends \RuntimeException implements RedirectionExceptionInterface
|
||||
{
|
||||
use HttpExceptionTrait;
|
||||
}
|
24
vendor/symfony/http-client/Exception/ServerException.php
vendored
Normal file
24
vendor/symfony/http-client/Exception/ServerException.php
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface;
|
||||
|
||||
/**
|
||||
* Represents a 5xx response.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class ServerException extends \RuntimeException implements ServerExceptionInterface
|
||||
{
|
||||
use HttpExceptionTrait;
|
||||
}
|
21
vendor/symfony/http-client/Exception/TimeoutException.php
vendored
Normal file
21
vendor/symfony/http-client/Exception/TimeoutException.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\Exception\TimeoutExceptionInterface;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class TimeoutException extends TransportException implements TimeoutExceptionInterface
|
||||
{
|
||||
}
|
21
vendor/symfony/http-client/Exception/TransportException.php
vendored
Normal file
21
vendor/symfony/http-client/Exception/TransportException.php
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\HttpClient\Exception;
|
||||
|
||||
use Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class TransportException extends \RuntimeException implements TransportExceptionInterface
|
||||
{
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue