mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-31 09:09:59 +09:00
Update composer dependencies
This commit is contained in:
parent
f99b38192b
commit
49dde388fe
163 changed files with 1765 additions and 5676 deletions
16
vendor/guzzlehttp/psr7/.github/workflows/bc.yml
vendored
Normal file
16
vendor/guzzlehttp/psr7/.github/workflows/bc.yml
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
name: BC Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
roave-bc-check:
|
||||
name: Roave BC Check
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Roave BC Check
|
||||
uses: docker://nyholm/roave-bc-check-ga
|
||||
30
vendor/guzzlehttp/psr7/.github/workflows/ci.yml
vendored
Normal file
30
vendor/guzzlehttp/psr7/.github/workflows/ci.yml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 10
|
||||
matrix:
|
||||
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
|
||||
|
||||
steps:
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: 'none'
|
||||
extensions: mbstring
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer update --no-interaction --no-progress --prefer-dist
|
||||
|
||||
- name: Run tests
|
||||
run: make test
|
||||
37
vendor/guzzlehttp/psr7/.github/workflows/integration.yml
vendored
Normal file
37
vendor/guzzlehttp/psr7/.github/workflows/integration.yml
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
name: Integration
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 10
|
||||
matrix:
|
||||
php: ['7.2', '7.3', '7.4', '8.0']
|
||||
|
||||
steps:
|
||||
- name: Set up PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: none
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Download dependencies
|
||||
uses: ramsey/composer-install@v1
|
||||
with:
|
||||
composer-options: --no-interaction --prefer-dist --optimize-autoloader
|
||||
|
||||
- name: Start server
|
||||
run: php -S 127.0.0.1:10002 tests/Integration/server.php &
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
TEST_SERVER: 127.0.0.1:10002
|
||||
run: ./vendor/bin/phpunit --testsuite Integration
|
||||
29
vendor/guzzlehttp/psr7/.github/workflows/static.yml
vendored
Normal file
29
vendor/guzzlehttp/psr7/.github/workflows/static.yml
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
name: Static analysis
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
php-cs-fixer:
|
||||
name: PHP-CS-Fixer
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '7.4'
|
||||
coverage: none
|
||||
extensions: mbstring
|
||||
|
||||
- name: Download dependencies
|
||||
run: composer update --no-interaction --no-progress
|
||||
|
||||
- name: Download PHP CS Fixer
|
||||
run: composer require "friendsofphp/php-cs-fixer:2.18.4"
|
||||
|
||||
- name: Execute PHP CS Fixer
|
||||
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run
|
||||
56
vendor/guzzlehttp/psr7/.php_cs.dist
vendored
Normal file
56
vendor/guzzlehttp/psr7/.php_cs.dist
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
$config = PhpCsFixer\Config::create()
|
||||
->setRiskyAllowed(true)
|
||||
->setRules([
|
||||
'@PSR2' => true,
|
||||
'array_syntax' => ['syntax' => 'short'],
|
||||
'concat_space' => ['spacing' => 'one'],
|
||||
'declare_strict_types' => false,
|
||||
'final_static_access' => true,
|
||||
'fully_qualified_strict_types' => true,
|
||||
'header_comment' => false,
|
||||
'is_null' => ['use_yoda_style' => true],
|
||||
'list_syntax' => ['syntax' => 'long'],
|
||||
'lowercase_cast' => true,
|
||||
'magic_method_casing' => true,
|
||||
'modernize_types_casting' => true,
|
||||
'multiline_comment_opening_closing' => true,
|
||||
'no_alias_functions' => true,
|
||||
'no_alternative_syntax' => true,
|
||||
'no_blank_lines_after_phpdoc' => true,
|
||||
'no_empty_comment' => true,
|
||||
'no_empty_phpdoc' => true,
|
||||
'no_empty_statement' => true,
|
||||
'no_extra_blank_lines' => true,
|
||||
'no_leading_import_slash' => true,
|
||||
'no_trailing_comma_in_singleline_array' => true,
|
||||
'no_unset_cast' => true,
|
||||
'no_unused_imports' => true,
|
||||
'no_whitespace_in_blank_line' => true,
|
||||
'ordered_imports' => true,
|
||||
'php_unit_ordered_covers' => true,
|
||||
'php_unit_test_annotation' => ['style' => 'prefix'],
|
||||
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
|
||||
'phpdoc_align' => ['align' => 'vertical'],
|
||||
'phpdoc_no_useless_inheritdoc' => true,
|
||||
'phpdoc_scalar' => true,
|
||||
'phpdoc_separation' => true,
|
||||
'phpdoc_single_line_var_spacing' => true,
|
||||
'phpdoc_trim' => true,
|
||||
'phpdoc_trim_consecutive_blank_line_separation' => true,
|
||||
'phpdoc_types' => true,
|
||||
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
|
||||
'phpdoc_var_without_name' => true,
|
||||
'single_trait_insert_per_statement' => true,
|
||||
'standardize_not_equals' => true,
|
||||
])
|
||||
->setFinder(
|
||||
PhpCsFixer\Finder::create()
|
||||
->in(__DIR__.'/src')
|
||||
->in(__DIR__.'/tests')
|
||||
->name('*.php')
|
||||
)
|
||||
;
|
||||
|
||||
return $config;
|
||||
30
vendor/guzzlehttp/psr7/CHANGELOG.md
vendored
30
vendor/guzzlehttp/psr7/CHANGELOG.md
vendored
|
|
@ -7,9 +7,34 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [Unreleased]
|
||||
## Unreleased
|
||||
|
||||
## [1.7.0] - 2020-09-30
|
||||
## 1.8.2 - 2021-04-26
|
||||
|
||||
### Fixed
|
||||
|
||||
- Handle possibly unset `url` in `stream_get_meta_data`
|
||||
|
||||
## 1.8.1 - 2021-03-21
|
||||
|
||||
### Fixed
|
||||
|
||||
- Issue parsing IPv6 URLs
|
||||
- Issue modifying ServerRequest lost all its attributes
|
||||
|
||||
## 1.8.0 - 2021-03-21
|
||||
|
||||
### Added
|
||||
|
||||
- Locale independent URL parsing
|
||||
- Most classes got a `@final` annotation to prepare for 2.0
|
||||
|
||||
### Fixed
|
||||
|
||||
- Issue when creating stream from `php://input` and curl-ext is not installed
|
||||
- Broken `Utils::tryFopen()` on PHP 8
|
||||
|
||||
## 1.7.0 - 2020-09-30
|
||||
|
||||
### Added
|
||||
|
||||
|
|
@ -253,7 +278,6 @@ Currently unsupported:
|
|||
|
||||
|
||||
|
||||
[Unreleased]: https://github.com/guzzle/psr7/compare/1.6.0...HEAD
|
||||
[1.6.0]: https://github.com/guzzle/psr7/compare/1.5.2...1.6.0
|
||||
[1.5.2]: https://github.com/guzzle/psr7/compare/1.5.1...1.5.2
|
||||
[1.5.1]: https://github.com/guzzle/psr7/compare/1.5.0...1.5.1
|
||||
|
|
|
|||
2
vendor/guzzlehttp/psr7/src/AppendStream.php
vendored
2
vendor/guzzlehttp/psr7/src/AppendStream.php
vendored
|
|
@ -8,6 +8,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
* Reads from multiple streams, one after the other.
|
||||
*
|
||||
* This is a read-only stream decorator.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class AppendStream implements StreamInterface
|
||||
{
|
||||
|
|
|
|||
2
vendor/guzzlehttp/psr7/src/BufferStream.php
vendored
2
vendor/guzzlehttp/psr7/src/BufferStream.php
vendored
|
|
@ -11,6 +11,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
* This stream returns a "hwm" metadata value that tells upstream consumers
|
||||
* what the configured high water mark of the stream is, or the maximum
|
||||
* preferred size of the buffer.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class BufferStream implements StreamInterface
|
||||
{
|
||||
|
|
|
|||
6
vendor/guzzlehttp/psr7/src/CachingStream.php
vendored
6
vendor/guzzlehttp/psr7/src/CachingStream.php
vendored
|
|
@ -7,6 +7,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
/**
|
||||
* Stream decorator that can cache previously read bytes from a sequentially
|
||||
* read stream.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class CachingStream implements StreamInterface
|
||||
{
|
||||
|
|
@ -21,7 +23,7 @@ class CachingStream implements StreamInterface
|
|||
/**
|
||||
* We will treat the buffer object as the body of the stream
|
||||
*
|
||||
* @param StreamInterface $stream Stream to cache
|
||||
* @param StreamInterface $stream Stream to cache. The cursor is assumed to be at the beginning of the stream.
|
||||
* @param StreamInterface $target Optionally specify where data is cached
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
@ -29,7 +31,7 @@ class CachingStream implements StreamInterface
|
|||
StreamInterface $target = null
|
||||
) {
|
||||
$this->remoteStream = $stream;
|
||||
$this->stream = $target ?: new Stream(fopen('php://temp', 'r+'));
|
||||
$this->stream = $target ?: new Stream(Utils::tryFopen('php://temp', 'r+'));
|
||||
}
|
||||
|
||||
public function getSize()
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
/**
|
||||
* Stream decorator that begins dropping data once the size of the underlying
|
||||
* stream becomes too full.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DroppingStream implements StreamInterface
|
||||
{
|
||||
|
|
|
|||
3
vendor/guzzlehttp/psr7/src/FnStream.php
vendored
3
vendor/guzzlehttp/psr7/src/FnStream.php
vendored
|
|
@ -9,6 +9,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
*
|
||||
* Allows for easy testing and extension of a provided stream without needing
|
||||
* to create a concrete class for a simple extension point.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class FnStream implements StreamInterface
|
||||
{
|
||||
|
|
@ -56,6 +58,7 @@ class FnStream implements StreamInterface
|
|||
|
||||
/**
|
||||
* An unserialize would allow the __destruct to run when the unserialized value goes out of scope.
|
||||
*
|
||||
* @throws \LogicException
|
||||
*/
|
||||
public function __wakeup()
|
||||
|
|
|
|||
3
vendor/guzzlehttp/psr7/src/InflateStream.php
vendored
3
vendor/guzzlehttp/psr7/src/InflateStream.php
vendored
|
|
@ -14,6 +14,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
*
|
||||
* @link http://tools.ietf.org/html/rfc1952
|
||||
* @link http://php.net/manual/en/filters.compression.php
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class InflateStream implements StreamInterface
|
||||
{
|
||||
|
|
@ -34,6 +36,7 @@ class InflateStream implements StreamInterface
|
|||
/**
|
||||
* @param StreamInterface $stream
|
||||
* @param $header
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
/**
|
||||
* Lazily reads or writes to a file that is opened only after an IO operation
|
||||
* take place on the stream.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class LazyOpenStream implements StreamInterface
|
||||
{
|
||||
|
|
@ -15,7 +17,7 @@ class LazyOpenStream implements StreamInterface
|
|||
/** @var string File to open */
|
||||
private $filename;
|
||||
|
||||
/** @var string $mode */
|
||||
/** @var string */
|
||||
private $mode;
|
||||
|
||||
/**
|
||||
|
|
|
|||
5
vendor/guzzlehttp/psr7/src/LimitStream.php
vendored
5
vendor/guzzlehttp/psr7/src/LimitStream.php
vendored
|
|
@ -4,9 +4,10 @@ namespace GuzzleHttp\Psr7;
|
|||
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
|
||||
/**
|
||||
* Decorator used to return only a subset of a stream
|
||||
* Decorator used to return only a subset of a stream.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class LimitStream implements StreamInterface
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
/**
|
||||
* Stream that when read returns bytes for a streaming multipart or
|
||||
* multipart/form-data stream.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class MultipartStream implements StreamInterface
|
||||
{
|
||||
|
|
@ -115,9 +117,11 @@ class MultipartStream implements StreamInterface
|
|||
$disposition = $this->getHeader($headers, 'content-disposition');
|
||||
if (!$disposition) {
|
||||
$headers['Content-Disposition'] = ($filename === '0' || $filename)
|
||||
? sprintf('form-data; name="%s"; filename="%s"',
|
||||
? sprintf(
|
||||
'form-data; name="%s"; filename="%s"',
|
||||
$name,
|
||||
basename($filename))
|
||||
basename($filename)
|
||||
)
|
||||
: "form-data; name=\"{$name}\"";
|
||||
}
|
||||
|
||||
|
|
|
|||
4
vendor/guzzlehttp/psr7/src/NoSeekStream.php
vendored
4
vendor/guzzlehttp/psr7/src/NoSeekStream.php
vendored
|
|
@ -5,7 +5,9 @@ namespace GuzzleHttp\Psr7;
|
|||
use Psr\Http\Message\StreamInterface;
|
||||
|
||||
/**
|
||||
* Stream decorator that prevents a stream from being seeked
|
||||
* Stream decorator that prevents a stream from being seeked.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class NoSeekStream implements StreamInterface
|
||||
{
|
||||
|
|
|
|||
18
vendor/guzzlehttp/psr7/src/PumpStream.php
vendored
18
vendor/guzzlehttp/psr7/src/PumpStream.php
vendored
|
|
@ -13,6 +13,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
* returned by the provided callable is buffered internally until drained using
|
||||
* the read() function of the PumpStream. The provided callable MUST return
|
||||
* false when there is no more data to read.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class PumpStream implements StreamInterface
|
||||
{
|
||||
|
|
@ -32,14 +34,14 @@ class PumpStream implements StreamInterface
|
|||
private $buffer;
|
||||
|
||||
/**
|
||||
* @param callable $source Source of the stream data. The callable MAY
|
||||
* accept an integer argument used to control the
|
||||
* amount of data to return. The callable MUST
|
||||
* return a string when called, or false on error
|
||||
* or EOF.
|
||||
* @param array $options Stream options:
|
||||
* - metadata: Hash of metadata to use with stream.
|
||||
* - size: Size of the stream, if known.
|
||||
* @param callable $source Source of the stream data. The callable MAY
|
||||
* accept an integer argument used to control the
|
||||
* amount of data to return. The callable MUST
|
||||
* return a string when called, or false on error
|
||||
* or EOF.
|
||||
* @param array $options Stream options:
|
||||
* - metadata: Hash of metadata to use with stream.
|
||||
* - size: Size of the stream, if known.
|
||||
*/
|
||||
public function __construct(callable $source, array $options = [])
|
||||
{
|
||||
|
|
|
|||
9
vendor/guzzlehttp/psr7/src/Query.php
vendored
9
vendor/guzzlehttp/psr7/src/Query.php
vendored
|
|
@ -34,7 +34,9 @@ final class Query
|
|||
} elseif ($urlEncoding === PHP_QUERY_RFC1738) {
|
||||
$decoder = 'urldecode';
|
||||
} else {
|
||||
$decoder = function ($str) { return $str; };
|
||||
$decoder = function ($str) {
|
||||
return $str;
|
||||
};
|
||||
}
|
||||
|
||||
foreach (explode('&', $str) as $kvp) {
|
||||
|
|
@ -65,6 +67,7 @@ final class Query
|
|||
* @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
|
||||
* to encode using RFC3986, or PHP_QUERY_RFC1738
|
||||
* to encode using RFC1738.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function build(array $params, $encoding = PHP_QUERY_RFC3986)
|
||||
|
|
@ -74,7 +77,9 @@ final class Query
|
|||
}
|
||||
|
||||
if ($encoding === false) {
|
||||
$encoder = function ($str) { return $str; };
|
||||
$encoder = function ($str) {
|
||||
return $str;
|
||||
};
|
||||
} elseif ($encoding === PHP_QUERY_RFC3986) {
|
||||
$encoder = 'rawurlencode';
|
||||
} elseif ($encoding === PHP_QUERY_RFC1738) {
|
||||
|
|
|
|||
4
vendor/guzzlehttp/psr7/src/Request.php
vendored
4
vendor/guzzlehttp/psr7/src/Request.php
vendored
|
|
@ -17,7 +17,7 @@ class Request implements RequestInterface
|
|||
/** @var string */
|
||||
private $method;
|
||||
|
||||
/** @var null|string */
|
||||
/** @var string|null */
|
||||
private $requestTarget;
|
||||
|
||||
/** @var UriInterface */
|
||||
|
|
@ -27,7 +27,7 @@ class Request implements RequestInterface
|
|||
* @param string $method HTTP method
|
||||
* @param string|UriInterface $uri URI
|
||||
* @param array $headers Request headers
|
||||
* @param string|null|resource|StreamInterface $body Request body
|
||||
* @param string|resource|StreamInterface|null $body Request body
|
||||
* @param string $version Protocol version
|
||||
*/
|
||||
public function __construct(
|
||||
|
|
|
|||
2
vendor/guzzlehttp/psr7/src/Response.php
vendored
2
vendor/guzzlehttp/psr7/src/Response.php
vendored
|
|
@ -83,7 +83,7 @@ class Response implements ResponseInterface
|
|||
/**
|
||||
* @param int $status Status code
|
||||
* @param array $headers Response headers
|
||||
* @param string|null|resource|StreamInterface $body Response body
|
||||
* @param string|resource|StreamInterface|null $body Response body
|
||||
* @param string $version Protocol version
|
||||
* @param string|null $reason Reason phrase (when empty a default will be used based on the status code)
|
||||
*/
|
||||
|
|
|
|||
1
vendor/guzzlehttp/psr7/src/Rfc7230.php
vendored
1
vendor/guzzlehttp/psr7/src/Rfc7230.php
vendored
|
|
@ -11,6 +11,7 @@ final class Rfc7230
|
|||
* Note: header delimiter (\r\n) is modified to \r?\n to accept line feed only delimiters for BC reasons.
|
||||
*
|
||||
* @link https://github.com/amphp/http/blob/v1.0.1/src/Rfc7230.php#L12-L15
|
||||
*
|
||||
* @license https://github.com/amphp/http/blob/v1.0.1/LICENSE
|
||||
*/
|
||||
const HEADER_REGEX = "(^([^()<>@,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m";
|
||||
|
|
|
|||
11
vendor/guzzlehttp/psr7/src/ServerRequest.php
vendored
11
vendor/guzzlehttp/psr7/src/ServerRequest.php
vendored
|
|
@ -4,9 +4,9 @@ namespace GuzzleHttp\Psr7;
|
|||
|
||||
use InvalidArgumentException;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Message\UriInterface;
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
use Psr\Http\Message\UploadedFileInterface;
|
||||
use Psr\Http\Message\UriInterface;
|
||||
|
||||
/**
|
||||
* Server-side HTTP request
|
||||
|
|
@ -35,7 +35,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
private $cookieParams = [];
|
||||
|
||||
/**
|
||||
* @var null|array|object
|
||||
* @var array|object|null
|
||||
*/
|
||||
private $parsedBody;
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
* @param string $method HTTP method
|
||||
* @param string|UriInterface $uri URI
|
||||
* @param array $headers Request headers
|
||||
* @param string|null|resource|StreamInterface $body Request body
|
||||
* @param string|resource|StreamInterface|null $body Request body
|
||||
* @param string $version Protocol version
|
||||
* @param array $serverParams Typically the $_SERVER superglobal
|
||||
*/
|
||||
|
|
@ -111,6 +111,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
* delegate to normalizeNestedFileSpec() and return that return value.
|
||||
*
|
||||
* @param array $value $_FILES struct
|
||||
*
|
||||
* @return array|UploadedFileInterface
|
||||
*/
|
||||
private static function createUploadedFileFromSpec(array $value)
|
||||
|
|
@ -135,6 +136,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
* UploadedFileInterface instances.
|
||||
*
|
||||
* @param array $files
|
||||
*
|
||||
* @return UploadedFileInterface[]
|
||||
*/
|
||||
private static function normalizeNestedFileSpec(array $files = [])
|
||||
|
|
@ -184,7 +186,7 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
|
||||
private static function extractHostAndPortFromAuthority($authority)
|
||||
{
|
||||
$uri = 'http://'.$authority;
|
||||
$uri = 'http://' . $authority;
|
||||
$parts = parse_url($uri);
|
||||
if (false === $parts) {
|
||||
return [null, null];
|
||||
|
|
@ -245,7 +247,6 @@ class ServerRequest extends Request implements ServerRequestInterface
|
|||
return $uri;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ use Psr\Http\Message\StreamInterface;
|
|||
|
||||
/**
|
||||
* Stream decorator trait
|
||||
*
|
||||
* @property StreamInterface stream
|
||||
*/
|
||||
trait StreamDecoratorTrait
|
||||
|
|
|
|||
2
vendor/guzzlehttp/psr7/src/StreamWrapper.php
vendored
2
vendor/guzzlehttp/psr7/src/StreamWrapper.php
vendored
|
|
@ -6,6 +6,8 @@ use Psr\Http\Message\StreamInterface;
|
|||
|
||||
/**
|
||||
* Converts Guzzle streams into PHP stream resources.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class StreamWrapper
|
||||
{
|
||||
|
|
|
|||
29
vendor/guzzlehttp/psr7/src/UploadedFile.php
vendored
29
vendor/guzzlehttp/psr7/src/UploadedFile.php
vendored
|
|
@ -39,7 +39,7 @@ class UploadedFile implements UploadedFileInterface
|
|||
private $error;
|
||||
|
||||
/**
|
||||
* @var null|string
|
||||
* @var string|null
|
||||
*/
|
||||
private $file;
|
||||
|
||||
|
|
@ -60,10 +60,10 @@ class UploadedFile implements UploadedFileInterface
|
|||
|
||||
/**
|
||||
* @param StreamInterface|string|resource $streamOrFile
|
||||
* @param int $size
|
||||
* @param int $errorStatus
|
||||
* @param string|null $clientFilename
|
||||
* @param string|null $clientMediaType
|
||||
* @param int $size
|
||||
* @param int $errorStatus
|
||||
* @param string|null $clientFilename
|
||||
* @param string|null $clientMediaType
|
||||
*/
|
||||
public function __construct(
|
||||
$streamOrFile,
|
||||
|
|
@ -144,7 +144,8 @@ class UploadedFile implements UploadedFileInterface
|
|||
|
||||
/**
|
||||
* @param mixed $param
|
||||
* @return boolean
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isStringOrNull($param)
|
||||
{
|
||||
|
|
@ -153,7 +154,8 @@ class UploadedFile implements UploadedFileInterface
|
|||
|
||||
/**
|
||||
* @param mixed $param
|
||||
* @return boolean
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isStringNotEmpty($param)
|
||||
{
|
||||
|
|
@ -195,7 +197,7 @@ class UploadedFile implements UploadedFileInterface
|
|||
/**
|
||||
* Return true if there is no upload error
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
private function isOk()
|
||||
{
|
||||
|
|
@ -203,7 +205,7 @@ class UploadedFile implements UploadedFileInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
public function isMoved()
|
||||
{
|
||||
|
|
@ -248,10 +250,10 @@ class UploadedFile implements UploadedFileInterface
|
|||
*
|
||||
* @param string $targetPath Path to which to move the uploaded file.
|
||||
*
|
||||
* @throws RuntimeException if the upload was not successful.
|
||||
* @throws RuntimeException if the upload was not successful.
|
||||
* @throws InvalidArgumentException if the $path specified is invalid.
|
||||
* @throws RuntimeException on any error during the move operation, or on
|
||||
* the second or subsequent call to the method.
|
||||
* @throws RuntimeException on any error during the move operation, or on
|
||||
* the second or subsequent call to the method.
|
||||
*/
|
||||
public function moveTo($targetPath)
|
||||
{
|
||||
|
|
@ -297,6 +299,7 @@ class UploadedFile implements UploadedFileInterface
|
|||
* {@inheritdoc}
|
||||
*
|
||||
* @see http://php.net/manual/en/features.file-upload.errors.php
|
||||
*
|
||||
* @return int One of PHP's UPLOAD_ERR_XXX constants.
|
||||
*/
|
||||
public function getError()
|
||||
|
|
@ -308,7 +311,7 @@ class UploadedFile implements UploadedFileInterface
|
|||
* {@inheritdoc}
|
||||
*
|
||||
* @return string|null The filename sent by the client or null if none
|
||||
* was provided.
|
||||
* was provided.
|
||||
*/
|
||||
public function getClientFilename()
|
||||
{
|
||||
|
|
|
|||
61
vendor/guzzlehttp/psr7/src/Uri.php
vendored
61
vendor/guzzlehttp/psr7/src/Uri.php
vendored
|
|
@ -67,7 +67,7 @@ class Uri implements UriInterface
|
|||
{
|
||||
// weak type check to also accept null until we can add scalar type hints
|
||||
if ($uri != '') {
|
||||
$parts = parse_url($uri);
|
||||
$parts = self::parse($uri);
|
||||
if ($parts === false) {
|
||||
throw new \InvalidArgumentException("Unable to parse URI: $uri");
|
||||
}
|
||||
|
|
@ -75,6 +75,49 @@ class Uri implements UriInterface
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* UTF-8 aware \parse_url() replacement.
|
||||
*
|
||||
* The internal function produces broken output for non ASCII domain names
|
||||
* (IDN) when used with locales other than "C".
|
||||
*
|
||||
* On the other hand, cURL understands IDN correctly only when UTF-8 locale
|
||||
* is configured ("C.UTF-8", "en_US.UTF-8", etc.).
|
||||
*
|
||||
* @see https://bugs.php.net/bug.php?id=52923
|
||||
* @see https://www.php.net/manual/en/function.parse-url.php#114817
|
||||
* @see https://curl.haxx.se/libcurl/c/CURLOPT_URL.html#ENCODING
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @return array|false
|
||||
*/
|
||||
private static function parse($url)
|
||||
{
|
||||
// If IPv6
|
||||
$prefix = '';
|
||||
if (preg_match('%^(.*://\[[0-9:a-f]+\])(.*?)$%', $url, $matches)) {
|
||||
$prefix = $matches[1];
|
||||
$url = $matches[2];
|
||||
}
|
||||
|
||||
$encodedUrl = preg_replace_callback(
|
||||
'%[^:/@?&=#]+%usD',
|
||||
static function ($matches) {
|
||||
return urlencode($matches[0]);
|
||||
},
|
||||
$url
|
||||
);
|
||||
|
||||
$result = parse_url($prefix . $encodedUrl);
|
||||
|
||||
if ($result === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return array_map('urldecode', $result);
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return self::composeComponents(
|
||||
|
|
@ -167,6 +210,7 @@ class Uri implements UriInterface
|
|||
* @param UriInterface $uri
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @see Uri::isNetworkPathReference
|
||||
* @see Uri::isAbsolutePathReference
|
||||
* @see Uri::isRelativePathReference
|
||||
|
|
@ -185,6 +229,7 @@ class Uri implements UriInterface
|
|||
* @param UriInterface $uri
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @link https://tools.ietf.org/html/rfc3986#section-4.2
|
||||
*/
|
||||
public static function isNetworkPathReference(UriInterface $uri)
|
||||
|
|
@ -200,6 +245,7 @@ class Uri implements UriInterface
|
|||
* @param UriInterface $uri
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @link https://tools.ietf.org/html/rfc3986#section-4.2
|
||||
*/
|
||||
public static function isAbsolutePathReference(UriInterface $uri)
|
||||
|
|
@ -218,6 +264,7 @@ class Uri implements UriInterface
|
|||
* @param UriInterface $uri
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @link https://tools.ietf.org/html/rfc3986#section-4.2
|
||||
*/
|
||||
public static function isRelativePathReference(UriInterface $uri)
|
||||
|
|
@ -238,6 +285,7 @@ class Uri implements UriInterface
|
|||
* @param UriInterface|null $base An optional base URI to compare against
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @link https://tools.ietf.org/html/rfc3986#section-4.4
|
||||
*/
|
||||
public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null)
|
||||
|
|
@ -358,6 +406,7 @@ class Uri implements UriInterface
|
|||
* @param array $parts
|
||||
*
|
||||
* @return UriInterface
|
||||
*
|
||||
* @link http://php.net/manual/en/function.parse-url.php
|
||||
*
|
||||
* @throws \InvalidArgumentException If the components do not form a valid URI.
|
||||
|
|
@ -576,7 +625,7 @@ class Uri implements UriInterface
|
|||
throw new \InvalidArgumentException('Scheme must be a string');
|
||||
}
|
||||
|
||||
return strtolower($scheme);
|
||||
return \strtr($scheme, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -612,7 +661,7 @@ class Uri implements UriInterface
|
|||
throw new \InvalidArgumentException('Host must be a string');
|
||||
}
|
||||
|
||||
return strtolower($host);
|
||||
return \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -641,7 +690,7 @@ class Uri implements UriInterface
|
|||
/**
|
||||
* @param UriInterface $uri
|
||||
* @param array $keys
|
||||
*
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private static function getFilteredQueryString(UriInterface $uri, array $keys)
|
||||
|
|
@ -662,7 +711,7 @@ class Uri implements UriInterface
|
|||
/**
|
||||
* @param string $key
|
||||
* @param string|null $value
|
||||
*
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private static function generateQueryString($key, $value)
|
||||
|
|
@ -754,7 +803,7 @@ class Uri implements UriInterface
|
|||
'by adding a leading slash to the path is deprecated since version 1.4 and will throw an exception instead.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
$this->path = '/'. $this->path;
|
||||
$this->path = '/' . $this->path;
|
||||
//throw new \InvalidArgumentException('The path of a URI with an authority must start with a slash "/" or be empty');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
vendor/guzzlehttp/psr7/src/UriNormalizer.php
vendored
2
vendor/guzzlehttp/psr7/src/UriNormalizer.php
vendored
|
|
@ -115,6 +115,7 @@ final class UriNormalizer
|
|||
* @param int $flags A bitmask of normalizations to apply, see constants
|
||||
*
|
||||
* @return UriInterface The normalized URI
|
||||
*
|
||||
* @link https://tools.ietf.org/html/rfc3986#section-6.2
|
||||
*/
|
||||
public static function normalize(UriInterface $uri, $flags = self::PRESERVING_NORMALIZATIONS)
|
||||
|
|
@ -171,6 +172,7 @@ final class UriNormalizer
|
|||
* @param int $normalizations A bitmask of normalizations to apply, see constants
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @link https://tools.ietf.org/html/rfc3986#section-6.1
|
||||
*/
|
||||
public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS)
|
||||
|
|
|
|||
2
vendor/guzzlehttp/psr7/src/UriResolver.php
vendored
2
vendor/guzzlehttp/psr7/src/UriResolver.php
vendored
|
|
@ -19,6 +19,7 @@ final class UriResolver
|
|||
* @param string $path
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @link http://tools.ietf.org/html/rfc3986#section-5.2.4
|
||||
*/
|
||||
public static function removeDotSegments($path)
|
||||
|
|
@ -58,6 +59,7 @@ final class UriResolver
|
|||
* @param UriInterface $rel Relative URI
|
||||
*
|
||||
* @return UriInterface
|
||||
*
|
||||
* @link http://tools.ietf.org/html/rfc3986#section-5.2
|
||||
*/
|
||||
public static function resolve(UriInterface $base, UriInterface $rel)
|
||||
|
|
|
|||
44
vendor/guzzlehttp/psr7/src/Utils.php
vendored
44
vendor/guzzlehttp/psr7/src/Utils.php
vendored
|
|
@ -75,6 +75,7 @@ final class Utils
|
|||
* @param StreamInterface $stream Stream to read
|
||||
* @param int $maxLen Maximum number of bytes to read. Pass -1
|
||||
* to read the entire stream.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \RuntimeException on error.
|
||||
|
|
@ -181,7 +182,7 @@ final class Utils
|
|||
$standardPorts = ['http' => 80, 'https' => 443];
|
||||
$scheme = $changes['uri']->getScheme();
|
||||
if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) {
|
||||
$changes['set_headers']['Host'] .= ':'.$port;
|
||||
$changes['set_headers']['Host'] .= ':' . $port;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -202,7 +203,7 @@ final class Utils
|
|||
}
|
||||
|
||||
if ($request instanceof ServerRequestInterface) {
|
||||
return (new ServerRequest(
|
||||
$new = (new ServerRequest(
|
||||
isset($changes['method']) ? $changes['method'] : $request->getMethod(),
|
||||
$uri,
|
||||
$headers,
|
||||
|
|
@ -216,6 +217,12 @@ final class Utils
|
|||
->withQueryParams($request->getQueryParams())
|
||||
->withCookieParams($request->getCookieParams())
|
||||
->withUploadedFiles($request->getUploadedFiles());
|
||||
|
||||
foreach ($request->getAttributes() as $key => $value) {
|
||||
$new = $new->withAttribute($key, $value);
|
||||
}
|
||||
|
||||
return $new;
|
||||
}
|
||||
|
||||
return new Request(
|
||||
|
|
@ -286,7 +293,7 @@ final class Utils
|
|||
* number of requested bytes are available. Any additional bytes will be
|
||||
* buffered and used in subsequent reads.
|
||||
*
|
||||
* @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data
|
||||
* @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data
|
||||
* @param array $options Additional options
|
||||
*
|
||||
* @return StreamInterface
|
||||
|
|
@ -296,7 +303,7 @@ final class Utils
|
|||
public static function streamFor($resource = '', array $options = [])
|
||||
{
|
||||
if (is_scalar($resource)) {
|
||||
$stream = fopen('php://temp', 'r+');
|
||||
$stream = self::tryFopen('php://temp', 'r+');
|
||||
if ($resource !== '') {
|
||||
fwrite($stream, $resource);
|
||||
fseek($stream, 0);
|
||||
|
|
@ -306,6 +313,17 @@ final class Utils
|
|||
|
||||
switch (gettype($resource)) {
|
||||
case 'resource':
|
||||
/*
|
||||
* The 'php://input' is a special stream with quirks and inconsistencies.
|
||||
* We avoid using that stream by reading it into php://temp
|
||||
*/
|
||||
$metaData = \stream_get_meta_data($resource);
|
||||
if (isset($metaData['uri']) && $metaData['uri'] === 'php://input') {
|
||||
$stream = self::tryFopen('php://temp', 'w+');
|
||||
fwrite($stream, stream_get_contents($resource));
|
||||
fseek($stream, 0);
|
||||
$resource = $stream;
|
||||
}
|
||||
return new Stream($resource, $options);
|
||||
case 'object':
|
||||
if ($resource instanceof StreamInterface) {
|
||||
|
|
@ -324,7 +342,7 @@ final class Utils
|
|||
}
|
||||
break;
|
||||
case 'NULL':
|
||||
return new Stream(fopen('php://temp', 'r+'), $options);
|
||||
return new Stream(self::tryFopen('php://temp', 'r+'), $options);
|
||||
}
|
||||
|
||||
if (is_callable($resource)) {
|
||||
|
|
@ -352,14 +370,26 @@ final class Utils
|
|||
$ex = null;
|
||||
set_error_handler(function () use ($filename, $mode, &$ex) {
|
||||
$ex = new \RuntimeException(sprintf(
|
||||
'Unable to open %s using mode %s: %s',
|
||||
'Unable to open "%s" using mode "%s": %s',
|
||||
$filename,
|
||||
$mode,
|
||||
func_get_args()[1]
|
||||
));
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
$handle = fopen($filename, $mode);
|
||||
try {
|
||||
$handle = fopen($filename, $mode);
|
||||
} catch (\Throwable $e) {
|
||||
$ex = new \RuntimeException(sprintf(
|
||||
'Unable to open "%s" using mode "%s": %s',
|
||||
$filename,
|
||||
$mode,
|
||||
$e->getMessage()
|
||||
), 0, $e);
|
||||
}
|
||||
|
||||
restore_error_handler();
|
||||
|
||||
if ($ex) {
|
||||
|
|
|
|||
7
vendor/guzzlehttp/psr7/src/functions.php
vendored
7
vendor/guzzlehttp/psr7/src/functions.php
vendored
|
|
@ -70,7 +70,7 @@ function uri_for($uri)
|
|||
* number of requested bytes are available. Any additional bytes will be
|
||||
* buffered and used in subsequent reads.
|
||||
*
|
||||
* @param resource|string|null|int|float|bool|StreamInterface|callable|\Iterator $resource Entity body data
|
||||
* @param resource|string|int|float|bool|StreamInterface|callable|\Iterator|null $resource Entity body data
|
||||
* @param array $options Additional options
|
||||
*
|
||||
* @return StreamInterface
|
||||
|
|
@ -187,6 +187,7 @@ function try_fopen($filename, $mode)
|
|||
* @param StreamInterface $stream Stream to read
|
||||
* @param int $maxLen Maximum number of bytes to read. Pass -1
|
||||
* to read the entire stream.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @throws \RuntimeException on error.
|
||||
|
|
@ -311,6 +312,7 @@ function parse_query($str, $urlEncoding = true)
|
|||
* @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986
|
||||
* to encode using RFC3986, or PHP_QUERY_RFC1738
|
||||
* to encode using RFC1738.
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @deprecated build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead.
|
||||
|
|
@ -361,6 +363,7 @@ function mimetype_from_extension($extension)
|
|||
* @return array
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @deprecated _parse_message will be removed in guzzlehttp/psr7:2.0. Use Message::parseMessage instead.
|
||||
*/
|
||||
function _parse_message($message)
|
||||
|
|
@ -377,6 +380,7 @@ function _parse_message($message)
|
|||
* @return string
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @deprecated _parse_request_uri will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequestUri instead.
|
||||
*/
|
||||
function _parse_request_uri($path, array $headers)
|
||||
|
|
@ -409,6 +413,7 @@ function get_message_body_summary(MessageInterface $message, $truncateAt = 120)
|
|||
* @return array
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* @deprecated _caseless_remove will be removed in guzzlehttp/psr7:2.0. Use Utils::caselessRemove instead.
|
||||
*/
|
||||
function _caseless_remove($keys, array $data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue