From c55dff8341feeb29b6f04a00724e33b6af01ec66 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Dec 2022 00:27:58 +0000 Subject: [PATCH 1/7] Update dependency vimeo/psalm to v5 | datasource | package | from | to | | ---------- | ----------- | ------ | ----- | | packagist | vimeo/psalm | 4.30.0 | 5.2.0 | Signed-off-by: Renovate Bot --- composer.json | 2 +- composer.lock | 239 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 156 insertions(+), 85 deletions(-) diff --git a/composer.json b/composer.json index 8a70e28..9f37833 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "mikey179/vfsstream": "^1.6.11", "phpunit/phpunit": "^9.5.26", "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^4.29.0" + "vimeo/psalm": "^5.0.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index ed58e28..5a07127 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d31e8e22eebcc9e09f4db3f335dfe6b3", + "content-hash": "3e939700543a95fe6fa28bcad3a4ce40", "packages": [ { "name": "laminas/laminas-cli", @@ -1946,6 +1946,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": "laminas/laminas-coding-standard", "version": "2.4.0", @@ -4203,6 +4264,70 @@ }, "time": "2022-06-18T07:21:10+00:00" }, + { + "name": "symfony/filesystem", + "version": "v5.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "ac09569844a9109a5966b9438fc29113ce77cf51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ac09569844a9109a5966b9438fc29113ce77cf51", + "reference": "ac09569844a9109a5966b9438fc29113ce77cf51", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-php80": "^1.16" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-09-21T19:53:16+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", @@ -4255,24 +4380,24 @@ }, { "name": "vimeo/psalm", - "version": "4.30.0", + "version": "5.2.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" + "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/fb685a16df3050d4c18d8a4100fe83abe6458cba", + "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", + "composer/package-versions-deprecated": "^1.10.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -4281,35 +4406,35 @@ "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", + "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", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25", - "webmozart/path-util": "^2.3" + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "sebastian/diff": "^4.0", + "symfony/console": "^4.1.6 || ^5.0 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.0", "ext-curl": "*", + "mockery/mockery": "^1.5", + "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpstan/phpdoc-parser": "1.2.* || 1.6.4", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" + "phpstan/phpdoc-parser": "^1.6", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.6", + "symfony/process": "^4.4 || ^5.0 || ^6.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -4325,17 +4450,14 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev", + "dev-master": "5.x-dev", + "dev-4.x": "4.x-dev", "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } }, "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], "psr-4": { "Psalm\\": "src/Psalm/" } @@ -4357,9 +4479,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.30.0" + "source": "https://github.com/vimeo/psalm/tree/5.2.0" }, - "time": "2022-11-06T20:37:08+00:00" + "time": "2022-12-12T08:18:56+00:00" }, { "name": "webimpress/coding-standard", @@ -4415,57 +4537,6 @@ } ], "time": "2022-02-15T19:52:12+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "webmozart/assert": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\PathUtil\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], From 98c884c8232ad6dcf749670cd3326684c785deed Mon Sep 17 00:00:00 2001 From: George Steel Date: Wed, 21 Dec 2022 10:03:16 +0000 Subject: [PATCH 2/7] require `ext-json`, bump dev deps, refresh lock Signed-off-by: George Steel --- composer.json | 7 ++- composer.lock | 160 +++++++++++++++++++++++++++----------------------- 2 files changed, 90 insertions(+), 77 deletions(-) diff --git a/composer.json b/composer.json index 9f37833..ea71f5f 100644 --- a/composer.json +++ b/composer.json @@ -33,15 +33,16 @@ }, "require": { "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "ext-json": "*", "laminas/laminas-cli": "^1.4.0", "webmozart/assert": "^1.10" }, "require-dev": { "laminas/laminas-coding-standard": "~2.4.0", "mikey179/vfsstream": "^1.6.11", - "phpunit/phpunit": "^9.5.26", - "psalm/plugin-phpunit": "^0.18.0", - "vimeo/psalm": "^5.0.0" + "phpunit/phpunit": "^9.5.27", + "psalm/plugin-phpunit": "^0.18.4", + "vimeo/psalm": "^5.4" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 5a07127..c5dd612 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3e939700543a95fe6fa28bcad3a4ce40", + "content-hash": "ada7dce32a9a099725c707975b96c066", "packages": [ { "name": "laminas/laminas-cli", @@ -1948,16 +1948,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "0.4.0", + "version": "0.4.1", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "666cb04a02f2801f3b19955fc23c824f9018bf64" + "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/666cb04a02f2801f3b19955fc23c824f9018bf64", - "reference": "666cb04a02f2801f3b19955fc23c824f9018bf64", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/79261cc280aded96d098e1b0e0ba0c4881b432c2", + "reference": "79261cc280aded96d098e1b0e0ba0c4881b432c2", "shasum": "" }, "require": { @@ -1997,7 +1997,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.1" }, "funding": [ { @@ -2005,7 +2005,7 @@ "type": "github" } ], - "time": "2022-12-10T21:26:31+00:00" + "time": "2022-12-16T22:01:02+00:00" }, { "name": "laminas/laminas-coding-standard", @@ -2280,59 +2280,6 @@ }, "time": "2022-11-12T15:38:23+00:00" }, - { - "name": "openlss/lib-array2xml", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "type": "library", - "autoload": { - "psr-0": { - "LSS": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Bryan Tong", - "email": "bryan@nullivex.com", - "homepage": "https://www.nullivex.com" - }, - { - "name": "Tony Butler", - "email": "spudz76@gmail.com", - "homepage": "https://www.nullivex.com" - } - ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], - "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" - }, - "time": "2019-03-29T20:06:56+00:00" - }, { "name": "phar-io/manifest", "version": "2.0.3", @@ -2655,16 +2602,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.21", + "version": "9.2.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", - "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/e4bf60d2220b4baaa0572986b5d69870226b06df", + "reference": "e4bf60d2220b4baaa0572986b5d69870226b06df", "shasum": "" }, "require": { @@ -2720,7 +2667,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.22" }, "funding": [ { @@ -2728,7 +2675,7 @@ "type": "github" } ], - "time": "2022-12-14T13:26:54+00:00" + "time": "2022-12-18T16:40:55+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4208,6 +4155,70 @@ ], "time": "2022-05-25T10:58:12+00:00" }, + { + "name": "spatie/array-to-xml", + "version": "2.17.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/array-to-xml.git", + "reference": "df0f116f26f6d3f84041e94d46811ee6b64fe7d5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/df0f116f26f6d3f84041e94d46811ee6b64fe7d5", + "reference": "df0f116f26f6d3f84041e94d46811ee6b64fe7d5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": "^7.4|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.2", + "pestphp/pest": "^1.21", + "phpunit/phpunit": "^9.0", + "spatie/pest-plugin-snapshots": "^1.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Spatie\\ArrayToXml\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://freek.dev", + "role": "Developer" + } + ], + "description": "Convert an array to xml", + "homepage": "https://github.com/spatie/array-to-xml", + "keywords": [ + "array", + "convert", + "xml" + ], + "support": { + "source": "https://github.com/spatie/array-to-xml/tree/2.17.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2022-12-13T09:08:39+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.7.1", @@ -4380,16 +4391,16 @@ }, { "name": "vimeo/psalm", - "version": "5.2.0", + "version": "5.4.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba" + "reference": "62db5d4f6a7ae0a20f7cc5a4952d730272fc0863" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/fb685a16df3050d4c18d8a4100fe83abe6458cba", - "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/62db5d4f6a7ae0a20f7cc5a4952d730272fc0863", + "reference": "62db5d4f6a7ae0a20f7cc5a4952d730272fc0863", "shasum": "" }, "require": { @@ -4411,9 +4422,9 @@ "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", "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", "sebastian/diff": "^4.0", + "spatie/array-to-xml": "^2.17.0", "symfony/console": "^4.1.6 || ^5.0 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0", "symfony/polyfill-php80": "^1.25" @@ -4479,9 +4490,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/5.2.0" + "source": "https://github.com/vimeo/psalm/tree/5.4.0" }, - "time": "2022-12-12T08:18:56+00:00" + "time": "2022-12-19T21:31:12+00:00" }, { "name": "webimpress/coding-standard", @@ -4545,7 +4556,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0" + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "ext-json": "*" }, "platform-dev": [], "platform-overrides": { From 1442faa0b045401a5e279aab91fee2d62eb4e808 Mon Sep 17 00:00:00 2001 From: George Steel Date: Wed, 21 Dec 2022 10:05:00 +0000 Subject: [PATCH 3/7] Improve array shape type inference for composer autoload section Signed-off-by: George Steel --- src/Composer.php | 12 +++++++++++- test/ComposerTest.php | 3 +++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Composer.php b/src/Composer.php index 5124f27..fe6a93a 100644 --- a/src/Composer.php +++ b/src/Composer.php @@ -21,6 +21,14 @@ use const JSON_UNESCAPED_SLASHES; use const JSON_UNESCAPED_UNICODE; +/** + * @psalm-type ComposerFile = array{ + * autoload: array{ + * psr-0?: array, + * psr-4?: array, + * }, + * } + */ final class Composer { public const AUTOLOADER_PSR0 = 'psr-0'; @@ -36,7 +44,7 @@ final class Composer private bool $changed = false; - /** @psalm-var array */ + /** @psalm-var ComposerFile */ private array $composer; private FileWriterInterface $fileWriter; @@ -54,6 +62,7 @@ public function __construct( $composerJsonFileContents = $fileReader($composerJsonFile); + /** @psalm-var ComposerFile $composer */ $composer = $this->deserializeJson($composerJsonFileContents, $composerJsonFile); $this->autoloadDumper = $autoloadDumper; @@ -134,6 +143,7 @@ public function updatePackageAndDumpAutoloader(string $composerPath): void private function deserializeJson(string $json, string $filename): array { try { + /** @psalm-var array */ return json_decode($json, true, 512, JSON_THROW_ON_ERROR); } catch (JsonException $e) { throw Exception\ComposerJsonFileException::forUnparseableFile($filename, $json, $e); diff --git a/test/ComposerTest.php b/test/ComposerTest.php index e24f65d..34f3b30 100644 --- a/test/ComposerTest.php +++ b/test/ComposerTest.php @@ -15,6 +15,7 @@ use function array_key_exists; use function sprintf; +/** @psalm-import-type ComposerFile from Composer */ class ComposerTest extends TestCase { /** @@ -58,6 +59,7 @@ private function assertAutoloadEntryExists( $r = new ReflectionProperty($composer, 'composer'); $r->setAccessible(true); + /** @var ComposerFile $definition */ $definition = $r->getValue($composer); $this->assertArrayHasKey('autoload', $definition, sprintf( @@ -95,6 +97,7 @@ private function assertNotAutoloadEntryExists( $r = new ReflectionProperty($composer, 'composer'); $r->setAccessible(true); + /** @var ComposerFile $definition */ $definition = $r->getValue($composer); if (! array_key_exists('autoload', $definition)) { From 0de00e819f646b28ab3f3c1ac8076ffb6fbbe1a7 Mon Sep 17 00:00:00 2001 From: George Steel Date: Wed, 21 Dec 2022 10:05:12 +0000 Subject: [PATCH 4/7] remove redundant cast Signed-off-by: George Steel --- src/Exception/ComposerJsonFileException.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Exception/ComposerJsonFileException.php b/src/Exception/ComposerJsonFileException.php index b7e93ff..1d9c634 100644 --- a/src/Exception/ComposerJsonFileException.php +++ b/src/Exception/ComposerJsonFileException.php @@ -36,7 +36,7 @@ public static function forUnparseableFile( $composerJsonFile, $composerJson, $previousException->getMessage() - ), (int) $previousException->getCode(), $previousException); + ), $previousException->getCode(), $previousException); } public static function forUnserializableContents(JsonException $previousException): self @@ -44,7 +44,7 @@ public static function forUnserializableContents(JsonException $previousExceptio return new self(sprintf( 'Unable to serialize composer.json contents to JSON: %s', $previousException->getMessage() - ), (int) $previousException->getCode(), $previousException); + ), $previousException->getCode(), $previousException); } public static function forUnwriteableFile(string $composerJsonFile): self From 53674933084e87e542145de31c976a01afead9a0 Mon Sep 17 00:00:00 2001 From: George Steel Date: Wed, 21 Dec 2022 10:05:43 +0000 Subject: [PATCH 5/7] Correct return type Signed-off-by: George Steel --- test/MoveModuleClassFileViaFileOperationsTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/MoveModuleClassFileViaFileOperationsTest.php b/test/MoveModuleClassFileViaFileOperationsTest.php index eae63a2..899058e 100644 --- a/test/MoveModuleClassFileViaFileOperationsTest.php +++ b/test/MoveModuleClassFileViaFileOperationsTest.php @@ -32,11 +32,11 @@ public function setUp(): void } /** - * @psalm-return callable(string $originalFile, string $newFile):void + * @psalm-return callable(string $originalFile, string $newFile):never */ private function createNoopReporter(): callable { - return static function (): void { + return static function () { Assert::fail('Reporter was reached, but should not have been'); }; } From 779caf644d6f71b1e2e1ba53ba8066bb6c8640d8 Mon Sep 17 00:00:00 2001 From: George Steel Date: Wed, 21 Dec 2022 10:05:55 +0000 Subject: [PATCH 6/7] refresh baseline Signed-off-by: George Steel --- psalm-baseline.xml | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c546698..1b6a931 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + $type @@ -8,46 +8,9 @@ $type - - - $this->composer['autoload'][$type] - - - $this->composer['autoload'][$type] - $this->composer['autoload'][$type] - - - array<string, mixed> - - - json_decode($json, true, 512, JSON_THROW_ON_ERROR) - - $this->dir->getChild('module') - - - $definition - $definition - $definition['autoload'] - $definition['autoload'] - $definition['autoload'][$type] - $definition['autoload'][$type] - $definition['autoload'][$type][$expectedKey] - - - $definition['autoload'] - $definition['autoload'] - $definition['autoload'] - $definition['autoload'] - $definition['autoload'][$type] - - - $definition - $definition - - From ae70a0ca6917b6cf292bdf39d933f8ed193f52fd Mon Sep 17 00:00:00 2001 From: George Steel Date: Wed, 21 Dec 2022 10:07:35 +0000 Subject: [PATCH 7/7] Delete changelog Signed-off-by: George Steel --- CHANGELOG.md | 303 --------------------------------------------------- 1 file changed, 303 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e17fccb..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,303 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 3.5.0 - TBD - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 3.4.0 - 2022-12-07 - - ------ - -### Release Notes for [3.4.0](https://github.com/laminas/laminas-composer-autoloading/milestone/14) - -Feature release (minor) - -### 3.4.0 - -- Total issues resolved: **0** -- Total pull requests resolved: **1** -- Total contributors: **1** - -#### Enhancement - - - [18: Update dependency php to ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0](https://github.com/laminas/laminas-composer-autoloading/pull/18) thanks to @renovate[bot] - -## 3.3.0 - 2022-10-03 - - ------ - -### Release Notes for [3.3.0](https://github.com/laminas/laminas-composer-autoloading/milestone/12) - -Feature release (minor) - -### 3.3.0 - -- Total issues resolved: **0** -- Total pull requests resolved: **1** -- Total contributors: **1** - -#### Enhancement - - - [16: Apply PHP 7.4 syntax and typed property](https://github.com/laminas/laminas-composer-autoloading/pull/16) thanks to @samsonasik - -## 3.2.0 - 2022-07-24 - - ------ - -### Release Notes for [3.2.0](https://github.com/laminas/laminas-composer-autoloading/milestone/10) - -Feature release (minor) - -### 3.2.0 - -- Total issues resolved: **0** -- Total pull requests resolved: **2** -- Total contributors: **2** - -#### renovate - - - [14: Configure Renovate](https://github.com/laminas/laminas-composer-autoloading/pull/14) thanks to @renovate[bot] - -#### Enhancement - - - [13: Prepare for Renovate with reusable workflows](https://github.com/laminas/laminas-composer-autoloading/pull/13) thanks to @ghostwriter - -## 3.1.0 - 2021-10-21 - - ------ - -### Release Notes for [3.1.0](https://github.com/laminas/laminas-composer-autoloading/milestone/7) - -Feature release (minor) - -### 3.1.0 - -- Total issues resolved: **0** -- Total pull requests resolved: **2** -- Total contributors: **2** - -#### Enhancement - - - [12: Add support for PHP 8.1](https://github.com/laminas/laminas-composer-autoloading/pull/12) thanks to @arueckauer - - [10: Remove file headers](https://github.com/laminas/laminas-composer-autoloading/pull/10) thanks to @ghostwriter - -## 2.3.0 - TBD - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 2.2.0 - 2021-03-22 - - ------ - -### Release Notes for [2.2.0](https://github.com/laminas/laminas-composer-autoloading/milestone/2) - -### Added - -- This release adds support for PHP 8.0. - -### Removed - -- This release removes support for PHP versions prior to 7.3. - -### 2.2.0 - -- Total issues resolved: **1** -- Total pull requests resolved: **4** -- Total contributors: **2** - -#### Enhancement - - - [8: Update to laminas-coding-standard v2](https://github.com/laminas/laminas-composer-autoloading/pull/8) thanks to @weierophinney - - [7: Add Psalm integration](https://github.com/laminas/laminas-composer-autoloading/pull/7) thanks to @weierophinney - - [6: Update to support PHP 8.0](https://github.com/laminas/laminas-composer-autoloading/pull/6) thanks to @weierophinney - - [5: Switch from Travis to Laminas CI worfklow on GHA](https://github.com/laminas/laminas-composer-autoloading/pull/5) thanks to @weierophinney - - [3: PHP 8.0 support](https://github.com/laminas/laminas-composer-autoloading/issues/3) thanks to @boesing - -## 2.1.1 - 2020-04-20 - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [#1](https://github.com/laminas/laminas-composer-autoloading/pull/1) fixes an incorrect relative path when emitting help information, due to a malformed migration string. - -## 2.1.0 - 2018-05-03 - -### Added - -- [zfcampus/zf-composer-autoloading#10](https://github.com/zfcampus/zf-composer-autoloading/pull/10) adds support for PHP 7.2. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- [zfcampus/zf-composer-autoloading#10](https://github.com/zfcampus/zf-composer-autoloading/pull/10) removes support for HHVM. - -### Fixed - -- Nothing. - -## 2.0.0 - 2017-02-22 - -### Added - -- [zfcampus/zf-composer-autoloading#8](https://github.com/zfcampus/zf-composer-autoloading/pull/8) extracts the classes - `Laminas\ComposerAutoloading\Help`, `Laminas\ComposerAutoloading\Command\Enable`, and - `Laminas\ComposerAutoloading\Command\Disable` from the `Laminas\ComposerAutoloading\Command` class, - which now delegates to each of them to perform its tasks. - -### Changes - -- [zfcampus/zf-composer-autoloading#8](https://github.com/zfcampus/zf-composer-autoloading/pull/8) renames the - script from `autoload-module-via-composer` to `laminas-composer-autoloading`. - -- [zfcampus/zf-composer-autoloading#8](https://github.com/zfcampus/zf-composer-autoloading/pull/8) renames the - `Command::__invoke()` method to `Command::process()`. - -- [zfcampus/zf-composer-autoloading#8](https://github.com/zfcampus/zf-composer-autoloading/pull/8) adds a dependency - on laminas-stdlib in order to facilitate colorized console reporting, and allow - testing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.1.1 - 2017-02-22 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zfcampus/zf-composer-autoloading#5](https://github.com/zfcampus/zf-composer-autoloading/pull/5) fixes how - the command creates the path to the module source directory; previously, it - was hard-coded, and did not take into account the `-p`/`--modules-path` - argument created in [zfcampus/zf-composer-autoloading#2](https://github.com/zfcampus/zf-composer-autoloading/pull/2). - -- [zfcampus/zf-composer-autoloading#6](https://github.com/zfcampus/zf-composer-autoloading/pull/6) adds - validation for the number of arguments, ensuring that no flags have empty - values. - -- [zfcampus/zf-composer-autoloading#7](https://github.com/zfcampus/zf-composer-autoloading/pull/7) adds - validation of the composer binary in a cross-platform way; an exception is - now raised if it is not executable. - -## 1.1.0 - 2017-02-16 - -### Added - -- [zfcampus/zf-composer-autoloading#2](https://github.com/zfcampus/zf-composer-autoloading/pull/2) adds the - flags `-p`/`--modules-path`, allowing the user to specify the directory - holding the module/source tree for which autoloading will be provided. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.0.0 - 2016-08-12 - -Initial release. - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing.