From 446a0d67fa5033580f39588b362f0947fe177be0 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 13 Dec 2022 11:23:32 +0100 Subject: [PATCH] Update baseline --- composer.lock | 252 +++++++++++++------ config/psalm-baseline.xml | 67 ++++- src/Psl/Async/Internal/AwaitableIterator.php | 8 +- src/Psl/Filesystem/constants.php | 4 +- 4 files changed, 249 insertions(+), 82 deletions(-) diff --git a/composer.lock b/composer.lock index 172cc14d..8346d403 100644 --- a/composer.lock +++ b/composer.lock @@ -594,32 +594,35 @@ }, { "name": "doctrine/annotations", - "version": "1.13.3", + "version": "1.14.1", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" + "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/9e034d7a70032d422169f27d8759e8d84abb4f51", + "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", + "doctrine/lexer": "^1 || ^2", "ext-tokenizer": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6", "vimeo/psalm": "^4.10" }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, "type": "library", "autoload": { "psr-4": { @@ -661,9 +664,52 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.3" + "source": "https://github.com/doctrine/annotations/tree/1.14.1" + }, + "time": "2022-12-12T12:46:12+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } }, - "time": "2022-07-02T10:48:51+00:00" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" }, { "name": "doctrine/instantiator", @@ -737,31 +783,33 @@ }, { "name": "doctrine/lexer", - "version": "1.2.3", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "reference": "3cf140b81e55d5d640f73367d829db7e3023ef69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/3cf140b81e55d5d640f73367d829db7e3023ef69", + "reference": "3cf140b81e55d5d640f73367d829db7e3023ef69", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.0", "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^9 || ^10", "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.0" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Doctrine\\Common\\Lexer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -793,7 +841,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "source": "https://github.com/doctrine/lexer/tree/2.0.0" }, "funding": [ { @@ -809,7 +857,7 @@ "type": "tidelift" } ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2022-12-11T10:51:23+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -912,6 +960,67 @@ }, "time": "2022-03-02T22:36:06+00:00" }, + { + "name": "fidry/cpu-core-counter", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "666cb04a02f2801f3b19955fc23c824f9018bf64" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/666cb04a02f2801f3b19955fc23c824f9018bf64", + "reference": "666cb04a02f2801f3b19955fc23c824f9018bf64", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^9.5.26 || ^8.5.31", + "theofidry/php-cs-fixer-config": "^1.0", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2022-12-10T21:26:31+00:00" + }, { "name": "friendsofphp/php-cs-fixer", "version": "v3.13.0", @@ -1766,16 +1875,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v4.0.0", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", "shasum": "" }, "require": { @@ -1811,9 +1920,9 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" }, - "time": "2020-12-01T19:48:11+00:00" + "time": "2022-12-08T20:46:14+00:00" }, { "name": "nikic/php-parser", @@ -2260,16 +2369,16 @@ }, { "name": "php-standard-library/psalm-plugin", - "version": "2.2.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/php-standard-library/psalm-plugin.git", - "reference": "613569397ec5d9fe4357cfbbcb6c0d036395983a" + "reference": "068bc7a8fcbe53658c94d54eec65205eb7e6caae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-standard-library/psalm-plugin/zipball/613569397ec5d9fe4357cfbbcb6c0d036395983a", - "reference": "613569397ec5d9fe4357cfbbcb6c0d036395983a", + "url": "https://api.github.com/repos/php-standard-library/psalm-plugin/zipball/068bc7a8fcbe53658c94d54eec65205eb7e6caae", + "reference": "068bc7a8fcbe53658c94d54eec65205eb7e6caae", "shasum": "" }, "require": { @@ -2308,9 +2417,9 @@ "description": "Psalm plugin for the PHP Standard Library", "support": { "issues": "https://github.com/php-standard-library/psalm-plugin/issues", - "source": "https://github.com/php-standard-library/psalm-plugin/tree/2.2.0" + "source": "https://github.com/php-standard-library/psalm-plugin/tree/2.2.1" }, - "time": "2022-12-05T15:54:20+00:00" + "time": "2022-12-06T10:44:56+00:00" }, { "name": "phpbench/container", @@ -2671,16 +2780,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.19", + "version": "9.2.20", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559" + "reference": "af7463c955007de36db0c5e26d03e2f933c2e980" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c77b56b63e3d2031bd8997fcec43c1925ae46559", - "reference": "c77b56b63e3d2031bd8997fcec43c1925ae46559", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/af7463c955007de36db0c5e26d03e2f933c2e980", + "reference": "af7463c955007de36db0c5e26d03e2f933c2e980", "shasum": "" }, "require": { @@ -2736,7 +2845,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.19" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.20" }, "funding": [ { @@ -2744,7 +2853,7 @@ "type": "github" } ], - "time": "2022-11-18T07:47:47+00:00" + "time": "2022-12-13T07:49:28+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2989,16 +3098,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.26", + "version": "9.5.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2" + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/851867efcbb6a1b992ec515c71cdcf20d895e9d2", - "reference": "851867efcbb6a1b992ec515c71cdcf20d895e9d2", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", "shasum": "" }, "require": { @@ -3071,7 +3180,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.26" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" }, "funding": [ { @@ -3087,7 +3196,7 @@ "type": "tidelift" } ], - "time": "2022-10-28T06:00:21+00:00" + "time": "2022-12-09T07:31:23+00:00" }, { "name": "psr/cache", @@ -4832,16 +4941,16 @@ }, { "name": "symfony/console", - "version": "v6.2.0", + "version": "v6.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "75d4749d9620a8fa21a2d2847800a84b5c4e7682" + "reference": "58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/75d4749d9620a8fa21a2d2847800a84b5c4e7682", - "reference": "75d4749d9620a8fa21a2d2847800a84b5c4e7682", + "url": "https://api.github.com/repos/symfony/console/zipball/58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f", + "reference": "58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f", "shasum": "" }, "require": { @@ -4908,7 +5017,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.2.0" + "source": "https://github.com/symfony/console/tree/v6.2.1" }, "funding": [ { @@ -4924,20 +5033,20 @@ "type": "tidelift" } ], - "time": "2022-11-29T16:44:51+00:00" + "time": "2022-12-01T13:44:20+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", "shasum": "" }, "require": { @@ -4946,7 +5055,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -4975,7 +5084,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" }, "funding": [ { @@ -4991,7 +5100,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/event-dispatcher", @@ -5078,16 +5187,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448" + "reference": "0782b0b52a737a05b4383d0df35a474303cabdae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/02ff5eea2f453731cfbc6bc215e456b781480448", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0782b0b52a737a05b4383d0df35a474303cabdae", + "reference": "0782b0b52a737a05b4383d0df35a474303cabdae", "shasum": "" }, "require": { @@ -5100,7 +5209,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -5137,7 +5246,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.0" }, "funding": [ { @@ -5153,7 +5262,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/filesystem", @@ -6400,16 +6509,16 @@ }, { "name": "vimeo/psalm", - "version": "5.1.0", + "version": "5.2.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "4defa177c89397c5e14737a80fe4896584130674" + "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/4defa177c89397c5e14737a80fe4896584130674", - "reference": "4defa177c89397c5e14737a80fe4896584130674", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/fb685a16df3050d4c18d8a4100fe83abe6458cba", + "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba", "shasum": "" }, "require": { @@ -6428,6 +6537,7 @@ "ext-tokenizer": "*", "felixfbecker/advanced-json-rpc": "^3.1", "felixfbecker/language-server-protocol": "^1.5.2", + "fidry/cpu-core-counter": "^0.4.0", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", @@ -6498,9 +6608,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.1.0" + "source": "https://github.com/vimeo/psalm/tree/5.2.0" }, - "time": "2022-12-02T01:23:35+00:00" + "time": "2022-12-12T08:18:56+00:00" }, { "name": "webmozart/assert", @@ -6624,5 +6734,5 @@ "ext-intl": "*" }, "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.3.0" } diff --git a/config/psalm-baseline.xml b/config/psalm-baseline.xml index b2254c55..e71beff3 100644 --- a/config/psalm-baseline.xml +++ b/config/psalm-baseline.xml @@ -1,9 +1,68 @@ - + + + + Iter\Iterator::create($this->elements) + MutableVector::fromArray(array_keys($this->elements)) + + + Iter\Iterator<int, T> + MutableVector<int> + + + + + Iter\Iterator::create($this->elements) + self::fromArray(array_keys($this->elements)) + + + Iter\Iterator<int, T> + Vector<int> + + - - SEPARATOR - SEPARATOR + + $filename + + + $filename + + + $separator + + $separator + + + $separator + + + non-empty-string + + + + + $size === 0 + + + + + $result + $result + + + list<T> + + + + + $values[$i] + + + $result[] + + + 0 === $size + diff --git a/src/Psl/Async/Internal/AwaitableIterator.php b/src/Psl/Async/Internal/AwaitableIterator.php index 2804a03e..6b2603b1 100644 --- a/src/Psl/Async/Internal/AwaitableIterator.php +++ b/src/Psl/Async/Internal/AwaitableIterator.php @@ -36,7 +36,7 @@ final class AwaitableIterator private readonly AwaitableIteratorQueue $queue; /** - * @var null|Awaitable|Awaitable|Awaitable}> + * @var null|Awaitable|Awaitable|Awaitable}> */ private ?Awaitable $complete = null; @@ -124,7 +124,7 @@ public function error(Throwable $exception): void /** * @throws Psl\Exception\InvariantViolationException If {@see consume()} is called concurrently. * - * @return null|array{Tk, Awaitable} + * @return null|list{Tk, Awaitable} */ public function consume(): ?array { @@ -139,11 +139,11 @@ public function consume(): ?array $this->queue->suspension = EventLoop::getSuspension(); - /** @var null|array{0: Tk, 1: Awaitable} */ + /** @var null|list{Tk, Awaitable} */ return $this->queue->suspension->suspend(); } - /** @var null|array{0: Tk, 1: Awaitable} */ + /** @var null|list{Tk, Awaitable} */ return array_shift($this->queue->items); } diff --git a/src/Psl/Filesystem/constants.php b/src/Psl/Filesystem/constants.php index 70af81d4..0ebd77cc 100644 --- a/src/Psl/Filesystem/constants.php +++ b/src/Psl/Filesystem/constants.php @@ -6,7 +6,5 @@ use const DIRECTORY_SEPARATOR; -/** - * @var string - */ +/** @var non-empty-string */ const SEPARATOR = DIRECTORY_SEPARATOR;