diff options
Diffstat (limited to 'vendor/sabre/event')
-rw-r--r-- | vendor/sabre/event/.github/workflows/ci.yml | 63 | ||||
-rw-r--r-- | vendor/sabre/event/.php-cs-fixer.dist.php | 18 | ||||
-rw-r--r-- | vendor/sabre/event/.php_cs.dist | 12 | ||||
-rw-r--r-- | vendor/sabre/event/bin/.empty | 0 | ||||
-rw-r--r-- | vendor/sabre/event/composer.json | 6 | ||||
-rw-r--r-- | vendor/sabre/event/lib/EmitterInterface.php | 4 | ||||
-rw-r--r-- | vendor/sabre/event/lib/EmitterTrait.php | 4 | ||||
-rw-r--r-- | vendor/sabre/event/lib/Loop/Loop.php | 4 | ||||
-rw-r--r-- | vendor/sabre/event/lib/Loop/functions.php | 2 | ||||
-rw-r--r-- | vendor/sabre/event/lib/Promise.php | 26 | ||||
-rw-r--r-- | vendor/sabre/event/lib/Promise/functions.php | 5 | ||||
-rw-r--r-- | vendor/sabre/event/lib/Version.php | 2 | ||||
-rw-r--r-- | vendor/sabre/event/lib/WildcardEmitterTrait.php | 4 | ||||
-rw-r--r-- | vendor/sabre/event/lib/coroutine.php | 15 | ||||
-rw-r--r-- | vendor/sabre/event/phpstan.neon | 2 |
15 files changed, 48 insertions, 119 deletions
diff --git a/vendor/sabre/event/.github/workflows/ci.yml b/vendor/sabre/event/.github/workflows/ci.yml deleted file mode 100644 index 3473cd2de..000000000 --- a/vendor/sabre/event/.github/workflows/ci.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: continuous-integration -on: - push: - branches: - - master - - release/* - pull_request: -jobs: - unit-testing: - name: PHPUnit (PHP ${{ matrix.php-versions }}) - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] - coverage: ['pcov'] - code-analysis: ['no'] - include: - - php-versions: '7.1' - coverage: 'none' - code-analysis: 'yes' - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup PHP, with composer and extensions - uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php - with: - php-version: ${{ matrix.php-versions }} - extensions: mbstring, dom, fileinfo, mysql, redis, opcache - coverage: ${{ matrix.coverage }} - tools: composer - - - name: Get composer cache directory - id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: Cache composer dependencies - uses: actions/cache@v2 - with: - path: ${{ steps.composer-cache.outputs.dir }} - # Use composer.json for key, if composer.lock is not committed. - # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- - - - name: Install composer dependencies - 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 - - - name: Code Analysis (PHPStan) - if: matrix.code-analysis == 'yes' - run: composer phpstan - - - name: Test with phpunit - run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml - - - name: Code Coverage - uses: codecov/codecov-action@v2 - if: matrix.coverage != 'none' diff --git a/vendor/sabre/event/.php-cs-fixer.dist.php b/vendor/sabre/event/.php-cs-fixer.dist.php new file mode 100644 index 000000000..319886c6b --- /dev/null +++ b/vendor/sabre/event/.php-cs-fixer.dist.php @@ -0,0 +1,18 @@ +<?php + +$finder = PhpCsFixer\Finder::create() + ->exclude('vendor') + ->in(__DIR__); + +$config = new PhpCsFixer\Config(); +$config->setRules([ + '@PSR1' => true, + '@Symfony' => true, + 'blank_line_between_import_groups' => false, + '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/event/.php_cs.dist b/vendor/sabre/event/.php_cs.dist deleted file mode 100644 index c5c78a971..000000000 --- a/vendor/sabre/event/.php_cs.dist +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -$config = PhpCsFixer\Config::create(); -$config->getFinder() - ->exclude('vendor') - ->in(__DIR__); -$config->setRules([ - '@PSR1' => true, - '@Symfony' => true -]); - -return $config;
\ No newline at end of file diff --git a/vendor/sabre/event/bin/.empty b/vendor/sabre/event/bin/.empty deleted file mode 100644 index e69de29bb..000000000 --- a/vendor/sabre/event/bin/.empty +++ /dev/null diff --git a/vendor/sabre/event/composer.json b/vendor/sabre/event/composer.json index 42fb4aa22..0d3ec0621 100644 --- a/vendor/sabre/event/composer.json +++ b/vendor/sabre/event/composer.json @@ -46,16 +46,16 @@ } }, "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" }, "scripts": { "phpstan": [ "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/event/lib/EmitterInterface.php b/vendor/sabre/event/lib/EmitterInterface.php index 6ce0f34db..662efd739 100644 --- a/vendor/sabre/event/lib/EmitterInterface.php +++ b/vendor/sabre/event/lib/EmitterInterface.php @@ -47,7 +47,7 @@ interface EmitterInterface * Lastly, if there are 5 event handlers for an event. The continueCallback * will be called at most 4 times. */ - public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool; + public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool; /** * Returns the list of listeners for an event. @@ -74,5 +74,5 @@ interface EmitterInterface * removed. If it is not specified, every listener for every event is * removed. */ - public function removeAllListeners(string $eventName = null); + public function removeAllListeners(?string $eventName = null); } diff --git a/vendor/sabre/event/lib/EmitterTrait.php b/vendor/sabre/event/lib/EmitterTrait.php index 5502ef9f3..5a0a23457 100644 --- a/vendor/sabre/event/lib/EmitterTrait.php +++ b/vendor/sabre/event/lib/EmitterTrait.php @@ -73,7 +73,7 @@ trait EmitterTrait * Lastly, if there are 5 event handlers for an event. The continueCallback * will be called at most 4 times. */ - public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool + public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool { if (\is_null($continueCallBack)) { foreach ($this->listeners($eventName) as $listener) { @@ -160,7 +160,7 @@ trait EmitterTrait * removed. If it is not specified, every listener for every event is * removed. */ - public function removeAllListeners(string $eventName = null) + public function removeAllListeners(?string $eventName = null) { if (!\is_null($eventName)) { unset($this->listeners[$eventName]); diff --git a/vendor/sabre/event/lib/Loop/Loop.php b/vendor/sabre/event/lib/Loop/Loop.php index b85a7a440..74981da08 100644 --- a/vendor/sabre/event/lib/Loop/Loop.php +++ b/vendor/sabre/event/lib/Loop/Loop.php @@ -24,7 +24,7 @@ class Loop */ public function setTimeout(callable $cb, float $timeout) { - $triggerTime = microtime(true) + ($timeout); + $triggerTime = microtime(true) + $timeout; if (!$this->timers) { // Special case when the timers array was empty. @@ -265,7 +265,7 @@ class Loop * If $timeout is 0, it will return immediately. If $timeout is null, it * will wait indefinitely. * - * @param float|null timeout + * @param float|null $timeout */ protected function runStreams($timeout) { diff --git a/vendor/sabre/event/lib/Loop/functions.php b/vendor/sabre/event/lib/Loop/functions.php index bf4d933f2..9412a77ff 100644 --- a/vendor/sabre/event/lib/Loop/functions.php +++ b/vendor/sabre/event/lib/Loop/functions.php @@ -130,7 +130,7 @@ function stop() /** * Retrieves or sets the global Loop object. */ -function instance(Loop $newLoop = null): Loop +function instance(?Loop $newLoop = null): Loop { static $loop; if ($newLoop) { diff --git a/vendor/sabre/event/lib/Promise.php b/vendor/sabre/event/lib/Promise.php index 42969a55f..66903fb9f 100644 --- a/vendor/sabre/event/lib/Promise.php +++ b/vendor/sabre/event/lib/Promise.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Sabre\Event; use Exception; -use Throwable; /** * An implementation of the Promise pattern. @@ -30,17 +29,17 @@ class Promise /** * The asynchronous operation is pending. */ - const PENDING = 0; + public const PENDING = 0; /** * The asynchronous operation has completed, and has a result. */ - const FULFILLED = 1; + public const FULFILLED = 1; /** * The asynchronous operation has completed with an error. */ - const REJECTED = 2; + public const REJECTED = 2; /** * The current state of this promise. @@ -58,7 +57,7 @@ class Promise * Each are callbacks that map to $this->fulfill and $this->reject. * Using the executor is optional. */ - public function __construct(callable $executor = null) + public function __construct(?callable $executor = null) { if ($executor) { $executor( @@ -87,7 +86,7 @@ class Promise * If either of the callbacks throw an exception, the returned promise will * be rejected and the exception will be passed back. */ - public function then(callable $onFulfilled = null, callable $onRejected = null): Promise + public function then(?callable $onFulfilled = null, ?callable $onRejected = null): Promise { // This new subPromise will be returned from this function, and will // be fulfilled with the result of the onFulfilled or onRejected event @@ -128,8 +127,6 @@ class Promise /** * Marks this promise as fulfilled and sets its return value. - * - * @param mixed $value */ public function fulfill($value = null) { @@ -146,7 +143,7 @@ class Promise /** * Marks this promise as rejected, and set its rejection reason. */ - public function reject(Throwable $reason) + public function reject(\Throwable $reason) { if (self::PENDING !== $this->state) { throw new PromiseAlreadyResolvedException('This promise is already resolved, and you\'re not allowed to resolve a promise more than once'); @@ -169,7 +166,6 @@ class Promise * one. In PHP it might be useful to call this on the last promise in a * chain. * - * @return mixed * @psalm-return TReturn */ public function wait() @@ -208,10 +204,8 @@ class Promise * * If the promise was fulfilled, this will be the result value. If the * promise was rejected, this property hold the rejection reason. - * - * @var mixed */ - protected $value = null; + protected $value; /** * This method is used to call either an onFulfilled or onRejected callback. @@ -219,10 +213,8 @@ class Promise * This method makes sure that the result of these callbacks are handled * correctly, and any chained promises are also correctly fulfilled or * rejected. - * - * @param callable $callBack */ - private function invokeCallback(Promise $subPromise, callable $callBack = null) + private function invokeCallback(Promise $subPromise, ?callable $callBack = null) { // We use 'nextTick' to ensure that the event handlers are always // triggered outside of the calling stack in which they were originally @@ -244,7 +236,7 @@ class Promise // immediately fulfill the chained promise. $subPromise->fulfill($result); } - } catch (Throwable $e) { + } catch (\Throwable $e) { // If the event handler threw an exception, we need to make sure that // the chained promise is rejected as well. $subPromise->reject($e); diff --git a/vendor/sabre/event/lib/Promise/functions.php b/vendor/sabre/event/lib/Promise/functions.php index fbed63471..67e80cbe4 100644 --- a/vendor/sabre/event/lib/Promise/functions.php +++ b/vendor/sabre/event/lib/Promise/functions.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Sabre\Event\Promise; use Sabre\Event\Promise; -use Throwable; /** * This file contains a set of functions that are useful for dealing with the @@ -101,8 +100,6 @@ function race(array $promises): Promise * * If the value is a promise, the returned promise will attach itself to that * promise and eventually get the same state as the followed promise. - * - * @param mixed $value */ function resolve($value): Promise { @@ -119,7 +116,7 @@ function resolve($value): Promise /** * Returns a Promise that will reject with the given reason. */ -function reject(Throwable $reason): Promise +function reject(\Throwable $reason): Promise { $promise = new Promise(); $promise->reject($reason); diff --git a/vendor/sabre/event/lib/Version.php b/vendor/sabre/event/lib/Version.php index fe8f5c3bf..10a98c607 100644 --- a/vendor/sabre/event/lib/Version.php +++ b/vendor/sabre/event/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.1.4'; + public const VERSION = '5.1.7'; } diff --git a/vendor/sabre/event/lib/WildcardEmitterTrait.php b/vendor/sabre/event/lib/WildcardEmitterTrait.php index 206a8f3c5..69243ff83 100644 --- a/vendor/sabre/event/lib/WildcardEmitterTrait.php +++ b/vendor/sabre/event/lib/WildcardEmitterTrait.php @@ -82,7 +82,7 @@ trait WildcardEmitterTrait * Lastly, if there are 5 event handlers for an event. The continueCallback * will be called at most 4 times. */ - public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool + public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool { if (\is_null($continueCallBack)) { foreach ($this->listeners($eventName) as $listener) { @@ -195,7 +195,7 @@ trait WildcardEmitterTrait * removed. If it is not specified, every listener for every event is * removed. */ - public function removeAllListeners(string $eventName = null) + public function removeAllListeners(?string $eventName = null) { if (\is_null($eventName)) { $this->listeners = []; diff --git a/vendor/sabre/event/lib/coroutine.php b/vendor/sabre/event/lib/coroutine.php index cdf2d3ecd..f664efa78 100644 --- a/vendor/sabre/event/lib/coroutine.php +++ b/vendor/sabre/event/lib/coroutine.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Sabre\Event; use Generator; -use Throwable; /** * Turn asynchronous promise-based code into something that looks synchronous @@ -42,10 +41,10 @@ use Throwable; * * }); * - * @return \Sabre\Event\Promise - * * @psalm-template TReturn + * * @psalm-param callable():\Generator<mixed, mixed, mixed, TReturn> $gen + * * @psalm-return Promise<TReturn> * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) @@ -55,7 +54,7 @@ use Throwable; function coroutine(callable $gen): Promise { $generator = $gen(); - if (!$generator instanceof Generator) { + if (!$generator instanceof \Generator) { throw new \InvalidArgumentException('You must pass a generator function'); } @@ -75,11 +74,11 @@ function coroutine(callable $gen): Promise $generator->send($value); $advanceGenerator(); }, - function (Throwable $reason) use ($generator, $advanceGenerator) { + function (\Throwable $reason) use ($generator, $advanceGenerator) { $generator->throw($reason); $advanceGenerator(); } - )->otherwise(function (Throwable $reason) use ($promise) { + )->otherwise(function (\Throwable $reason) use ($promise) { // This error handler would be called, if something in the // generator throws an exception, and it's not caught // locally. @@ -104,7 +103,7 @@ function coroutine(callable $gen): Promise if ($returnValue instanceof Promise) { $returnValue->then(function ($value) use ($promise) { $promise->fulfill($value); - }, function (Throwable $reason) use ($promise) { + }, function (\Throwable $reason) use ($promise) { $promise->reject($reason); }); } else { @@ -115,7 +114,7 @@ function coroutine(callable $gen): Promise try { $advanceGenerator(); - } catch (Throwable $e) { + } catch (\Throwable $e) { $promise->reject($e); } diff --git a/vendor/sabre/event/phpstan.neon b/vendor/sabre/event/phpstan.neon deleted file mode 100644 index 213da6dad..000000000 --- a/vendor/sabre/event/phpstan.neon +++ /dev/null @@ -1,2 +0,0 @@ -parameters: - level: 1 |