aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/sabre/http
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/sabre/http')
-rw-r--r--vendor/sabre/http/.github/workflows/ci.yml17
-rw-r--r--vendor/sabre/http/.gitignore1
-rw-r--r--vendor/sabre/http/.php-cs-fixer.dist.php17
-rw-r--r--vendor/sabre/http/CHANGELOG.md31
-rw-r--r--vendor/sabre/http/composer.json6
-rw-r--r--vendor/sabre/http/lib/Auth/AWS.php16
-rw-r--r--vendor/sabre/http/lib/Auth/Digest.php6
-rw-r--r--vendor/sabre/http/lib/Client.php15
-rw-r--r--vendor/sabre/http/lib/Request.php1
-rw-r--r--vendor/sabre/http/lib/Response.php3
-rw-r--r--vendor/sabre/http/lib/Sapi.php24
-rw-r--r--vendor/sabre/http/lib/Version.php2
-rw-r--r--vendor/sabre/http/lib/functions.php17
13 files changed, 104 insertions, 52 deletions
diff --git a/vendor/sabre/http/.github/workflows/ci.yml b/vendor/sabre/http/.github/workflows/ci.yml
index cbb681e53..56bc1a321 100644
--- a/vendor/sabre/http/.github/workflows/ci.yml
+++ b/vendor/sabre/http/.github/workflows/ci.yml
@@ -12,15 +12,20 @@ jobs:
strategy:
fail-fast: false
matrix:
- php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
+ php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
coverage: ['xdebug']
+ code-style: ['yes']
code-analysis: ['no']
include:
- php-versions: '7.1'
+ code-style: 'yes'
+ code-analysis: 'yes'
+ - php-versions: '8.4'
+ code-style: 'yes'
code-analysis: 'yes'
steps:
- name: Checkout
- uses: actions/checkout@v2
+ uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
@@ -35,7 +40,7 @@ jobs:
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
- uses: actions/cache@v2
+ uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
@@ -45,8 +50,8 @@ jobs:
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Code Analysis (PHP CS-Fixer)
- if: matrix.code-analysis == 'yes'
- run: php vendor/bin/php-cs-fixer fix --dry-run --diff
+ if: matrix.code-style == 'yes'
+ run: PHP_CS_FIXER_IGNORE_ENV=true php vendor/bin/php-cs-fixer fix --dry-run --diff
- name: Code Analysis (PHPStan)
if: matrix.code-analysis == 'yes'
@@ -59,5 +64,5 @@ jobs:
run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml
- name: Code Coverage
- uses: codecov/codecov-action@v2
+ uses: codecov/codecov-action@v4
if: matrix.coverage != 'none'
diff --git a/vendor/sabre/http/.gitignore b/vendor/sabre/http/.gitignore
index 367bba576..a5356dd00 100644
--- a/vendor/sabre/http/.gitignore
+++ b/vendor/sabre/http/.gitignore
@@ -6,3 +6,4 @@ composer.lock
tests/cov/
.phpunit.result.cache
.php_cs.cache
+.php-cs-fixer.cache
diff --git a/vendor/sabre/http/.php-cs-fixer.dist.php b/vendor/sabre/http/.php-cs-fixer.dist.php
new file mode 100644
index 000000000..f9d4b7a8d
--- /dev/null
+++ b/vendor/sabre/http/.php-cs-fixer.dist.php
@@ -0,0 +1,17 @@
+<?php
+
+$finder = PhpCsFixer\Finder::create()
+ ->exclude('vendor')
+ ->in(__DIR__);
+
+$config = new PhpCsFixer\Config();
+$config->setRules([
+ '@PSR1' => true,
+ '@Symfony' => true,
+ 'nullable_type_declaration' => [
+ 'syntax' => 'question_mark',
+ ],
+ 'nullable_type_declaration_for_default_null_value' => true,
+]);
+$config->setFinder($finder);
+return $config; \ No newline at end of file
diff --git a/vendor/sabre/http/CHANGELOG.md b/vendor/sabre/http/CHANGELOG.md
index 2dddce4fb..4158150f4 100644
--- a/vendor/sabre/http/CHANGELOG.md
+++ b/vendor/sabre/http/CHANGELOG.md
@@ -1,6 +1,37 @@
ChangeLog
=========
+5.1.12 (2024-08-27)
+------------------
+
+* #243 add cs-fixer v3 (@phil-davis)
+
+5.1.11 (2024-07-26)
+------------------
+
+* #241 PHP 8.4 compliance (@phil-davis)
+
+5.1.10 (2023-08-18)
+------------------
+
+* #225 Enhance tests/bootstrap.php to find autoloader in more environments (@phil-davis)
+
+5.1.9 (2023-08-17)
+------------------
+
+* #223 skip testParseMimeTypeOnInvalidMimeType (@phil-davis)
+
+5.1.8 (2023-08-17)
+------------------
+
+* #215 Improve CURLOPT_HTTPHEADER Setting Assignment (@amrita-shrestha)
+
+5.1.7 (2023-06-26)
+------------------
+
+* #98 and #176 Add more tests (@peter279k)
+* #207 fix: handle client disconnect properly with ignore_user_abort true (@kesselb)
+
5.1.6 (2022-07-15)
------------------
diff --git a/vendor/sabre/http/composer.json b/vendor/sabre/http/composer.json
index 353646a28..48caa44f8 100644
--- a/vendor/sabre/http/composer.json
+++ b/vendor/sabre/http/composer.json
@@ -13,9 +13,9 @@
"sabre/uri" : "^2.0"
},
"require-dev" : {
- "friendsofphp/php-cs-fixer": "~2.17.1",
+ "friendsofphp/php-cs-fixer": "~2.17.1||^3.63",
"phpstan/phpstan": "^0.12",
- "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0"
+ "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.6"
},
"suggest" : {
"ext-curl" : " to make http requests with the Client class"
@@ -50,7 +50,7 @@
"phpstan analyse lib tests"
],
"cs-fixer": [
- "php-cs-fixer fix"
+ "PHP_CS_FIXER_IGNORE_ENV=true php-cs-fixer fix"
],
"phpunit": [
"phpunit --configuration tests/phpunit.xml"
diff --git a/vendor/sabre/http/lib/Auth/AWS.php b/vendor/sabre/http/lib/Auth/AWS.php
index ffda3cf15..2690c634d 100644
--- a/vendor/sabre/http/lib/Auth/AWS.php
+++ b/vendor/sabre/http/lib/Auth/AWS.php
@@ -22,14 +22,14 @@ class AWS extends AbstractAuth
*
* @var string
*/
- private $signature = null;
+ private $signature;
/**
* The accesskey supplied by the HTTP client.
*
* @var string
*/
- private $accessKey = null;
+ private $accessKey;
/**
* An error code, if any.
@@ -40,11 +40,11 @@ class AWS extends AbstractAuth
*/
public $errorCode = 0;
- const ERR_NOAWSHEADER = 1;
- const ERR_MD5CHECKSUMWRONG = 2;
- const ERR_INVALIDDATEFORMAT = 3;
- const ERR_REQUESTTIMESKEWED = 4;
- const ERR_INVALIDSIGNATURE = 5;
+ public const ERR_NOAWSHEADER = 1;
+ public const ERR_MD5CHECKSUMWRONG = 2;
+ public const ERR_INVALIDDATEFORMAT = 3;
+ public const ERR_REQUESTTIMESKEWED = 4;
+ public const ERR_INVALIDSIGNATURE = 5;
/**
* Gathers all information from the headers.
@@ -212,7 +212,7 @@ class AWS extends AbstractAuth
}
$key = str_pad($key, $blocksize, chr(0x00));
$ipad = str_repeat(chr(0x36), $blocksize);
- $opad = str_repeat(chr(0x5c), $blocksize);
+ $opad = str_repeat(chr(0x5C), $blocksize);
$hmac = pack('H*', sha1(($key ^ $opad).pack('H*', sha1(($key ^ $ipad).$message))));
return $hmac;
diff --git a/vendor/sabre/http/lib/Auth/Digest.php b/vendor/sabre/http/lib/Auth/Digest.php
index e80e78305..08fa34f90 100644
--- a/vendor/sabre/http/lib/Auth/Digest.php
+++ b/vendor/sabre/http/lib/Auth/Digest.php
@@ -34,8 +34,8 @@ class Digest extends AbstractAuth
/**
* These constants are used in setQOP();.
*/
- const QOP_AUTH = 1;
- const QOP_AUTHINT = 2;
+ public const QOP_AUTH = 1;
+ public const QOP_AUTHINT = 2;
protected $nonce;
protected $opaque;
@@ -177,8 +177,6 @@ class Digest extends AbstractAuth
* It should be compatible with mod_php format and other webservers.
*
* If the header could not be found, null will be returned
- *
- * @return mixed
*/
public function getDigest()
{
diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php
index 2bc7483a7..c00f9e1b1 100644
--- a/vendor/sabre/http/lib/Client.php
+++ b/vendor/sabre/http/lib/Client.php
@@ -175,7 +175,7 @@ class Client extends EventEmitter
* After calling sendAsync, you must therefore occasionally call the poll()
* method, or wait().
*/
- public function sendAsync(RequestInterface $request, callable $success = null, callable $error = null)
+ public function sendAsync(RequestInterface $request, ?callable $success = null, ?callable $error = null)
{
$this->emit('beforeRequest', [$request]);
$this->sendAsyncInternal($request, $success, $error);
@@ -299,8 +299,6 @@ class Client extends EventEmitter
* Adds a CURL setting.
*
* These settings will be included in every HTTP request.
- *
- * @param mixed $value
*/
public function addCurlSetting(int $name, $value)
{
@@ -402,7 +400,10 @@ class Client extends EventEmitter
$nHeaders[] = $key.': '.$value;
}
}
- $settings[CURLOPT_HTTPHEADER] = $nHeaders;
+
+ if ([] !== $nHeaders) {
+ $settings[CURLOPT_HTTPHEADER] = $nHeaders;
+ }
$settings[CURLOPT_URL] = $request->getUrl();
// FIXME: CURLOPT_PROTOCOLS is currently unsupported by HHVM
if (defined('CURLOPT_PROTOCOLS')) {
@@ -416,9 +417,9 @@ class Client extends EventEmitter
return $settings;
}
- const STATUS_SUCCESS = 0;
- const STATUS_CURLERROR = 1;
- const STATUS_HTTPERROR = 2;
+ public const STATUS_SUCCESS = 0;
+ public const STATUS_CURLERROR = 1;
+ public const STATUS_HTTPERROR = 2;
private function parseResponse(string $response, $curlHandle): array
{
diff --git a/vendor/sabre/http/lib/Request.php b/vendor/sabre/http/lib/Request.php
index b8395ff45..99a13d25a 100644
--- a/vendor/sabre/http/lib/Request.php
+++ b/vendor/sabre/http/lib/Request.php
@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace Sabre\HTTP;
-use LogicException;
use Sabre\Uri;
/**
diff --git a/vendor/sabre/http/lib/Response.php b/vendor/sabre/http/lib/Response.php
index c06c9637e..78ebb220d 100644
--- a/vendor/sabre/http/lib/Response.php
+++ b/vendor/sabre/http/lib/Response.php
@@ -100,10 +100,9 @@ class Response extends Message implements ResponseInterface
* Creates the response object.
*
* @param string|int $status
- * @param array $headers
* @param resource $body
*/
- public function __construct($status = 500, array $headers = null, $body = null)
+ public function __construct($status = 500, ?array $headers = null, $body = null)
{
if (null !== $status) {
$this->setStatus($status);
diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php
index f8e8397fc..4c8fb6732 100644
--- a/vendor/sabre/http/lib/Sapi.php
+++ b/vendor/sabre/http/lib/Sapi.php
@@ -4,8 +4,6 @@ declare(strict_types=1);
namespace Sabre\HTTP;
-use InvalidArgumentException;
-
/**
* PHP SAPI.
*
@@ -115,6 +113,12 @@ class Sapi
if ($copied <= 0) {
break;
}
+ // Abort on client disconnect.
+ // With ignore_user_abort(true), the script is not aborted on client disconnect.
+ // To avoid reading the entire stream and dismissing the data afterward, check between the chunks if the client is still there.
+ if (1 === ignore_user_abort() && 1 === connection_aborted()) {
+ break;
+ }
$left -= $copied;
}
} else {
@@ -162,7 +166,7 @@ class Sapi
$url = $value;
break;
- // These sometimes show up without a HTTP_ prefix
+ // These sometimes show up without a HTTP_ prefix
case 'CONTENT_TYPE':
$headers['Content-Type'] = $value;
break;
@@ -170,21 +174,21 @@ class Sapi
$headers['Content-Length'] = $value;
break;
- // mod_php on apache will put credentials in these variables.
- // (fast)cgi does not usually do this, however.
+ // mod_php on apache will put credentials in these variables.
+ // (fast)cgi does not usually do this, however.
case 'PHP_AUTH_USER':
if (isset($serverArray['PHP_AUTH_PW'])) {
$headers['Authorization'] = 'Basic '.base64_encode($value.':'.$serverArray['PHP_AUTH_PW']);
}
break;
- // Similarly, mod_php may also screw around with digest auth.
+ // Similarly, mod_php may also screw around with digest auth.
case 'PHP_AUTH_DIGEST':
$headers['Authorization'] = 'Digest '.$value;
break;
- // Apache may prefix the HTTP_AUTHORIZATION header with
- // REDIRECT_, if mod_rewrite was used.
+ // Apache may prefix the HTTP_AUTHORIZATION header with
+ // REDIRECT_, if mod_rewrite was used.
case 'REDIRECT_HTTP_AUTHORIZATION':
$headers['Authorization'] = $value;
break;
@@ -220,11 +224,11 @@ class Sapi
}
if (null === $url) {
- throw new InvalidArgumentException('The _SERVER array must have a REQUEST_URI key');
+ throw new \InvalidArgumentException('The _SERVER array must have a REQUEST_URI key');
}
if (null === $method) {
- throw new InvalidArgumentException('The _SERVER array must have a REQUEST_METHOD key');
+ throw new \InvalidArgumentException('The _SERVER array must have a REQUEST_METHOD key');
}
$r = new Request($method, $url, $headers);
$r->setHttpVersion($httpVersion);
diff --git a/vendor/sabre/http/lib/Version.php b/vendor/sabre/http/lib/Version.php
index 47582f22e..4ac82f6d7 100644
--- a/vendor/sabre/http/lib/Version.php
+++ b/vendor/sabre/http/lib/Version.php
@@ -16,5 +16,5 @@ class Version
/**
* Full version number.
*/
- const VERSION = '5.1.6';
+ public const VERSION = '5.1.12';
}
diff --git a/vendor/sabre/http/lib/functions.php b/vendor/sabre/http/lib/functions.php
index d0477d943..9ecc1758a 100644
--- a/vendor/sabre/http/lib/functions.php
+++ b/vendor/sabre/http/lib/functions.php
@@ -4,9 +4,6 @@ declare(strict_types=1);
namespace Sabre\HTTP;
-use DateTime;
-use InvalidArgumentException;
-
/**
* A collection of useful helpers for parsing or generating various HTTP
* headers.
@@ -29,7 +26,7 @@ use InvalidArgumentException;
* See:
* http://tools.ietf.org/html/rfc7231#section-7.1.1.1
*
- * @return bool|DateTime
+ * @return bool|\DateTime
*/
function parseDate(string $dateString)
{
@@ -65,7 +62,7 @@ function parseDate(string $dateString)
}
try {
- return new DateTime($dateString, new \DateTimeZone('UTC'));
+ return new \DateTime($dateString, new \DateTimeZone('UTC'));
} catch (\Exception $e) {
return false;
}
@@ -74,7 +71,7 @@ function parseDate(string $dateString)
/**
* Transforms a DateTime object to a valid HTTP/1.1 Date header value.
*/
-function toDate(DateTime $dateTime): string
+function toDate(\DateTime $dateTime): string
{
// We need to clone it, as we don't want to affect the existing
// DateTime.
@@ -171,9 +168,9 @@ function negotiateContentType($acceptHeaderValue, array $availableOptions)
// Does this entry win?
if (
- ($proposal['quality'] > $lastQuality) ||
- ($proposal['quality'] === $lastQuality && $specificity > $lastSpecificity) ||
- ($proposal['quality'] === $lastQuality && $specificity === $lastSpecificity && $optionIndex < $lastOptionIndex)
+ ($proposal['quality'] > $lastQuality)
+ || ($proposal['quality'] === $lastQuality && $specificity > $lastSpecificity)
+ || ($proposal['quality'] === $lastQuality && $specificity === $lastSpecificity && $optionIndex < $lastOptionIndex)
) {
$lastQuality = $proposal['quality'];
$lastSpecificity = $specificity;
@@ -331,7 +328,7 @@ function parseMimeType(string $str): array
if (2 !== count($mimeType)) {
// Illegal value
var_dump($mimeType);
- exit();
+ exit;
// throw new InvalidArgumentException('Not a valid mime-type: '.$str);
}
list($type, $subType) = $mimeType;