From 11900887445e9a84dfcfb2493ee88f59c68b3c04 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Tue, 26 Nov 2024 21:58:13 +0900 Subject: [PATCH 01/24] Update PHP versions in CI workflow Add PHP 8.3 to old stable versions and set current stable to 8.4. This ensures the CI process tests against the most recent PHP versions for better compatibility and bug detection. --- .github/workflows/continuous-integration.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 0ea62429..7caae620 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -9,5 +9,6 @@ jobs: ci: uses: ray-di/.github/.github/workflows/continuous-integration.yml@v1 with: - old_stable: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"]' - current_stable: 8.3 + old_stable: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]' + current_stable: 8.4 +c From 7d999b094801cb3cac4eaf796a3512ce826f8599 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 09:41:28 +0900 Subject: [PATCH 02/24] Remove redundant configuration files and update settings Deleted unnecessary 'psalm.compiler.xml' configuration file to streamline the codebase. Modified 'phpstan.neon' to adjust error levels and ignore duplicate type aliases. Updated 'phpunit.xml.dist' and 'psalm.xml' schema locations to use more accurate paths. --- composer.json | 2 +- phpstan.neon | 19 ++++++++++--------- phpunit.xml.dist | 2 +- psalm.compiler.xml | 15 --------------- psalm.xml | 4 +--- 5 files changed, 13 insertions(+), 29 deletions(-) delete mode 100644 psalm.compiler.xml diff --git a/composer.json b/composer.json index 8c446789..c2b05497 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "cs": ["phpcs --standard=./phpcs.xml src tests"], "cs-fix": ["phpcbf src tests"], "clean": ["phpstan clear-result-cache", "psalm --clear-cache", "rm -rf tests/tmp/*.php"], - "sa": ["psalm -c psalm.compiler.xml --show-info=true", "phpstan analyse -c phpstan.neon --no-progress"], + "sa": ["psalm --show-info=false", "phpstan analyse -c phpstan.neon --no-progress"], "metrics": ["@test", "phpmetrics --report-html=build/metrics --exclude=Exception --log-junit=build/junit.xml --junit=build/junit.xml src"], "phpmd": ["phpmd src/di text ./phpmd.xml"], "build": ["@cs", "@sa", "@pcov", "@metrics"] diff --git a/phpstan.neon b/phpstan.neon index b6e0c771..35484ec6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,10 +1,11 @@ parameters: - level: max - paths: - - src - - tests - excludePaths: - - tests/tmp/* - - tests/Fake/* - checkGenericClassInNonGenericObjectType: false - + level: 8 + paths: + - src + - tests + excludePaths: + - tests/tmp/* + - tests/Fake/* + ignoreErrors: + - + identifier: typeAlias.duplicate diff --git a/phpunit.xml.dist b/phpunit.xml.dist index cbc74719..6ff8352a 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ - + src diff --git a/psalm.compiler.xml b/psalm.compiler.xml deleted file mode 100644 index fe95ec30..00000000 --- a/psalm.compiler.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/psalm.xml b/psalm.xml index fc773997..806465ae 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,10 +1,8 @@ From 2e6814959d082ff279c53cffa0a50e34c1dcce81 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 09:42:03 +0900 Subject: [PATCH 03/24] Update dependencies in composer.lock file Upgraded several packages to their latest versions, including `composer/pcre`, `phpstan/phpstan`, and `symfony/*`. This change ensures compatibility with newer versions of PHP and other dependencies. --- vendor-bin/tools/composer.json | 2 +- vendor-bin/tools/composer.lock | 215 ++++++++++++++++----------------- 2 files changed, 108 insertions(+), 109 deletions(-) diff --git a/vendor-bin/tools/composer.json b/vendor-bin/tools/composer.json index aa938036..d7f79c14 100644 --- a/vendor-bin/tools/composer.json +++ b/vendor-bin/tools/composer.json @@ -3,7 +3,7 @@ "doctrine/coding-standard": "^9.0", "phpmd/phpmd": "^2.9", "phpmetrics/phpmetrics": "^2.7", - "phpstan/phpstan": "^1.0", + "phpstan/phpstan": "^2.0", "psalm/plugin-phpunit": "^0.13", "squizlabs/php_codesniffer": "^3.5", "vimeo/psalm": "^4.2" diff --git a/vendor-bin/tools/composer.lock b/vendor-bin/tools/composer.lock index 1126cc2b..b25afad4 100644 --- a/vendor-bin/tools/composer.lock +++ b/vendor-bin/tools/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": "f76ba1b68b7d0d258fb96fbfbf69e162", + "content-hash": "95e4521b6f0724da270b3b5de30e8f8a", "packages": [], "packages-dev": [ { @@ -242,16 +242,16 @@ }, { "name": "composer/pcre", - "version": "3.3.1", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/63aaeac21d7e775ff9bc9d45021e1745c97521c4", - "reference": "63aaeac21d7e775ff9bc9d45021e1745c97521c4", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { @@ -261,8 +261,8 @@ "phpstan/phpstan": "<1.11.10" }, "require-dev": { - "phpstan/phpstan": "^1.11.10", - "phpstan/phpstan-strict-rules": "^1.1", + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", "phpunit/phpunit": "^8 || ^9" }, "type": "library", @@ -301,7 +301,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.3.1" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -317,7 +317,7 @@ "type": "tidelift" } ], - "time": "2024-08-27T18:44:43+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", @@ -853,16 +853,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -901,7 +901,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -909,7 +909,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "netresearch/jsonmapper", @@ -1307,16 +1307,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.1", + "version": "5.6.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", - "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", + "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", "shasum": "" }, "require": { @@ -1325,17 +1325,17 @@ "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", - "phpstan/phpdoc-parser": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", "webmozart/assert": "^1.9.1" }, "require-dev": { - "mockery/mockery": "~1.3.5", + "mockery/mockery": "~1.3.5 || ~1.6.0", "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.8", "phpstan/phpstan-mockery": "^1.1", "phpstan/phpstan-webmozart-assert": "^1.2", "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^5.13" + "psalm/phar": "^5.26" }, "type": "library", "extra": { @@ -1365,29 +1365,29 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" }, - "time": "2024-05-21T05:55:05+00:00" + "time": "2024-11-12T11:25:25+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.8.2", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "153ae662783729388a584b4361f2545e4d841e3c" + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/153ae662783729388a584b4361f2545e4d841e3c", - "reference": "153ae662783729388a584b4361f2545e4d841e3c", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/679e3ce485b99e84c775d28e2e96fade9a7fb50a", + "reference": "679e3ce485b99e84c775d28e2e96fade9a7fb50a", "shasum": "" }, "require": { "doctrine/deprecations": "^1.0", "php": "^7.3 || ^8.0", "phpdocumentor/reflection-common": "^2.0", - "phpstan/phpdoc-parser": "^1.13" + "phpstan/phpdoc-parser": "^1.18|^2.0" }, "require-dev": { "ext-tokenizer": "*", @@ -1423,9 +1423,9 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.2" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.10.0" }, - "time": "2024-02-23T11:10:43+00:00" + "time": "2024-11-09T15:12:26+00:00" }, { "name": "phpmd/phpmd", @@ -1627,20 +1627,20 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.6", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae" + "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc4d2f145a88ea7141ae698effd64d9df46527ae", - "reference": "dc4d2f145a88ea7141ae698effd64d9df46527ae", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6c98c7600fc717b2c78c11ef60040d5b1e359c82", + "reference": "6c98c7600fc717b2c78c11ef60040d5b1e359c82", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -1681,7 +1681,7 @@ "type": "github" } ], - "time": "2024-10-06T15:03:59+00:00" + "time": "2024-11-17T14:17:00+00:00" }, { "name": "phpunit/php-code-coverage", @@ -3290,16 +3290,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.3", + "version": "3.11.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" + "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", + "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", "shasum": "" }, "require": { @@ -3366,38 +3366,38 @@ "type": "open_collective" } ], - "time": "2024-09-18T10:38:58+00:00" + "time": "2024-11-16T12:02:36+00:00" }, { "name": "symfony/config", - "version": "v6.4.8", + "version": "v7.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "12e7e52515ce37191b193cf3365903c4f3951e35" + "reference": "dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/12e7e52515ce37191b193cf3365903c4f3951e35", - "reference": "12e7e52515ce37191b193cf3365903c4f3951e35", + "url": "https://api.github.com/repos/symfony/config/zipball/dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8", + "reference": "dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^7.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<5.4", + "symfony/finder": "<6.4", "symfony/service-contracts": "<2.5" }, "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3425,7 +3425,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.4.8" + "source": "https://github.com/symfony/config/tree/v7.1.7" }, "funding": [ { @@ -3441,20 +3441,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:49:08+00:00" + "time": "2024-11-04T11:34:07+00:00" }, { "name": "symfony/console", - "version": "v6.4.12", + "version": "v6.4.15", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "72d080eb9edf80e36c19be61f72c98ed8273b765" + "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/72d080eb9edf80e36c19be61f72c98ed8273b765", - "reference": "72d080eb9edf80e36c19be61f72c98ed8273b765", + "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", "shasum": "" }, "require": { @@ -3519,7 +3519,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.12" + "source": "https://github.com/symfony/console/tree/v6.4.15" }, "funding": [ { @@ -3535,44 +3535,43 @@ "type": "tidelift" } ], - "time": "2024-09-20T08:15:52+00:00" + "time": "2024-11-06T14:19:14+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.4.12", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "cfb9d34a1cdd4911bc737a5358fd1cf8ebfb536e" + "reference": "e4d13f0f394f4d02a041ff76acd31c5a20a5f70b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/cfb9d34a1cdd4911bc737a5358fd1cf8ebfb536e", - "reference": "cfb9d34a1cdd4911bc737a5358fd1cf8ebfb536e", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/e4d13f0f394f4d02a041ff76acd31c5a20a5f70b", + "reference": "e4d13f0f394f4d02a041ff76acd31c5a20a5f70b", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.2.10|^7.0" + "symfony/service-contracts": "^3.5", + "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { "ext-psr": "<1.1|>=2", - "symfony/config": "<6.1", - "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<6.3", - "symfony/yaml": "<5.4" + "symfony/config": "<6.4", + "symfony/finder": "<6.4", + "symfony/yaml": "<6.4" }, "provide": { "psr/container-implementation": "1.1|2.0", "symfony/service-implementation": "1.1|2.0|3.0" }, "require-dev": { - "symfony/config": "^6.1|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/config": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3600,7 +3599,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.12" + "source": "https://github.com/symfony/dependency-injection/tree/v7.1.8" }, "funding": [ { @@ -3616,7 +3615,7 @@ "type": "tidelift" } ], - "time": "2024-09-20T08:18:25+00:00" + "time": "2024-11-09T09:16:45+00:00" }, { "name": "symfony/deprecation-contracts", @@ -3687,25 +3686,25 @@ }, { "name": "symfony/filesystem", - "version": "v6.4.12", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "f810e3cbdf7fdc35983968523d09f349fa9ada12" + "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/f810e3cbdf7fdc35983968523d09f349fa9ada12", - "reference": "f810e3cbdf7fdc35983968523d09f349fa9ada12", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", + "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^5.4|^6.4|^7.0" + "symfony/process": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3733,7 +3732,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.12" + "source": "https://github.com/symfony/filesystem/tree/v7.1.6" }, "funding": [ { @@ -3749,7 +3748,7 @@ "type": "tidelift" } ], - "time": "2024-09-16T16:01:33+00:00" + "time": "2024-10-25T15:11:02+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4234,20 +4233,20 @@ }, { "name": "symfony/string", - "version": "v6.4.12", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f8a1ccebd0997e16112dfecfd74220b78e5b284b" + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f8a1ccebd0997e16112dfecfd74220b78e5b284b", - "reference": "f8a1ccebd0997e16112dfecfd74220b78e5b284b", + "url": "https://api.github.com/repos/symfony/string/zipball/591ebd41565f356fcd8b090fe64dbb5878f50281", + "reference": "591ebd41565f356fcd8b090fe64dbb5878f50281", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -4257,11 +4256,12 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4300,7 +4300,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.12" + "source": "https://github.com/symfony/string/tree/v7.1.8" }, "funding": [ { @@ -4316,30 +4316,29 @@ "type": "tidelift" } ], - "time": "2024-09-20T08:15:52+00:00" + "time": "2024-11-13T13:31:21+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.4.9", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "f9a060622e0d93777b7f8687ec4860191e16802e" + "reference": "90173ef89c40e7c8c616653241048705f84130ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/f9a060622e0d93777b7f8687ec4860191e16802e", - "reference": "f9a060622e0d93777b7f8687ec4860191e16802e", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/90173ef89c40e7c8c616653241048705f84130ef", + "reference": "90173ef89c40e7c8c616653241048705f84130ef", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3" + "php": ">=8.2" }, "require-dev": { "symfony/property-access": "^6.4|^7.0", "symfony/serializer": "^6.4|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -4377,7 +4376,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.4.9" + "source": "https://github.com/symfony/var-exporter/tree/v7.1.6" }, "funding": [ { @@ -4393,7 +4392,7 @@ "type": "tidelift" } ], - "time": "2024-06-24T15:53:56+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "theseer/tokenizer", @@ -4665,10 +4664,10 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "plugin-api-version": "2.6.0" } From 78fd641686c13d70ac80736ec2ba2efcb65ce299 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:06:41 +0900 Subject: [PATCH 04/24] Add dependency doctrine/cache ^1.0 check Removed an obsolete import that was no longer used in ProdInjectorContext. Added a check to ensure the ApcuCache class exists before attempting to instantiate it, with a runtime exception for cases where the class is missing. --- docs/exmaple/ProdInjectorContext.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/exmaple/ProdInjectorContext.php b/docs/exmaple/ProdInjectorContext.php index 83241691..e0080cc5 100644 --- a/docs/exmaple/ProdInjectorContext.php +++ b/docs/exmaple/ProdInjectorContext.php @@ -6,7 +6,6 @@ use Doctrine\Common\Cache\CacheProvider; use Ray\Compiler\AbstractInjectorContext; use Ray\Compiler\DiCompileModule; -use Ray\Compiler\FakeCarModule; use Ray\Di\AbstractModule; final class ProdInjectorContext extends AbstractInjectorContext @@ -23,6 +22,10 @@ public function __invoke(): AbstractModule public function getCache(): CacheProvider { - return new ApcuCache(); + if (! class_exists(ApcuCache::class)) { + throw new \RuntimeException('doctrine/cache ^1.0 is required for ProdInjectorContext.'); + } + + return new ApcuCache(); // @phpstan-ignore-line } } From 08d52d7c5843462e3fcad5ab003a70d63e770b0c Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:10:21 +0900 Subject: [PATCH 05/24] Soothe SA and fix typos an Added the @psalm-import-type ScriptDir annotation and updated the type hints across multiple classes and methods for improved type safety. This involved specifying ScriptDir in parameter and property docblocks, as well as typedefs in several files. Additionally, unnecessary assert statements were removed to clean up the test cases. --- src-deprecated/ReaderProvider.php | 2 +- src/AbstractInjectorContext.php | 9 ++++++- src/CachedInjectorFactory.php | 7 +++++ src/Code.php | 2 +- src/CompileInjector.php | 26 ++++++++++++------- src/CompileNullObject.php | 4 ++- src/DependencyCode.php | 14 +++++----- src/DependencySaver.php | 8 +++++- src/DiCompiler.php | 12 +++++++-- src/FunctionCode.php | 2 +- src/GraphDumper.php | 10 +++++-- src/InjectionPoint.php | 9 ++++++- src/InjectorFactory.php | 9 ++++++- src/Normalizer.php | 3 ++- src/OnDemandCompiler.php | 22 +++++++++++----- src/ScriptInjector.php | 16 +++++++----- src/ScriptinjectorModule.php | 10 +++++-- tests/AssistedTest.php | 10 +++---- tests/CachedFactoryTest.php | 5 +++- tests/CompileInjectorTest.php | 8 ++---- tests/ContextInjectorTest.php | 7 +---- tests/DevCache.php | 2 +- tests/DiCompilerTest.php | 3 --- .../Assisted/FakeAssistedInjectConsumer.php | 2 +- tests/Fake/Deep/FakeScriptInjectorContext.php | 1 + tests/Fake/FakeCar3.php | 1 + tests/Fake/FakeInvalidDependency.php | 3 +++ tests/Fake/script/singleton.php | 2 +- tests/InjectorFactoryTest.php | 6 ++--- tests/MultiBindingTest.php | 15 ++++++++++- tests/ScriptInjectorTest.php | 17 +++--------- 31 files changed, 162 insertions(+), 85 deletions(-) diff --git a/src-deprecated/ReaderProvider.php b/src-deprecated/ReaderProvider.php index b441acac..bfbc6040 100644 --- a/src-deprecated/ReaderProvider.php +++ b/src-deprecated/ReaderProvider.php @@ -12,7 +12,7 @@ * @deprecated * @codeCoverageIgnore */ -final class ReaderProvider implements ProviderInterface +final class ReaderProvider implements ProviderInterface // @phpstan-ignore-line { public function get(): Reader { diff --git a/src/AbstractInjectorContext.php b/src/AbstractInjectorContext.php index a328d61e..78a268a1 100644 --- a/src/AbstractInjectorContext.php +++ b/src/AbstractInjectorContext.php @@ -6,15 +6,22 @@ use Doctrine\Common\Cache\CacheProvider; use Ray\Di\AbstractModule; +use Ray\Di\Annotation\ScriptDir; +/** + * @psalm-import-type ScriptDir from CompileInjector + */ abstract class AbstractInjectorContext implements LazyModuleInterface { /** - * @var string + * @var ScriptDir * @readonly */ public $tmpDir; + /** + * @param ScriptDir $tmpDir + */ public function __construct(string $tmpDir) { $this->tmpDir = $tmpDir; diff --git a/src/CachedInjectorFactory.php b/src/CachedInjectorFactory.php index d9fdc380..49f33ef4 100644 --- a/src/CachedInjectorFactory.php +++ b/src/CachedInjectorFactory.php @@ -6,6 +6,7 @@ use Doctrine\Common\Cache\CacheProvider; use Ray\Di\AbstractModule; +use Ray\Di\Annotation\ScriptDir; use Ray\Di\InjectorInterface; use Ray\Di\NullCache; @@ -13,6 +14,9 @@ use function serialize; use function unserialize; +/** + * @psalm-import-type ScriptDir from CompileInjector + */ final class CachedInjectorFactory { /** @var array */ @@ -21,6 +25,7 @@ final class CachedInjectorFactory /** * @param callable(): AbstractModule $modules * @param array $savedSingletons + * @param ScriptDir $scriptDir */ public static function getInstance(string $injectorId, string $scriptDir, callable $modules, ?CacheProvider $cache = null, array $savedSingletons = []): InjectorInterface { @@ -53,6 +58,7 @@ public static function getInstance(string $injectorId, string $scriptDir, callab /** * @param callable(): AbstractModule $modules * @param array $savedSingletons + * @param ScriptDir $scriptDir */ public static function getOverrideInstance( string $scriptDir, @@ -66,6 +72,7 @@ public static function getOverrideInstance( /** * @param callable(): AbstractModule $modules * @param array $savedSingletons + * @param ScriptDir $scriptDir */ private static function getInjector(callable $modules, string $scriptDir, array $savedSingletons, ?AbstractModule $module = null): InjectorInterface { diff --git a/src/Code.php b/src/Code.php index 46c4f677..0da7986b 100644 --- a/src/Code.php +++ b/src/Code.php @@ -19,7 +19,7 @@ final class Code private $node; /** - * @SuppressWarnings(PHPMD.BooleanArgumentFlag) + * @SuppressWarnings(PHPMD.BooleanArgumentFlag) // @phpstan-ignore-line */ public function __construct(Node $node, bool $isSingleton = false, ?IpQualifier $qualifier = null) { diff --git a/src/CompileInjector.php b/src/CompileInjector.php index bf328f75..bccc042d 100644 --- a/src/CompileInjector.php +++ b/src/CompileInjector.php @@ -18,12 +18,16 @@ use function str_replace; use function touch; +/** + * @psalm-type ScriptDir = non-empty-string + * @psalm-type Ip = array{0: string, 1: string, 2: string} + */ final class CompileInjector implements ScriptInjectorInterface { public const INSTANCE = '%s/%s.php'; public const COMPILE_CHECK = '%s/compiled'; - /** @var string */ + /** @var ScriptDir */ private $scriptDir; /** @@ -31,7 +35,7 @@ final class CompileInjector implements ScriptInjectorInterface * * [$class, $method, $parameter] * - * @var array{0: string, 1: string, 2: string} + * @var Ip */ private $ip = ['', '', '']; @@ -52,19 +56,21 @@ final class CompileInjector implements ScriptInjectorInterface private static $scriptDirs = []; /** - * @param string $scriptDir generated instance script folder path + * @param ScriptDir $scriptDir generated instance script folder path * @param LazyModuleInterface $lazyModule callable variable which return AbstractModule instance * * @psalm-suppress UnresolvableInclude */ public function __construct($scriptDir, LazyModuleInterface $lazyModule) { - $this->scriptDir = rtrim($scriptDir, '/'); + /** @var ScriptDir $scriptDir */ + $scriptDir = rtrim($scriptDir, '/'); + $this->scriptDir = $scriptDir; $this->lazyModule = $lazyModule; $this->registerLoader(); $prototype = /** - * @param array{0: string, 1: string, 2: string} $injectionPoint + * @param Ip $injectionPoint * * @return mixed */ @@ -76,18 +82,19 @@ function (string $dependencyIndex, array $injectionPoint = ['', '', '']) { }; $singleton = /** - * @param array{0: string, 1: string, 2: string} $injectionPoint + * @param Ip $injectionPoint * * @return mixed */ - function (string $dependencyIndex, $injectionPoint = ['', '', '']) { + function (string $dependencyIndex, array $injectionPoint = ['', '', '']) { if (isset($this->singletons[$dependencyIndex])) { return $this->singletons[$dependencyIndex]; } - $this->ip = $injectionPoint; + $this->ip = $injectionPoint; // @phpstan-ignore-line [$prototype, $singleton, $injectionPoint, $injector] = $this->functions; + /** @var object $instance */ $instance = require $this->getInstanceFile($dependencyIndex); $this->singletons[$dependencyIndex] = $instance; @@ -124,7 +131,7 @@ public function __wakeup() /** * {@inheritdoc} * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) + * @SuppressWarnings(PHPMD.UnusedLocalVariable) // @phpstan-ignore-line */ public function getInstance($interface, $name = Name::ANY) { @@ -146,6 +153,7 @@ public function getInstance($interface, $name = Name::ANY) /** @psalm-suppress UndefinedVariable */ $isSingleton = isset($isSingleton) && $isSingleton; if ($isSingleton) { + /** @var object $instance */ $this->singletons[$dependencyIndex] = $instance; } diff --git a/src/CompileNullObject.php b/src/CompileNullObject.php index c832b1a7..70685b0c 100644 --- a/src/CompileNullObject.php +++ b/src/CompileNullObject.php @@ -10,11 +10,13 @@ /** * Convert NullObjectDependency to Dependency + * + * @psalm-import-type ScriptDir from CompileInjector */ final class CompileNullObject { /** - * @retrun void + * @param ScriptDir $scriptDir */ public function __invoke(Container $container, string $scriptDir): void { diff --git a/src/DependencyCode.php b/src/DependencyCode.php index 1a236199..1b04abd9 100644 --- a/src/DependencyCode.php +++ b/src/DependencyCode.php @@ -88,9 +88,9 @@ public function setContext($context) $this->context = $context; } - public function setQaulifier(IpQualifier $qualifer): void + public function setQualifier(IpQualifier $qualifier): void { - $this->qualifier = $qualifer; + $this->qualifier = $qualifier; } public function getIsSingletonCode(bool $isSingleton): Expr\Assign @@ -123,10 +123,10 @@ private function getDependencyCode(Dependency $dependency): Code $node[] = $this->getIsSingletonCode($isSingleton); $node[] = new Node\Stmt\Return_(new Node\Expr\Variable('instance')); $namespace = $this->factory->namespace('Ray\Di\Compiler')->addStmts($node)->getNode(); - $qualifer = $this->qualifier; + $qualifier = $this->qualifier; $this->qualifier = null; - return new Code($namespace, $isSingleton, $qualifer); + return new Code($namespace, $isSingleton, $qualifier); } /** @@ -151,11 +151,11 @@ private function getProviderCode(DependencyProvider $provider): Code $node[] = $this->getIsSingletonCode($isSingleton); $node[] = new Stmt\Return_(new MethodCall(new Expr\Variable('instance'), 'get')); /** @psalm-suppress InvalidArgument */ - $node = $this->factory->namespace('Ray\Di\Compiler')->addStmts($node)->getNode(); - $qualifer = $this->qualifier; + $node = $this->factory->namespace('Ray\Di\Compiler')->addStmts($node)->getNode(); // @phpstan-ignore-line + $qualifier = $this->qualifier; $this->qualifier = null; - return new Code($node, $isSingleton, $qualifer); + return new Code($node, $isSingleton, $qualifier); } private function getSetContextCode(string $context): MethodCall diff --git a/src/DependencySaver.php b/src/DependencySaver.php index b2e1c6b1..3f0fc2fd 100644 --- a/src/DependencySaver.php +++ b/src/DependencySaver.php @@ -16,14 +16,20 @@ use const PHP_EOL; +/** + * @psalm-import-type ScriptDir from CompileInjector + */ final class DependencySaver { - /** @var string */ + /** @var ScriptDir */ private $scriptDir; /** @var FilePutContents */ private $filePutContents; + /** + * @param ScriptDir $scriptDir + */ public function __construct(string $scriptDir) { $this->scriptDir = $scriptDir; diff --git a/src/DiCompiler.php b/src/DiCompiler.php index 91745896..0605d8a7 100644 --- a/src/DiCompiler.php +++ b/src/DiCompiler.php @@ -25,9 +25,12 @@ use function sprintf; use function sys_get_temp_dir; +/** + * @psalm-import-type ScriptDir from CompileInjector + */ final class DiCompiler implements InjectorInterface { - /** @var string */ + /** @var ScriptDir */ private $scriptDir; /** @var Container */ @@ -45,9 +48,14 @@ final class DiCompiler implements InjectorInterface /** @var FilePutContents */ private $filePutContents; + /** + * @param ScriptDir $scriptDir + */ public function __construct(AbstractModule $module, string $scriptDir) { - $this->scriptDir = $scriptDir ?: sys_get_temp_dir(); + /** @var ScriptDir $scriptDir */ + $scriptDir = $scriptDir ?: sys_get_temp_dir(); + $this->scriptDir = $scriptDir; $this->container = $module->getContainer(); $this->dependencyCompiler = new DependencyCode($this->container); $this->module = $module; diff --git a/src/FunctionCode.php b/src/FunctionCode.php index 5291376a..5fa7a9a4 100644 --- a/src/FunctionCode.php +++ b/src/FunctionCode.php @@ -114,7 +114,7 @@ private function setQualifiers(ReflectionMethod $method, ReflectionParameter $pa Qualifier::class ); if ($qualifier instanceof Qualifier) { - $this->compiler->setQaulifier(new IpQualifier($param, $annotation)); + $this->compiler->setQualifier(new IpQualifier($param, $annotation)); } } } diff --git a/src/GraphDumper.php b/src/GraphDumper.php index 4a251389..26fbe7c8 100644 --- a/src/GraphDumper.php +++ b/src/GraphDumper.php @@ -19,14 +19,20 @@ use const LOCK_EX; +/** + * @psalm-import-type ScriptDir from CompileInjector + */ final class GraphDumper { /** @var Container */ private $container; - /** @var string */ + /** @var ScriptDir */ private $scriptDir; + /** + * @param ScriptDir $scriptDir + */ public function __construct(Container $container, string $scriptDir) { $this->container = $container; @@ -34,7 +40,7 @@ public function __construct(Container $container, string $scriptDir) } /** - * @SuppressWarnings(PHPMD.UnusedLocalVariable) + * @SuppressWarnings(PHPMD.UnusedLocalVariable) // @phpstan-ignore-line */ public function __invoke(): void { diff --git a/src/InjectionPoint.php b/src/InjectionPoint.php index 2ec30902..6841bc4e 100644 --- a/src/InjectionPoint.php +++ b/src/InjectionPoint.php @@ -6,6 +6,7 @@ use Ray\Aop\ReflectionClass; use Ray\Aop\ReflectionMethod; +use Ray\Di\Annotation\ScriptDir; use Ray\Di\InjectionPointInterface; use ReflectionParameter; use RuntimeException; @@ -19,14 +20,20 @@ use function str_replace; use function unserialize; +/** + * @psalm-import-type ScriptDir from CompileInjector + */ final class InjectionPoint implements InjectionPointInterface { /** @var ReflectionParameter */ private $parameter; - /** @var string */ + /** @var ScriptDir */ private $scriptDir; + /** + * @param ScriptDir $scriptDir + */ public function __construct(ReflectionParameter $parameter, string $scriptDir) { $this->parameter = $parameter; diff --git a/src/InjectorFactory.php b/src/InjectorFactory.php index 07481edd..326ee58f 100644 --- a/src/InjectorFactory.php +++ b/src/InjectorFactory.php @@ -6,6 +6,7 @@ use Ray\Compiler\Annotation\Compile; use Ray\Di\AbstractModule; +use Ray\Di\Annotation\ScriptDir; use Ray\Di\Exception\Unbound; use Ray\Di\Injector as RayInjector; use Ray\Di\InjectorInterface; @@ -15,11 +16,13 @@ /** * @psalm-immutable + * @psalm-import-type ScriptDir from CompileInjector */ final class InjectorFactory { /** * @param callable(): AbstractModule $modules + * @param ScriptDir $scriptDir */ public static function getInstance(callable $modules, string $scriptDir): InjectorInterface { @@ -43,13 +46,17 @@ public static function getInstance(callable $modules, string $scriptDir): Inject return self::getScriptInjector($scriptDir, $module); } + /** + * @param ScriptDir $scriptDir + */ private static function getScriptInjector(string $scriptDir, AbstractModule $module): ScriptInjector { return new ScriptInjector($scriptDir, static function () use ($scriptDir, $module) { - return new ScriptinjectorModule($scriptDir, $module); + return new ScriptInjectorModule($scriptDir, $module); }); } + /** @param ScriptDir $scriptDIr */ private static function getCompileInjector(string $scriptDIr, LazyModuleInterface $module): CompileInjector { return new CompileInjector($scriptDIr, $module); diff --git a/src/Normalizer.php b/src/Normalizer.php index 9491c290..a463c2e2 100644 --- a/src/Normalizer.php +++ b/src/Normalizer.php @@ -76,13 +76,14 @@ private function getValueNode($value): Expr /** * Return array or object node * - * @param array|mixed|object $value + * @param array|mixed|object $value * * @return Expr\Array_|Expr\FuncCall */ private function getValueNodeNonAtomic($value): Expr { if (is_array($value)) { + /** @var array $value */ return $this->arrayValue($value); } diff --git a/src/OnDemandCompiler.php b/src/OnDemandCompiler.php index 392afa5c..b664b000 100644 --- a/src/OnDemandCompiler.php +++ b/src/OnDemandCompiler.php @@ -8,6 +8,7 @@ use Ray\Aop\Pointcut; use Ray\Compiler\Exception\Unbound; use Ray\Di\AbstractModule; +use Ray\Di\Annotation\ScriptDir; use Ray\Di\Bind; use Ray\Di\Dependency; use Ray\Di\Exception\NotFound; @@ -17,15 +18,18 @@ use function explode; use function file_exists; use function file_get_contents; -use function is_array; use function is_bool; use function unserialize; use const E_NOTICE; +/** + * @psalm-import-type ScriptDir from CompileInjector + * @psalm-type Pointcuts = list + */ final class OnDemandCompiler { - /** @var string */ + /** @var ScriptDir */ private $scriptDir; /** @var ScriptInjector */ @@ -37,6 +41,9 @@ final class OnDemandCompiler /** @var CompileNullObject */ private $compiler; + /** + * @param ScriptDir $scriptDir + */ public function __construct(ScriptInjector $injector, string $scriptDir, AbstractModule $module) { $this->scriptDir = $scriptDir; @@ -65,8 +72,9 @@ public function __invoke(string $dependencyIndex): void ($this->compiler)($containerObject, $this->scriptDir); $dependency = $containerArray[$dependencyIndex]; + /** @var Pointcuts $pointCuts */ $pointCuts = $this->loadPointcuts(); - $isWeaverable = $dependency instanceof Dependency && is_array($pointCuts); + $isWeaverable = $dependency instanceof Dependency && ! empty($pointCuts); if ($isWeaverable) { $dependency->weaveAspects(new Compiler($this->scriptDir), $pointCuts); } @@ -76,19 +84,19 @@ public function __invoke(string $dependencyIndex): void } /** - * @return array|false + * @return Pointcuts */ - private function loadPointcuts() + private function loadPointcuts(): array { $pointcutsPath = $this->scriptDir . ScriptInjector::AOP; if (! file_exists($pointcutsPath)) { - return false; // @codeCoverageIgnore + return []; // @codeCoverageIgnore } $serialized = file_get_contents($pointcutsPath); assert(! is_bool($serialized)); $er = error_reporting(error_reporting() ^ E_NOTICE); - /** @var array $pointcuts */ + /** @var Pointcuts $pointcuts */ $pointcuts = unserialize($serialized, ['allowed_classes' => true]); error_reporting($er); diff --git a/src/ScriptInjector.php b/src/ScriptInjector.php index 21c7a37e..9980193e 100644 --- a/src/ScriptInjector.php +++ b/src/ScriptInjector.php @@ -38,6 +38,10 @@ use const DIRECTORY_SEPARATOR; use const E_NOTICE; +/** + * @psalm-import-type ScriptDir from CompileInjector + * @psalm-import-type Ip from CompileInjector + */ final class ScriptInjector implements ScriptInjectorInterface { public const MODULE = '/_module.txt'; @@ -46,9 +50,9 @@ final class ScriptInjector implements ScriptInjectorInterface public const INSTANCE = '%s/%s.php'; - public const QUALIFIER = '%s/qualifer/%s-%s-%s'; + public const QUALIFIER = '%s/qualifier/%s-%s-%s'; - /** @var string */ + /** @var non-empty-string */ private $scriptDir; /** @@ -86,8 +90,8 @@ final class ScriptInjector implements ScriptInjectorInterface private static $scriptDirs = []; /** - * @param string $scriptDir generated instance script folder path - * @param callable $lazyModule callable variable which return AbstractModule instance + * @param ScriptDir $scriptDir generated instance script folder path + * @param callable $lazyModule callable variable which return AbstractModule instance * * @psalm-suppress UnresolvableInclude */ @@ -112,7 +116,7 @@ function (string $dependencyIndex, array $injectionPoint = ['', '', '']) { }; $singleton = /** - * @param array{0: string, 1: string, 2: string} $injectionPoint + * @param Ip $injectionPoint * * @return mixed */ @@ -164,7 +168,7 @@ function () { /** * {@inheritdoc} * - * @SuppressWarnings(PHPMD.UnusedLocalVariable) + * @SuppressWarnings(PHPMD.UnusedLocalVariable) // @phpstan-ignore-line */ public function getInstance($interface, $name = Name::ANY) { diff --git a/src/ScriptinjectorModule.php b/src/ScriptinjectorModule.php index 1008c5a1..daa510cd 100644 --- a/src/ScriptinjectorModule.php +++ b/src/ScriptinjectorModule.php @@ -7,11 +7,17 @@ use Ray\Di\AbstractModule; use Ray\Di\InjectorInterface; -class ScriptinjectorModule extends AbstractModule +/** + * @psalm-import-type ScriptDir from CompileInjector + */ +class ScriptInjectorModule extends AbstractModule { - /** @var string */ + /** @var ScriptDir */ private $scriptDir; + /** + * @param ScriptDir $scriptDir + */ public function __construct(string $scriptDir, ?AbstractModule $module = null) { $this->scriptDir = $scriptDir; diff --git a/tests/AssistedTest.php b/tests/AssistedTest.php index fb5cc29c..da0d41d3 100644 --- a/tests/AssistedTest.php +++ b/tests/AssistedTest.php @@ -37,8 +37,8 @@ public function testAssisted(): void $consumer = $this->injector->getInstance(FakeAssistedConsumer::class); /** @var FakeAssistedConsumer $consumer */ $assistedDependency = $consumer->assistOne('a', 'b'); - $expecetd = FakeRobot::class; - $this->assertInstanceOf($expecetd, $assistedDependency); + $expected = FakeRobot::class; + $this->assertInstanceOf($expected, $assistedDependency); } public function testAssistedWithName(): void @@ -47,8 +47,8 @@ public function testAssistedWithName(): void $consumer = $this->injector->getInstance(FakeAssistedConsumer::class); /** @var FakeAssistedConsumer $consumer */ $assistedDependency = $consumer->assistWithName('a7'); - $expecetd = 1; - $this->assertSame($expecetd, $assistedDependency); + $expected = 1; + $this->assertSame($expected, $assistedDependency); } public function testAssistedAnyWithName(): void @@ -80,7 +80,7 @@ public function testAssistedMethodInvocationNotAvailable(): void $assistedDbProvider->get(); } - public function testAssistedCustomeInject(): void + public function testAssistedCustomInject(): void { $assistedConsumer = (new Injector(new FakeAssistedDbModule(), __DIR__ . '/tmp'))->getInstance(FakeAssistedParamsConsumer::class); /** @var FakeAssistedParamsConsumer $assistedConsumer */ diff --git a/tests/CachedFactoryTest.php b/tests/CachedFactoryTest.php index fdc1bc34..fcb2a553 100644 --- a/tests/CachedFactoryTest.php +++ b/tests/CachedFactoryTest.php @@ -11,6 +11,9 @@ use function spl_object_hash; +/** + * @psalm-type Context = 'dev'|'prod' + */ class CachedFactoryTest extends TestCase { public function testInstanceCachedInStaticMemory(): void @@ -31,7 +34,7 @@ public function testInstanceCachedInFileCache(): void } /** - * @param 'dev'|'prod' $context + * @param Context $context */ private function getInjector(string $context): InjectorInterface { diff --git a/tests/CompileInjectorTest.php b/tests/CompileInjectorTest.php index 813bf686..fa040a25 100644 --- a/tests/CompileInjectorTest.php +++ b/tests/CompileInjectorTest.php @@ -7,9 +7,7 @@ use PHPUnit\Framework\TestCase; use Ray\Di\Exception\Unbound; -use function assert; use function file_get_contents; -use function is_object; use function serialize; use function spl_object_hash; use function unserialize; @@ -54,7 +52,7 @@ public function testGetInstance(): void $this->assertInstanceOf(FakeCarInterface::class, $instance); } - public function testInjectopnPoint(): void + public function testInjectionPoint(): void { $instance = $this->injector->getInstance(FakeLoggerConsumer::class); $this->assertInstanceOf(FakeLoggerConsumer::class, $instance); @@ -64,8 +62,6 @@ public function testSingleton(): void { $instance1 = $this->injector->getInstance(FakeRobotInterface::class); $instance2 = $this->injector->getInstance(FakeRobotInterface::class); - assert(is_object($instance1)); - assert(is_object($instance2)); $this->assertSame(spl_object_hash($instance1), spl_object_hash($instance2)); } @@ -98,7 +94,7 @@ public function testUnboundCompileLogFile(): void /** * @depends testUnboundCompileLogFile */ - public function testCompileFaillureLog(): void + public function testCompileFailureLog(): void { $logFile = __DIR__ . '/tmp/_compile.log'; $this->assertFileExists(__DIR__ . '/tmp/compiled'); diff --git a/tests/ContextInjectorTest.php b/tests/ContextInjectorTest.php index 0a6a35ab..7c8fdb4b 100644 --- a/tests/ContextInjectorTest.php +++ b/tests/ContextInjectorTest.php @@ -13,8 +13,6 @@ use Ray\Di\Injector; use Ray\Di\InjectorInterface; -use function assert; - class ContextInjectorTest extends TestCase { public function testGetRayInjector(): InjectorInterface @@ -53,14 +51,11 @@ public function testContainerIsResetWhenTheInjectorIsRetrieved(AbstractInjectorC { $injector = ContextInjector::getInstance($context); $deep = $injector->getInstance(FakeDeep::class); - assert($deep instanceof FakeDeep); $deep->dep->changed = true; - $deep1 = $injector->getInstance(FakeDeep::class); - assert($deep1 instanceof FakeDeep); + $injector->getInstance(FakeDeep::class); $this->assertTrue($deep->dep->changed); $injector = ContextInjector::getInstance($context); $deep2 = $injector->getInstance(FakeDeep::class); - assert($deep2 instanceof FakeDeep); $this->assertFalse($deep2->dep->changed); $demand = $injector->getInstance(FakeDemand::class); $this->assertInstanceOf(FakeDemand::class, $demand); diff --git a/tests/DevCache.php b/tests/DevCache.php index 5414090c..fd281dc4 100644 --- a/tests/DevCache.php +++ b/tests/DevCache.php @@ -70,7 +70,7 @@ public function doDelete($id) */ public function doGetStats() { - return $this->cache->getStats(); // @phpstan-ignore-line + return $this->cache->getStats(); } /** diff --git a/tests/DiCompilerTest.php b/tests/DiCompilerTest.php index 75c3d803..2f4b57e4 100644 --- a/tests/DiCompilerTest.php +++ b/tests/DiCompilerTest.php @@ -13,7 +13,6 @@ use ReflectionParameter; use function assert; -use function property_exists; class DiCompilerTest extends TestCase { @@ -98,7 +97,6 @@ public function testInjectionPoint(): void $injector = new ScriptInjector(__DIR__ . '/tmp'); /** @var FakeLoggerConsumer $loggerConsumer */ $loggerConsumer = $injector->getInstance(FakeLoggerConsumer::class); - assert(property_exists($loggerConsumer, 'logger')); assert($loggerConsumer->logger instanceof FakeLogger); $this->assertSame(FakeLoggerConsumer::class, $loggerConsumer->logger->name); $this->assertSame('MEMORY', $loggerConsumer->logger->type); @@ -108,7 +106,6 @@ public function testInjectionPoint(): void $this->assertInstanceOf(ReflectionMethod::class, $ip->getMethod()); $this->assertSame('setLogger', $ip->getMethod()->name); $method = $ip->getMethod(); - assert($method instanceof ReflectionMethod); $this->assertInstanceOf(FakeLoggerInject::class, $method->getAnnotations()[0]); $this->assertInstanceOf(ReflectionParameter::class, $ip->getParameter()); $this->assertSame('logger', $ip->getParameter()->name); diff --git a/tests/Fake/Assisted/FakeAssistedInjectConsumer.php b/tests/Fake/Assisted/FakeAssistedInjectConsumer.php index 7de0d54e..19c05cf1 100644 --- a/tests/Fake/Assisted/FakeAssistedInjectConsumer.php +++ b/tests/Fake/Assisted/FakeAssistedInjectConsumer.php @@ -34,7 +34,7 @@ public function assistAny(#[Assisted, Named('one')] $var2 = null, #[Inject] ?Fak return [$var2, $robot]; } - public function assistCustomeAssistedInject(#[FakeInjectOne] int $one = 0): int + public function assistCustomAssistedInject(#[FakeInjectOne] int $one = 0): int { return $one; } diff --git a/tests/Fake/Deep/FakeScriptInjectorContext.php b/tests/Fake/Deep/FakeScriptInjectorContext.php index be54a321..80c1bc24 100644 --- a/tests/Fake/Deep/FakeScriptInjectorContext.php +++ b/tests/Fake/Deep/FakeScriptInjectorContext.php @@ -25,6 +25,7 @@ protected function doFetch($id) protected function doContains($id) { + unset($id); } protected function doSave($id, $data, $lifeTime = 0) diff --git a/tests/Fake/FakeCar3.php b/tests/Fake/FakeCar3.php index 05f71901..3f71a5e6 100644 --- a/tests/Fake/FakeCar3.php +++ b/tests/Fake/FakeCar3.php @@ -10,5 +10,6 @@ class FakeCar3 { public function __construct(DateTimeImmutable $dateTime) { + unset($dateTime); } } diff --git a/tests/Fake/FakeInvalidDependency.php b/tests/Fake/FakeInvalidDependency.php index 8c3fbc1c..071c6e37 100644 --- a/tests/Fake/FakeInvalidDependency.php +++ b/tests/Fake/FakeInvalidDependency.php @@ -12,14 +12,17 @@ class FakeInvalidDependency implements DependencyInterface { public function inject(Container $container) { + unset($container); } public function register(array &$container, Bind $bind) { + unset($container, $bind); } public function setScope($scope) { + unset($scope) } public function __toString() diff --git a/tests/Fake/script/singleton.php b/tests/Fake/script/singleton.php index e026bfac..9b1139bf 100644 --- a/tests/Fake/script/singleton.php +++ b/tests/Fake/script/singleton.php @@ -2,4 +2,4 @@ declare(strict_types=1); -$singleton('FakeInferface-*'); +$singleton('FakeInterface-*'); diff --git a/tests/InjectorFactoryTest.php b/tests/InjectorFactoryTest.php index 7e709bb1..e93a8799 100644 --- a/tests/InjectorFactoryTest.php +++ b/tests/InjectorFactoryTest.php @@ -27,10 +27,10 @@ public function getInstanceScriptInjector(): void { $injector = InjectorFactory::getInstance( static function (): AbstractModule { - $modue = new FakeToBindPrototypeModule(); - $modue->install(new FakeProdModule()); + $module = new FakeToBindPrototypeModule(); + $module->install(new FakeProdModule()); - return $modue; + return $module; }, __DIR__ . '/tmp/base' ); diff --git a/tests/MultiBindingTest.php b/tests/MultiBindingTest.php index 4236f9e7..ee10c203 100644 --- a/tests/MultiBindingTest.php +++ b/tests/MultiBindingTest.php @@ -42,6 +42,9 @@ protected function setUp(): void }); } + /** + * @return Map + */ public function testInjectMap(): Map { /** @var FakeMultiBindingConsumer $consumer */ @@ -52,6 +55,8 @@ public function testInjectMap(): Map } /** + * @param Map $map + * * @depends testInjectMap */ public function testMapInstance(Map $map): void @@ -61,6 +66,8 @@ public function testMapInstance(Map $map): void } /** + * @param Map $map + * * @depends testInjectMap */ public function testMapIteration(Map $map): void @@ -71,6 +78,8 @@ public function testMapIteration(Map $map): void } /** + * @param Map $map + * * @depends testInjectMap */ public function testIsSet(Map $map): void @@ -80,6 +89,8 @@ public function testIsSet(Map $map): void } /** + * @param Map $map + * * @depends testInjectMap */ public function testOffsetSet(Map $map): void @@ -89,6 +100,8 @@ public function testOffsetSet(Map $map): void } /** + * @param Map $map + * * @depends testInjectMap */ public function testOffsetUnset(Map $map): void @@ -106,7 +119,7 @@ public function testAnotherBinder(): void $this->assertSame(3, count($consumer->robots)); } - public function testMultipileModule(): void + public function testMultipleModule(): void { $module = new NullModule(); $binder = MultiBinder::newInstance($module, FakeEngineInterface::class); diff --git a/tests/ScriptInjectorTest.php b/tests/ScriptInjectorTest.php index db037373..c5953178 100644 --- a/tests/ScriptInjectorTest.php +++ b/tests/ScriptInjectorTest.php @@ -13,7 +13,6 @@ use function assert; use function count; use function glob; -use function property_exists; use function serialize; use function spl_object_hash; use function unserialize; @@ -122,7 +121,6 @@ public function testAop(): void $instance1 = $injector->getInstance(FakeCarInterface::class); $instance2 = $injector->getInstance(FakeCar::class); $instance3 = $injector->getInstance(FakeCar2::class); - assert($instance3 instanceof FakeCar2); $this->assertInstanceOf(WeavedInterface::class, $instance1); $this->assertInstanceOf(WeavedInterface::class, $instance2); $this->assertInstanceOf(WeavedInterface::class, $instance3); @@ -133,9 +131,7 @@ public function testOnDemandSingleton(): void { (new DiCompiler(new FakeToBindSingletonModule(), __DIR__ . '/tmp'))->compile(); $dependSingleton1 = $this->injector->getInstance(FakeDependSingleton::class); - assert($dependSingleton1 instanceof FakeDependSingleton); $dependSingleton2 = $this->injector->getInstance(FakeDependSingleton::class); - assert($dependSingleton2 instanceof FakeDependSingleton); $hash1 = spl_object_hash($dependSingleton1->robot); $hash2 = spl_object_hash($dependSingleton2->robot); $this->assertSame($hash1, $hash2); @@ -145,9 +141,7 @@ public function testOnDemandPrototype(): void { (new DiCompiler(new FakeCarModule(), __DIR__ . '/tmp'))->compile(); $fakeDependPrototype1 = $this->injector->getInstance(FakeDependPrototype::class); - assert($fakeDependPrototype1 instanceof FakeDependPrototype); $fakeDependPrototype2 = $this->injector->getInstance(FakeDependPrototype::class); - assert($fakeDependPrototype2 instanceof FakeDependPrototype); $hash1 = spl_object_hash($fakeDependPrototype1->car); $hash2 = spl_object_hash($fakeDependPrototype2->car); $this->assertNotSame($hash1, $hash2); @@ -156,7 +150,6 @@ public function testOnDemandPrototype(): void public function testOptional(): void { $optional = $this->injector->getInstance(FakeOptional::class); - assert($optional instanceof FakeOptional); $this->assertNull($optional->robot); } @@ -166,7 +159,6 @@ public function testDependInjector(): void $diCompiler->compile(); /** @var FakeFactory $factory */ $factory = $diCompiler->getInstance(FakeFactory::class); - assert(property_exists($factory, 'injector')); $this->assertInstanceOf(InjectorInterface::class, $factory->injector); $injector = new ScriptInjector(__DIR__ . '/tmp'); /** @var FakeFactory $factory */ @@ -177,9 +169,9 @@ public function testDependInjector(): void public function testUnbound(): void { $this->expectException(Unbound::class); - $this->expectExceptionMessage('NOCLASS-NONAME'); + $this->expectExceptionMessage('NO-CLASS-NO-NAME'); $injector = new ScriptInjector(__DIR__ . '/tmp'); - $injector->getInstance('NOCLASS', 'NONAME'); // @phpstan-ignore-line + $injector->getInstance('NO-CLASS', 'NO-NAME'); // @phpstan-ignore-line } public function testCompileOnDemand(): void @@ -191,7 +183,7 @@ static function () { } ); $car = $injector->getInstance(FakeCar::class); - $this->assertTrue($car instanceof FakeCar); + $this->assertTrue($car instanceof FakeCar); // @phpstan-ignore-line } public function testCompileOnDemandAop(): void @@ -203,7 +195,6 @@ static function () { } ); $aop = $injector->getInstance(FakeAopInterface::class); - assert($aop instanceof FakeAopInterface); $result = $aop->returnSame(1); $this->assertSame(2, $result); } @@ -219,7 +210,7 @@ static function () { $injector = unserialize($serialize); assert($injector instanceof InjectorInterface); $car = $injector->getInstance(FakeCar::class); - $this->assertTrue($car instanceof FakeCar); + $this->assertTrue($car instanceof FakeCar); // @phpstan-ignore-line } public function testCompileOnDemandAopSerialize(): void From 9acbc02120465fc4ff1391c37f50d0c0aed01c89 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:22:55 +0900 Subject: [PATCH 06/24] Improve validation in testDomainException Added assertions to check if FakeInvalidDependency class exists and if the instance implemented DependencyInterface. This ensures the test cannot silently fail due to a non-existing class or incorrect type. --- src/DependencyCode.php | 2 +- tests/DependencyCompilerTest.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/DependencyCode.php b/src/DependencyCode.php index 1b04abd9..7c550156 100644 --- a/src/DependencyCode.php +++ b/src/DependencyCode.php @@ -151,7 +151,7 @@ private function getProviderCode(DependencyProvider $provider): Code $node[] = $this->getIsSingletonCode($isSingleton); $node[] = new Stmt\Return_(new MethodCall(new Expr\Variable('instance'), 'get')); /** @psalm-suppress InvalidArgument */ - $node = $this->factory->namespace('Ray\Di\Compiler')->addStmts($node)->getNode(); // @phpstan-ignore-line + $node = $this->factory->namespace('Ray\Di\Compiler')->addStmts($node)->getNode(); $qualifier = $this->qualifier; $this->qualifier = null; diff --git a/tests/DependencyCompilerTest.php b/tests/DependencyCompilerTest.php index 28279047..a528b69c 100644 --- a/tests/DependencyCompilerTest.php +++ b/tests/DependencyCompilerTest.php @@ -7,9 +7,11 @@ use DomainException; use PHPUnit\Framework\TestCase; use Ray\Di\Container; +use Ray\Di\DependencyInterface; use Ray\Di\Instance; use Ray\Di\Name; +use function class_exists; use function str_replace; class DependencyCompilerTest extends TestCase @@ -139,7 +141,10 @@ public function testDependencyObjectInstanceCompile(): void public function testDomainException(): void { $this->expectException(DomainException::class); - (new DependencyCode(new Container()))->getCode(new FakeInvalidDependency()); + assert(class_exists(FakeInvalidDependency::class)); + $fake = new FakeInvalidDependency(); + assert($fake instanceof DependencyInterface); + (new DependencyCode(new Container()))->getCode($fake); } public function testContextualProviderCompile(): void From 280fc18346063216986f0c0ca24a990ee2a8ddd8 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:28:53 +0900 Subject: [PATCH 07/24] Soothe CS Add missing `assert` import in DependencyCompilerTest This change ensures proper usage of the `assert` function within the test file. Adding the import helps maintain code clarity and prevents potential issues related to missing function definitions. --- tests/DependencyCompilerTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/DependencyCompilerTest.php b/tests/DependencyCompilerTest.php index a528b69c..ddb36d8c 100644 --- a/tests/DependencyCompilerTest.php +++ b/tests/DependencyCompilerTest.php @@ -11,6 +11,7 @@ use Ray\Di\Instance; use Ray\Di\Name; +use function assert; use function class_exists; use function str_replace; From 1f6b78bec253b6742f7a2fca8729ca7a1252eca8 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:31:48 +0900 Subject: [PATCH 08/24] Rename file --- src/{ScriptinjectorModule.php => ScriptInjectorModule.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{ScriptinjectorModule.php => ScriptInjectorModule.php} (100%) diff --git a/src/ScriptinjectorModule.php b/src/ScriptInjectorModule.php similarity index 100% rename from src/ScriptinjectorModule.php rename to src/ScriptInjectorModule.php From e59a1454cf828bd7ab8f81610359684832e09b74 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:34:48 +0900 Subject: [PATCH 09/24] Update tests/Fake/FakeInvalidDependency.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- tests/Fake/FakeInvalidDependency.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Fake/FakeInvalidDependency.php b/tests/Fake/FakeInvalidDependency.php index 071c6e37..3dd3dbdb 100644 --- a/tests/Fake/FakeInvalidDependency.php +++ b/tests/Fake/FakeInvalidDependency.php @@ -22,7 +22,7 @@ public function register(array &$container, Bind $bind) public function setScope($scope) { - unset($scope) + unset($scope); } public function __toString() From 4f94131f721ec0291fb39a22c448cd7bae1de3e0 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:38:21 +0900 Subject: [PATCH 10/24] Update tests/ScriptInjectorTest.php Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- tests/ScriptInjectorTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ScriptInjectorTest.php b/tests/ScriptInjectorTest.php index c5953178..fe551044 100644 --- a/tests/ScriptInjectorTest.php +++ b/tests/ScriptInjectorTest.php @@ -183,7 +183,7 @@ static function () { } ); $car = $injector->getInstance(FakeCar::class); - $this->assertTrue($car instanceof FakeCar); // @phpstan-ignore-line + $this->assertInstanceOf(FakeCar::class, $car); } public function testCompileOnDemandAop(): void From 9694596fc807c6662f6c1e823d8e805917a91fa2 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:42:45 +0900 Subject: [PATCH 11/24] Ignore PHPStan errors in DependencyCompilerTest This is because following getCode($fake) .. make sure $fake type to avoid false positive inspection by phpstan. --- tests/DependencyCompilerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DependencyCompilerTest.php b/tests/DependencyCompilerTest.php index ddb36d8c..9b97443f 100644 --- a/tests/DependencyCompilerTest.php +++ b/tests/DependencyCompilerTest.php @@ -144,7 +144,7 @@ public function testDomainException(): void $this->expectException(DomainException::class); assert(class_exists(FakeInvalidDependency::class)); $fake = new FakeInvalidDependency(); - assert($fake instanceof DependencyInterface); + assert($fake instanceof DependencyInterface); // @phpstan-ignore-line (new DependencyCode(new Container()))->getCode($fake); } From 7974c32669238990590b1e7d994a5a8d601923a0 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 10:57:29 +0900 Subject: [PATCH 12/24] Update doctrine coding standard v12 Upgraded doctrine/coding-standard to ^12.0 in composer.json for improved coding standards. Simplified doc comments throughout the codebase for consistency and readability. --- src/AbstractInjectorContext.php | 8 ++------ src/Annotation/Compile.php | 4 +--- src/CachedInjectorFactory.php | 4 +--- src/Code.php | 4 +--- src/CompileInjector.php | 6 ++---- src/CompileNullObject.php | 4 +--- src/ContextInjector.php | 4 +--- src/DependencyCode.php | 2 +- src/DependencySaver.php | 8 ++------ src/DiCompileModule.php | 3 ++- src/DiCompiler.php | 10 +++------- src/FactoryCode.php | 4 +--- src/GraphDumper.php | 12 +++--------- src/InjectionPoint.php | 18 +++++++----------- src/InjectorFactory.php | 4 +--- src/MapModule.php | 2 +- src/OnDemandCompiler.php | 8 ++------ src/PramReaderModule.php | 2 +- src/ScriptInjector.php | 6 ++---- src/ScriptInjectorModule.php | 11 ++++------- tests/AssistedTest.php | 4 +--- tests/CachedFactoryTest.php | 8 ++------ tests/CompileInjectorTest.php | 12 +++--------- tests/ContextInjectorTest.php | 8 ++------ tests/DependencyCompilerTest.php | 1 + tests/DevCache.php | 8 ++------ tests/DiCompilerTest.php | 8 ++------ tests/MultiBindingTest.php | 8 ++------ tests/ScriptInjectorTest.php | 4 +--- vendor-bin/tools/composer.json | 2 +- 30 files changed, 56 insertions(+), 131 deletions(-) diff --git a/src/AbstractInjectorContext.php b/src/AbstractInjectorContext.php index 78a268a1..dec859f4 100644 --- a/src/AbstractInjectorContext.php +++ b/src/AbstractInjectorContext.php @@ -8,9 +8,7 @@ use Ray\Di\AbstractModule; use Ray\Di\Annotation\ScriptDir; -/** - * @psalm-import-type ScriptDir from CompileInjector - */ +/** @psalm-import-type ScriptDir from CompileInjector */ abstract class AbstractInjectorContext implements LazyModuleInterface { /** @@ -19,9 +17,7 @@ abstract class AbstractInjectorContext implements LazyModuleInterface */ public $tmpDir; - /** - * @param ScriptDir $tmpDir - */ + /** @param ScriptDir $tmpDir */ public function __construct(string $tmpDir) { $this->tmpDir = $tmpDir; diff --git a/src/Annotation/Compile.php b/src/Annotation/Compile.php index cba66b3a..4e78f2e9 100644 --- a/src/Annotation/Compile.php +++ b/src/Annotation/Compile.php @@ -6,9 +6,7 @@ use Ray\Di\Di\Qualifier; -/** - * @Qualifier - */ +/** @Qualifier */ final class Compile { } diff --git a/src/CachedInjectorFactory.php b/src/CachedInjectorFactory.php index 49f33ef4..23294904 100644 --- a/src/CachedInjectorFactory.php +++ b/src/CachedInjectorFactory.php @@ -14,9 +14,7 @@ use function serialize; use function unserialize; -/** - * @psalm-import-type ScriptDir from CompileInjector - */ +/** @psalm-import-type ScriptDir from CompileInjector */ final class CachedInjectorFactory { /** @var array */ diff --git a/src/Code.php b/src/Code.php index 0da7986b..99ec8b8d 100644 --- a/src/Code.php +++ b/src/Code.php @@ -18,9 +18,7 @@ final class Code /** @var Node */ private $node; - /** - * @SuppressWarnings(PHPMD.BooleanArgumentFlag) // @phpstan-ignore-line - */ + /** @SuppressWarnings(PHPMD.BooleanArgumentFlag) // @phpstan-ignore-line */ public function __construct(Node $node, bool $isSingleton = false, ?IpQualifier $qualifier = null) { $this->node = $node; diff --git a/src/CompileInjector.php b/src/CompileInjector.php index bccc042d..27e4e03d 100644 --- a/src/CompileInjector.php +++ b/src/CompileInjector.php @@ -112,9 +112,7 @@ function (string $dependencyIndex, array $injectionPoint = ['', '', '']) { $this->functions = [$prototype, $singleton, $injectionPoint, $injector]; } - /** - * @return list - */ + /** @return list */ public function __sleep() { return ['scriptDir', 'singletons', 'lazyModule']; @@ -129,7 +127,7 @@ public function __wakeup() } /** - * {@inheritdoc} + * {@inheritDoc} * * @SuppressWarnings(PHPMD.UnusedLocalVariable) // @phpstan-ignore-line */ diff --git a/src/CompileNullObject.php b/src/CompileNullObject.php index 70685b0c..a12f802f 100644 --- a/src/CompileNullObject.php +++ b/src/CompileNullObject.php @@ -15,9 +15,7 @@ */ final class CompileNullObject { - /** - * @param ScriptDir $scriptDir - */ + /** @param ScriptDir $scriptDir */ public function __invoke(Container $container, string $scriptDir): void { $container->map(static function (DependencyInterface $dependency) use ($scriptDir) { diff --git a/src/ContextInjector.php b/src/ContextInjector.php index 2209c533..a83772fd 100644 --- a/src/ContextInjector.php +++ b/src/ContextInjector.php @@ -9,9 +9,7 @@ use function get_class; -/** - * @psalm-immutable - */ +/** @psalm-immutable */ final class ContextInjector { public static function getInstance(AbstractInjectorContext $injectorContext): InjectorInterface diff --git a/src/DependencyCode.php b/src/DependencyCode.php index 7c550156..594ab650 100644 --- a/src/DependencyCode.php +++ b/src/DependencyCode.php @@ -81,7 +81,7 @@ public function getCode(DependencyInterface $dependency): Code } /** - * {@inheritdoc} + * {@inheritDoc} */ public function setContext($context) { diff --git a/src/DependencySaver.php b/src/DependencySaver.php index 3f0fc2fd..50acfeb7 100644 --- a/src/DependencySaver.php +++ b/src/DependencySaver.php @@ -16,9 +16,7 @@ use const PHP_EOL; -/** - * @psalm-import-type ScriptDir from CompileInjector - */ +/** @psalm-import-type ScriptDir from CompileInjector */ final class DependencySaver { /** @var ScriptDir */ @@ -27,9 +25,7 @@ final class DependencySaver /** @var FilePutContents */ private $filePutContents; - /** - * @param ScriptDir $scriptDir - */ + /** @param ScriptDir $scriptDir */ public function __construct(string $scriptDir) { $this->scriptDir = $scriptDir; diff --git a/src/DiCompileModule.php b/src/DiCompileModule.php index f8a1bf63..936451db 100644 --- a/src/DiCompileModule.php +++ b/src/DiCompileModule.php @@ -15,11 +15,12 @@ class DiCompileModule extends AbstractModule public function __construct(bool $doCompile, ?AbstractModule $module = null) { $this->doCompile = $doCompile; + parent::__construct($module); } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function configure(): void { diff --git a/src/DiCompiler.php b/src/DiCompiler.php index 0605d8a7..349aa75b 100644 --- a/src/DiCompiler.php +++ b/src/DiCompiler.php @@ -25,9 +25,7 @@ use function sprintf; use function sys_get_temp_dir; -/** - * @psalm-import-type ScriptDir from CompileInjector - */ +/** @psalm-import-type ScriptDir from CompileInjector */ final class DiCompiler implements InjectorInterface { /** @var ScriptDir */ @@ -48,9 +46,7 @@ final class DiCompiler implements InjectorInterface /** @var FilePutContents */ private $filePutContents; - /** - * @param ScriptDir $scriptDir - */ + /** @param ScriptDir $scriptDir */ public function __construct(AbstractModule $module, string $scriptDir) { /** @var ScriptDir $scriptDir */ @@ -70,7 +66,7 @@ public function __construct(AbstractModule $module, string $scriptDir) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getInstance($interface, $name = Name::ANY) { diff --git a/src/FactoryCode.php b/src/FactoryCode.php index 7783246b..42de5f11 100644 --- a/src/FactoryCode.php +++ b/src/FactoryCode.php @@ -90,9 +90,7 @@ public function getArgStmt(Argument $argument): NodeAbstract return ($this->functionCompiler)($argument, $dependency); } - /** - * @param array $arguments - */ + /** @param array $arguments */ private function getConstructorInjection(string $class, array $arguments = []): Expr\New_ { $args = []; diff --git a/src/GraphDumper.php b/src/GraphDumper.php index 26fbe7c8..ea98c5b4 100644 --- a/src/GraphDumper.php +++ b/src/GraphDumper.php @@ -19,9 +19,7 @@ use const LOCK_EX; -/** - * @psalm-import-type ScriptDir from CompileInjector - */ +/** @psalm-import-type ScriptDir from CompileInjector */ final class GraphDumper { /** @var Container */ @@ -30,18 +28,14 @@ final class GraphDumper /** @var ScriptDir */ private $scriptDir; - /** - * @param ScriptDir $scriptDir - */ + /** @param ScriptDir $scriptDir */ public function __construct(Container $container, string $scriptDir) { $this->container = $container; $this->scriptDir = $scriptDir; } - /** - * @SuppressWarnings(PHPMD.UnusedLocalVariable) // @phpstan-ignore-line - */ + /** @SuppressWarnings(PHPMD.UnusedLocalVariable) // @phpstan-ignore-line */ public function __invoke(): void { $container = $this->container->getContainer(); diff --git a/src/InjectionPoint.php b/src/InjectionPoint.php index 6841bc4e..456a1182 100644 --- a/src/InjectionPoint.php +++ b/src/InjectionPoint.php @@ -20,9 +20,7 @@ use function str_replace; use function unserialize; -/** - * @psalm-import-type ScriptDir from CompileInjector - */ +/** @psalm-import-type ScriptDir from CompileInjector */ final class InjectionPoint implements InjectionPointInterface { /** @var ReflectionParameter */ @@ -31,9 +29,7 @@ final class InjectionPoint implements InjectionPointInterface /** @var ScriptDir */ private $scriptDir; - /** - * @param ScriptDir $scriptDir - */ + /** @param ScriptDir $scriptDir */ public function __construct(ReflectionParameter $parameter, string $scriptDir) { $this->parameter = $parameter; @@ -41,7 +37,7 @@ public function __construct(ReflectionParameter $parameter, string $scriptDir) } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getParameter(): ReflectionParameter { @@ -49,7 +45,7 @@ public function getParameter(): ReflectionParameter } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getMethod(): ReflectionMethod { @@ -63,7 +59,7 @@ public function getMethod(): ReflectionMethod } /** - * {@inheritdoc} + * {@inheritDoc} */ public function getClass(): ReflectionClass { @@ -74,7 +70,7 @@ public function getClass(): ReflectionClass } /** - * {@inheritdoc} + * {@inheritDoc} * * @return array<(object|null)> * @@ -86,7 +82,7 @@ public function getQualifiers(): array } /** - * {@inheritdoc} + * {@inheritDoc} * * @return object|null */ diff --git a/src/InjectorFactory.php b/src/InjectorFactory.php index 326ee58f..7b7e70ae 100644 --- a/src/InjectorFactory.php +++ b/src/InjectorFactory.php @@ -46,9 +46,7 @@ public static function getInstance(callable $modules, string $scriptDir): Inject return self::getScriptInjector($scriptDir, $module); } - /** - * @param ScriptDir $scriptDir - */ + /** @param ScriptDir $scriptDir */ private static function getScriptInjector(string $scriptDir, AbstractModule $module): ScriptInjector { return new ScriptInjector($scriptDir, static function () use ($scriptDir, $module) { diff --git a/src/MapModule.php b/src/MapModule.php index 744cb549..a608d1f8 100644 --- a/src/MapModule.php +++ b/src/MapModule.php @@ -11,7 +11,7 @@ class MapModule extends AbstractModule { /** - * {@inheritdoc} + * {@inheritDoc} */ protected function configure(): void { diff --git a/src/OnDemandCompiler.php b/src/OnDemandCompiler.php index b664b000..f31dcdd9 100644 --- a/src/OnDemandCompiler.php +++ b/src/OnDemandCompiler.php @@ -41,9 +41,7 @@ final class OnDemandCompiler /** @var CompileNullObject */ private $compiler; - /** - * @param ScriptDir $scriptDir - */ + /** @param ScriptDir $scriptDir */ public function __construct(ScriptInjector $injector, string $scriptDir, AbstractModule $module) { $this->scriptDir = $scriptDir; @@ -83,9 +81,7 @@ public function __invoke(string $dependencyIndex): void (new DependencySaver($this->scriptDir))($dependencyIndex, $code); } - /** - * @return Pointcuts - */ + /** @return Pointcuts */ private function loadPointcuts(): array { $pointcutsPath = $this->scriptDir . ScriptInjector::AOP; diff --git a/src/PramReaderModule.php b/src/PramReaderModule.php index 047bf0e2..2c6b6c11 100644 --- a/src/PramReaderModule.php +++ b/src/PramReaderModule.php @@ -11,7 +11,7 @@ class PramReaderModule extends AbstractModule { /** - * {@inheritdoc} + * {@inheritDoc} */ protected function configure(): void { diff --git a/src/ScriptInjector.php b/src/ScriptInjector.php index 9980193e..4a63034c 100644 --- a/src/ScriptInjector.php +++ b/src/ScriptInjector.php @@ -145,9 +145,7 @@ function (string $dependencyIndex, $injectionPoint = ['', '', '']) { $this->functions = [$prototype, $singleton, $injectionPoint, $injector]; } - /** - * @return list - */ + /** @return list */ public function __sleep() { $this->saveModule(); @@ -166,7 +164,7 @@ function () { } /** - * {@inheritdoc} + * {@inheritDoc} * * @SuppressWarnings(PHPMD.UnusedLocalVariable) // @phpstan-ignore-line */ diff --git a/src/ScriptInjectorModule.php b/src/ScriptInjectorModule.php index daa510cd..adc1ae9a 100644 --- a/src/ScriptInjectorModule.php +++ b/src/ScriptInjectorModule.php @@ -7,25 +7,22 @@ use Ray\Di\AbstractModule; use Ray\Di\InjectorInterface; -/** - * @psalm-import-type ScriptDir from CompileInjector - */ +/** @psalm-import-type ScriptDir from CompileInjector */ class ScriptInjectorModule extends AbstractModule { /** @var ScriptDir */ private $scriptDir; - /** - * @param ScriptDir $scriptDir - */ + /** @param ScriptDir $scriptDir */ public function __construct(string $scriptDir, ?AbstractModule $module = null) { $this->scriptDir = $scriptDir; + parent::__construct($module); } /** - * {@inheritdoc} + * {@inheritDoc} */ protected function configure(): void { diff --git a/tests/AssistedTest.php b/tests/AssistedTest.php index da0d41d3..334dd925 100644 --- a/tests/AssistedTest.php +++ b/tests/AssistedTest.php @@ -17,9 +17,7 @@ use Ray\Di\Injector; use Ray\Di\InjectorInterface; -/** - * @requires PHP 8.0 - */ +/** @requires PHP 8.0 */ class AssistedTest extends TestCase { /** @var InjectorInterface */ diff --git a/tests/CachedFactoryTest.php b/tests/CachedFactoryTest.php index fcb2a553..a91dec5f 100644 --- a/tests/CachedFactoryTest.php +++ b/tests/CachedFactoryTest.php @@ -11,9 +11,7 @@ use function spl_object_hash; -/** - * @psalm-type Context = 'dev'|'prod' - */ +/** @psalm-type Context = 'dev'|'prod' */ class CachedFactoryTest extends TestCase { public function testInstanceCachedInStaticMemory(): void @@ -33,9 +31,7 @@ public function testInstanceCachedInFileCache(): void $injector2->getInstance(FakeRobotInterface::class); } - /** - * @param Context $context - */ + /** @param Context $context */ private function getInjector(string $context): InjectorInterface { if ($context === 'dev') { diff --git a/tests/CompileInjectorTest.php b/tests/CompileInjectorTest.php index fa040a25..48e26f95 100644 --- a/tests/CompileInjectorTest.php +++ b/tests/CompileInjectorTest.php @@ -43,9 +43,7 @@ public function testCompile(): void $this->assertFileExists(__DIR__ . '/tmp/Ray_Compiler_FakeCar-.php'); } - /** - * @depends testCompile - */ + /** @depends testCompile */ public function testGetInstance(): void { $instance = $this->injector->getInstance(FakeCarInterface::class); @@ -82,18 +80,14 @@ public function testUnbound(): void $injector->getInstance(FakeCar2::class); } - /** - * @depends testUnbound - */ + /** @depends testUnbound */ public function testUnboundCompileLogFile(): void { $this->expectException(Unbound::class); $this->injector->getInstance(FakeCar2::class); } - /** - * @depends testUnboundCompileLogFile - */ + /** @depends testUnboundCompileLogFile */ public function testCompileFailureLog(): void { $logFile = __DIR__ . '/tmp/_compile.log'; diff --git a/tests/ContextInjectorTest.php b/tests/ContextInjectorTest.php index 7c8fdb4b..c7b29a69 100644 --- a/tests/ContextInjectorTest.php +++ b/tests/ContextInjectorTest.php @@ -33,9 +33,7 @@ public function testGetCompileInjector(): void $this->assertInstanceOf(FakeRobotInterface::class, $robot); } - /** - * @return array> - */ + /** @return array> */ public function contextProvider(): array { return [ @@ -44,9 +42,7 @@ public function contextProvider(): array ]; } - /** - * @dataProvider contextProvider - */ + /** @dataProvider contextProvider */ public function testContainerIsResetWhenTheInjectorIsRetrieved(AbstractInjectorContext $context): void { $injector = ContextInjector::getInstance($context); diff --git a/tests/DependencyCompilerTest.php b/tests/DependencyCompilerTest.php index 9b97443f..98f2cd39 100644 --- a/tests/DependencyCompilerTest.php +++ b/tests/DependencyCompilerTest.php @@ -20,6 +20,7 @@ class DependencyCompilerTest extends TestCase protected function setUp(): void { parent::setUp(); + deleteFiles(__DIR__ . '/tmp'); } diff --git a/tests/DevCache.php b/tests/DevCache.php index fd281dc4..be883c21 100644 --- a/tests/DevCache.php +++ b/tests/DevCache.php @@ -65,17 +65,13 @@ public function doDelete($id) return $this->cache->delete($id); } - /** - * @return ?array - */ + /** @return ?array */ public function doGetStats() { return $this->cache->getStats(); } - /** - * @return bool - */ + /** @return bool */ public function doFlush() { return true; diff --git a/tests/DiCompilerTest.php b/tests/DiCompilerTest.php index 2f4b57e4..3e263f0c 100644 --- a/tests/DiCompilerTest.php +++ b/tests/DiCompilerTest.php @@ -75,9 +75,7 @@ public function testAopCompile(): void $this->testAopCompileFile(); } - /** - * @depends testAopCompile - */ + /** @depends testAopCompile */ public function testAopCompileFile(): void { $script = new ScriptInjector(__DIR__ . '/tmp'); @@ -120,9 +118,7 @@ public function testDump(): void $this->assertFileExists(__DIR__ . '/tmp/graph/Ray_Compiler_FakeCarInterface-' . $any . '.html'); } - /** - * @return array|float|int|string|true|null)>> - */ + /** @return array|float|int|string|true|null)>> */ public function instanceProvider(): array { return [ diff --git a/tests/MultiBindingTest.php b/tests/MultiBindingTest.php index ee10c203..79a93abb 100644 --- a/tests/MultiBindingTest.php +++ b/tests/MultiBindingTest.php @@ -26,9 +26,7 @@ use function count; -/** - * @requires PHP 8.0 - */ +/** @requires PHP 8.0 */ class MultiBindingTest extends TestCase { /** @var InjectorInterface */ @@ -42,9 +40,7 @@ protected function setUp(): void }); } - /** - * @return Map - */ + /** @return Map */ public function testInjectMap(): Map { /** @var FakeMultiBindingConsumer $consumer */ diff --git a/tests/ScriptInjectorTest.php b/tests/ScriptInjectorTest.php index fe551044..bf74a641 100644 --- a/tests/ScriptInjectorTest.php +++ b/tests/ScriptInjectorTest.php @@ -39,9 +39,7 @@ public function testGetInstance(): FakeCar return $car; } - /** - * @depends testGetInstance - */ + /** @depends testGetInstance */ public function testDefaultValueInjected(FakeCar $car): void { $this->assertNull($car->null); diff --git a/vendor-bin/tools/composer.json b/vendor-bin/tools/composer.json index d7f79c14..a8325d82 100644 --- a/vendor-bin/tools/composer.json +++ b/vendor-bin/tools/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^12.0", "phpmd/phpmd": "^2.9", "phpmetrics/phpmetrics": "^2.7", "phpstan/phpstan": "^2.0", From 7e876a3a44638b283c1817d305047a21d0bb489d Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 11:08:54 +0900 Subject: [PATCH 13/24] Update vimeo/psalm ^5 --- src/CompileInjector.php | 5 +- src/FilePutContents.php | 3 +- src/InjectorFactory.php | 2 +- src/ScriptInjector.php | 14 +- tests/AssistedTest.php | 3 +- tests/Fake/Deep/FakeScriptInjectorContext.php | 2 + vendor-bin/tools/composer.json | 3 +- vendor-bin/tools/composer.lock | 2313 ++--------------- 8 files changed, 275 insertions(+), 2070 deletions(-) diff --git a/src/CompileInjector.php b/src/CompileInjector.php index 27e4e03d..3fd09307 100644 --- a/src/CompileInjector.php +++ b/src/CompileInjector.php @@ -120,10 +120,7 @@ public function __sleep() public function __wakeup() { - $this->__construct( - $this->scriptDir, - $this->lazyModule - ); + new self($this->scriptDir, $this->lazyModule); } /** diff --git a/src/FilePutContents.php b/src/FilePutContents.php index b0b018a1..d3337f51 100644 --- a/src/FilePutContents.php +++ b/src/FilePutContents.php @@ -9,6 +9,7 @@ use function dirname; use function file_put_contents; use function is_dir; +use function is_int; use function is_string; use function mkdir; use function rename; @@ -22,7 +23,7 @@ public function __invoke(string $filename, string $content): void $dir = dirname($filename); ! is_dir($dir) && mkdir($dir, 0777, true); $tmpFile = tempnam(dirname($filename), 'swap'); - if (is_string($tmpFile) && file_put_contents($tmpFile, $content) && @rename($tmpFile, $filename)) { + if (is_string($tmpFile) && is_int(file_put_contents($tmpFile, $content)) && @rename($tmpFile, $filename)) { return; } diff --git a/src/InjectorFactory.php b/src/InjectorFactory.php index 7b7e70ae..d68969c0 100644 --- a/src/InjectorFactory.php +++ b/src/InjectorFactory.php @@ -35,7 +35,7 @@ public static function getInstance(callable $modules, string $scriptDir): Inject } catch (Unbound $e) { } - if (! $isProd) { + if ($isProd === false) { return $rayInjector; } diff --git a/src/ScriptInjector.php b/src/ScriptInjector.php index 4a63034c..b9d8cd8b 100644 --- a/src/ScriptInjector.php +++ b/src/ScriptInjector.php @@ -25,6 +25,7 @@ use function glob; use function in_array; use function is_bool; +use function is_callable; use function is_dir; use function rmdir; use function rtrim; @@ -98,7 +99,7 @@ final class ScriptInjector implements ScriptInjectorInterface public function __construct($scriptDir, ?callable $lazyModule = null) { $this->scriptDir = $scriptDir; - $this->lazyModule = $lazyModule ?: static function (): NullModule { + $this->lazyModule = is_callable($lazyModule) ? $lazyModule : static /** @return NullModule */function (): NullModule { return new NullModule(); }; $this->registerLoader(); @@ -155,12 +156,9 @@ public function __sleep() public function __wakeup() { - $this->__construct( - $this->scriptDir, - function () { - return $this->getModule(); - } - ); + new self($this->scriptDir, function () { + return $this->getModule(); + }); } /** @@ -205,7 +203,7 @@ public function clear(): void public function isSingleton(string $dependencyIndex): bool { - if (! $this->container) { + if ($this->container !== null) { $module = $this->getModule(); /** @var AbstractModule $module */ $this->container = $module->getContainer()->getContainer(); diff --git a/tests/AssistedTest.php b/tests/AssistedTest.php index 334dd925..4165d63e 100644 --- a/tests/AssistedTest.php +++ b/tests/AssistedTest.php @@ -82,8 +82,7 @@ public function testAssistedCustomInject(): void { $assistedConsumer = (new Injector(new FakeAssistedDbModule(), __DIR__ . '/tmp'))->getInstance(FakeAssistedParamsConsumer::class); /** @var FakeAssistedParamsConsumer $assistedConsumer */ - [$id, $db] = $assistedConsumer->getUser(1); - /** @var FakeAbstractDb $db */ + [$id] = $assistedConsumer->getUser(1); $this->assertSame(1, $id); } } diff --git a/tests/Fake/Deep/FakeScriptInjectorContext.php b/tests/Fake/Deep/FakeScriptInjectorContext.php index 80c1bc24..04177039 100644 --- a/tests/Fake/Deep/FakeScriptInjectorContext.php +++ b/tests/Fake/Deep/FakeScriptInjectorContext.php @@ -30,10 +30,12 @@ protected function doContains($id) protected function doSave($id, $data, $lifeTime = 0) { + unset($id, $data,$lifeTime); } protected function doDelete($id) { + unset($id); } protected function doFlush() diff --git a/vendor-bin/tools/composer.json b/vendor-bin/tools/composer.json index a8325d82..e36ba11c 100644 --- a/vendor-bin/tools/composer.json +++ b/vendor-bin/tools/composer.json @@ -4,9 +4,8 @@ "phpmd/phpmd": "^2.9", "phpmetrics/phpmetrics": "^2.7", "phpstan/phpstan": "^2.0", - "psalm/plugin-phpunit": "^0.13", "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.2" + "vimeo/psalm": "^5.26" }, "config": { "allow-plugins": { diff --git a/vendor-bin/tools/composer.lock b/vendor-bin/tools/composer.lock index b25afad4..c2532d56 100644 --- a/vendor-bin/tools/composer.lock +++ b/vendor-bin/tools/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": "95e4521b6f0724da270b3b5de30e8f8a", + "content-hash": "e516f68b7fb2159413a4dbfe4fbc83f1", "packages": [], "packages-dev": [ { @@ -167,79 +167,6 @@ ], "time": "2024-04-13T18:00:56+00:00" }, - { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.5", - "source": { - "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" - }, - "replace": { - "ocramius/package-versions": "1.11.99" - }, - "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" - }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "PackageVersions\\": "src/PackageVersions" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" - }, - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" - } - ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", - "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" - }, - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "time": "2022-01-17T14:14:24+00:00" - }, { "name": "composer/pcre", "version": "3.3.2", @@ -468,35 +395,38 @@ }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.2", + "version": "v1.0.0", "source": { "type": "git", - "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" + "url": "https://github.com/PHPCSStandards/composer-installer.git", + "reference": "4be43904336affa5c2f70744a348312336afd0da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", - "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", + "reference": "4be43904336affa5c2f70744a348312336afd0da", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.3", + "php": ">=5.4", "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", + "ext-json": "*", + "ext-zip": "*", "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0" + "phpcompatibility/php-compatibility": "^9.0", + "yoast/phpunit-polyfills": "^1.0" }, "type": "composer-plugin", "extra": { - "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" }, "autoload": { "psr-4": { - "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -512,7 +442,7 @@ }, { "name": "Contributors", - "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" + "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -536,10 +466,10 @@ "tests" ], "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + "issues": "https://github.com/PHPCSStandards/composer-installer/issues", + "source": "https://github.com/PHPCSStandards/composer-installer" }, - "time": "2022-02-04T12:51:07+00:00" + "time": "2023-01-05T11:28:13+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -580,23 +510,23 @@ }, { "name": "doctrine/coding-standard", - "version": "9.0.2", + "version": "12.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/coding-standard.git", - "reference": "35a2452c6025cb739c3244b3348bcd1604df07d1" + "reference": "1b2b7dc58c68833af481fb9325c25abd40681c79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/35a2452c6025cb739c3244b3348bcd1604df07d1", - "reference": "35a2452c6025cb739c3244b3348bcd1604df07d1", + "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/1b2b7dc58c68833af481fb9325c25abd40681c79", + "reference": "1b2b7dc58c68833af481fb9325c25abd40681c79", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", - "php": "^7.1 || ^8.0", - "slevomat/coding-standard": "^7.0.0", - "squizlabs/php_codesniffer": "^3.6.0" + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0.0", + "php": "^7.2 || ^8.0", + "slevomat/coding-standard": "^8.11", + "squizlabs/php_codesniffer": "^3.7" }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -620,6 +550,7 @@ "code", "coding", "cs", + "dev", "doctrine", "rules", "sniffer", @@ -629,9 +560,9 @@ ], "support": { "issues": "https://github.com/doctrine/coding-standard/issues", - "source": "https://github.com/doctrine/coding-standard/tree/9.0.2" + "source": "https://github.com/doctrine/coding-standard/tree/12.0.0" }, - "time": "2021-04-12T15:11:14+00:00" + "time": "2023-04-24T17:43:28+00:00" }, { "name": "doctrine/deprecations", @@ -680,76 +611,6 @@ }, "time": "2024-01-30T19:34:25+00:00" }, - { - "name": "doctrine/instantiator", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "doctrine/coding-standard": "^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/2.0.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:23:10+00:00" - }, { "name": "felixfbecker/advanced-json-rpc", "version": "v3.2.1", @@ -852,64 +713,65 @@ "time": "2024-04-30T00:40:11+00:00" }, { - "name": "myclabs/deep-copy", - "version": "1.12.1", + "name": "fidry/cpu-core-counter", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3 <3.2.2" + "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpspec/prophecy": "^1.10", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "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": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" }, "type": "library", "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], "psr-4": { - "DeepCopy\\": "src/DeepCopy/" + "Fidry\\CpuCoreCounter\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Create deep copies (clones) of your objects", + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" + "CPU", + "core" ], "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" + "url": "https://github.com/theofidry", + "type": "github" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { "name": "netresearch/jsonmapper", @@ -1018,59 +880,6 @@ }, "time": "2024-09-29T15:01:53+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": "pdepend/pdepend", "version": "2.16.2", @@ -1134,124 +943,6 @@ ], "time": "2023-12-17T18:09:59+00:00" }, - { - "name": "phar-io/manifest", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "54750ef60c58e43759730615a392c31c80e23176" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", - "reference": "54750ef60c58e43759730615a392c31c80e23176", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2024-03-03T12:33:53+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -1684,557 +1375,79 @@ "time": "2024-11-17T14:17:00+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "9.2.32", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", - "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-libxml": "*", - "ext-xmlwriter": "*", - "nikic/php-parser": "^4.19.1 || ^5.1.0", - "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-text-template": "^2.0.4", - "sebastian/code-unit-reverse-lookup": "^2.0.3", - "sebastian/complexity": "^2.0.3", - "sebastian/environment": "^5.1.5", - "sebastian/lines-of-code": "^1.0.4", - "sebastian/version": "^3.0.2", - "theseer/tokenizer": "^1.2.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.6" - }, - "suggest": { - "ext-pcov": "PHP extension that provides line coverage", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "php": ">=7.4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "9.2.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "Psr\\Container\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-08-22T04:23:01+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "3.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:48:52+00:00" - }, - { - "name": "phpunit/php-invoker", - "version": "3.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "ext-pcntl": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-pcntl": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Invoke callables with a timeout", - "homepage": "https://github.com/sebastianbergmann/php-invoker/", - "keywords": [ - "process" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-invoker/issues", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:58:55+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T05:33:50+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "5.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" ], "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:16:10+00:00" + "time": "2021-11-05T16:47:00+00:00" }, { - "name": "phpunit/phpunit", - "version": "9.6.21", + "name": "psr/log", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.5.0 || ^2", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", - "phar-io/manifest": "^2.0.4", - "phar-io/version": "^3.2.1", - "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.32", - "phpunit/php-file-iterator": "^3.0.6", - "phpunit/php-invoker": "^3.1.1", - "phpunit/php-text-template": "^2.0.4", - "phpunit/php-timer": "^5.0.3", - "sebastian/cli-parser": "^1.0.2", - "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.8", - "sebastian/diff": "^4.0.6", - "sebastian/environment": "^5.1.5", - "sebastian/exporter": "^4.0.6", - "sebastian/global-state": "^5.0.7", - "sebastian/object-enumerator": "^4.0.4", - "sebastian/resource-operations": "^3.0.4", - "sebastian/type": "^3.2.1", - "sebastian/version": "^3.0.2" - }, - "suggest": { - "ext-soap": "To be able to generate mocks based on WSDL files", - "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + "php": ">=8.0.0" }, - "bin": [ - "phpunit" - ], "type": "library", "extra": { "branch-alias": { - "dev-master": "9.6-dev" - } - }, - "autoload": { - "files": [ - "src/Framework/Assert/Functions.php" - ], - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "time": "2024-09-19T10:50:18+00:00" - }, - { - "name": "psalm/plugin-phpunit", - "version": "0.13.0", - "source": { - "type": "git", - "url": "https://github.com/psalm/psalm-plugin-phpunit.git", - "reference": "e006914489f3e445f5cb786ea6f3df89ea30129b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/e006914489f3e445f5cb786ea6f3df89ea30129b", - "reference": "e006914489f3e445f5cb786ea6f3df89ea30129b", - "shasum": "" - }, - "require": { - "composer/package-versions-deprecated": "^1.10", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "ext-simplexml": "*", - "php": "^7.3 || ^8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", - "vimeo/psalm": "dev-master || dev-4.x || ^4.0" - }, - "require-dev": { - "codeception/codeception": "^4.0.3", - "squizlabs/php_codesniffer": "^3.3.1", - "weirdan/codeception-psalm-module": "^0.7.1", - "weirdan/prophecy-shim": "^1.0 || ^2.0" - }, - "type": "psalm-plugin", - "extra": { - "psalm": { - "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin" - } - }, - "autoload": { - "psr-4": { - "Psalm\\PhpUnitPlugin\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Matt Brown", - "email": "github@muglug.com" - } - ], - "description": "Psalm plugin for PHPUnit", - "support": { - "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", - "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.13.0" - }, - "time": "2020-10-19T12:43:17+00:00" - }, - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "psr/log", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { @@ -2244,904 +1457,51 @@ }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ], - "support": { - "source": "https://github.com/php-fig/log/tree/3.0.2" - }, - "time": "2024-09-11T13:17:53+00:00" - }, - { - "name": "sebastian/cli-parser", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for parsing CLI options", - "homepage": "https://github.com/sebastianbergmann/cli-parser", - "support": { - "issues": "https://github.com/sebastianbergmann/cli-parser/issues", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:27:43+00:00" - }, - { - "name": "sebastian/code-unit", - "version": "1.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", - "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the PHP code units", - "homepage": "https://github.com/sebastianbergmann/code-unit", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit/issues", - "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:08:54+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-09-28T05:30:19+00:00" - }, - { - "name": "sebastian/comparator", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", - "reference": "fa0f136dd2334583309d32b62544682ee972b51a", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/diff": "^4.0", - "sebastian/exporter": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:41:17+00:00" - }, - { - "name": "sebastian/complexity", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", - "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for calculating the complexity of PHP code units", - "homepage": "https://github.com/sebastianbergmann/complexity", - "support": { - "issues": "https://github.com/sebastianbergmann/complexity/issues", - "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T06:19:30+00:00" - }, - { - "name": "sebastian/diff", - "version": "4.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:30:58+00:00" - }, - { - "name": "sebastian/environment", - "version": "5.1.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:03:51+00:00" - }, - { - "name": "sebastian/exporter", - "version": "4.0.6", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", - "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "https://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:33:00+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.7", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^9.3" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-02T06:35:11+00:00" - }, - { - "name": "sebastian/lines-of-code", - "version": "1.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", - "shasum": "" - }, - "require": { - "nikic/php-parser": "^4.18 || ^5.0", - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library for counting the lines of code in PHP source code", - "homepage": "https://github.com/sebastianbergmann/lines-of-code", - "support": { - "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-12-22T06:20:34+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", - "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", - "shasum": "" - }, - "require": { - "php": ">=7.3", - "sebastian/object-reflector": "^2.0", - "sebastian/recursion-context": "^4.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:12:34+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-10-26T13:14:26+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "4.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "https://github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2023-02-03T06:07:39+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", - "shasum": "" - }, - "require": { - "php": ">=7.3" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], "support": { - "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + "source": "https://github.com/php-fig/log/tree/3.0.2" }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2024-03-14T16:00:52+00:00" + "time": "2024-09-11T13:17:53+00:00" }, { - "name": "sebastian/type", - "version": "3.2.1", + "name": "sebastian/diff", + "version": "6.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", - "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.2-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -3156,15 +1516,25 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -3172,121 +1542,140 @@ "type": "github" } ], - "time": "2023-02-03T06:13:03+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { - "name": "sebastian/version", - "version": "3.0.2", + "name": "slevomat/coding-standard", + "version": "8.15.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "c6c1022351a901512170118436c764e473f6de8c" + "url": "https://github.com/slevomat/coding-standard.git", + "reference": "7d1d957421618a3803b593ec31ace470177d7817" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", - "reference": "c6c1022351a901512170118436c764e473f6de8c", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817", + "reference": "7d1d957421618a3803b593ec31ace470177d7817", "shasum": "" }, "require": { - "php": ">=7.3" + "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", + "php": "^7.2 || ^8.0", + "phpstan/phpdoc-parser": "^1.23.1", + "squizlabs/php_codesniffer": "^3.9.0" }, - "type": "library", + "require-dev": { + "phing/phing": "2.17.4", + "php-parallel-lint/php-parallel-lint": "1.3.2", + "phpstan/phpstan": "1.10.60", + "phpstan/phpstan-deprecation-rules": "1.1.4", + "phpstan/phpstan-phpunit": "1.3.16", + "phpstan/phpstan-strict-rules": "1.5.2", + "phpunit/phpunit": "8.5.21|9.6.8|10.5.11" + }, + "type": "phpcodesniffer-standard", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "8.x-dev" } }, "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "SlevomatCodingStandard\\": "SlevomatCodingStandard/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } + "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "keywords": [ + "dev", + "phpcs" ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + "issues": "https://github.com/slevomat/coding-standard/issues", + "source": "https://github.com/slevomat/coding-standard/tree/8.15.0" }, "funding": [ { - "url": "https://github.com/sebastianbergmann", + "url": "https://github.com/kukulich", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", + "type": "tidelift" } ], - "time": "2020-09-28T06:39:44+00:00" + "time": "2024-03-09T15:20:58+00:00" }, { - "name": "slevomat/coding-standard", - "version": "7.2.1", + "name": "spatie/array-to-xml", + "version": "3.3.0", "source": { "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "aff06ae7a84e4534bf6f821dc982a93a5d477c90" + "url": "https://github.com/spatie/array-to-xml.git", + "reference": "f56b220fe2db1ade4c88098d83413ebdfc3bf876" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/aff06ae7a84e4534bf6f821dc982a93a5d477c90", - "reference": "aff06ae7a84e4534bf6f821dc982a93a5d477c90", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/f56b220fe2db1ade4c88098d83413ebdfc3bf876", + "reference": "f56b220fe2db1ade4c88098d83413ebdfc3bf876", "shasum": "" }, "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.5.1", - "squizlabs/php_codesniffer": "^3.6.2" + "ext-dom": "*", + "php": "^8.0" }, "require-dev": { - "phing/phing": "2.17.3", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.7.1", - "phpstan/phpstan-deprecation-rules": "1.0.0", - "phpstan/phpstan-phpunit": "1.0.0|1.1.1", - "phpstan/phpstan-strict-rules": "1.2.3", - "phpunit/phpunit": "7.5.20|8.5.21|9.5.20" + "mockery/mockery": "^1.2", + "pestphp/pest": "^1.21", + "spatie/pest-plugin-snapshots": "^1.1" }, - "type": "phpcodesniffer-standard", + "type": "library", "extra": { "branch-alias": { - "dev-master": "7.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard" + "Spatie\\ArrayToXml\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", + "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": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/7.2.1" + "source": "https://github.com/spatie/array-to-xml/tree/3.3.0" }, "funding": [ { - "url": "https://github.com/kukulich", - "type": "github" + "url": "https://spatie.be/open-source/support-us", + "type": "custom" }, { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", - "type": "tidelift" + "url": "https://github.com/spatie", + "type": "github" } ], - "time": "2022-05-25T10:58:12+00:00" + "time": "2024-05-01T10:20:27+00:00" }, { "name": "squizlabs/php_codesniffer", @@ -3445,47 +1834,46 @@ }, { "name": "symfony/console", - "version": "v6.4.15", + "version": "v7.1.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd" + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "url": "https://api.github.com/repos/symfony/console/zipball/ff04e5b5ba043d2badfb308197b9e6b42883fcd5", + "reference": "ff04e5b5ba043d2badfb308197b9e6b42883fcd5", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", "symfony/service-contracts": "^2.5|^3", - "symfony/string": "^5.4|^6.0|^7.0" + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", "symfony/http-foundation": "^6.4|^7.0", "symfony/http-kernel": "^6.4|^7.0", - "symfony/lock": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/process": "^5.4|^6.0|^7.0", - "symfony/stopwatch": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -3519,7 +1907,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.15" + "source": "https://github.com/symfony/console/tree/v7.1.8" }, "funding": [ { @@ -3535,7 +1923,7 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2024-11-06T14:23:19+00:00" }, { "name": "symfony/dependency-injection", @@ -4068,86 +2456,6 @@ ], "time": "2024-09-09T11:45:10+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.31.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" - }, - "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": "2024-09-09T11:45:10+00:00" - }, { "name": "symfony/service-contracts", "version": "v3.5.0", @@ -4394,76 +2702,26 @@ ], "time": "2024-09-25T14:20:29+00:00" }, - { - "name": "theseer/tokenizer", - "version": "1.2.3", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.3" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2024-03-03T12:36:25+00:00" - }, { "name": "vimeo/psalm", - "version": "4.30.0", + "version": "5.26.1", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" + "reference": "d747f6500b38ac4f7dfc5edbcae6e4b637d7add0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/d747f6500b38ac4f7dfc5edbcae6e4b637d7add0", + "reference": "d747f6500b38ac4f7dfc5edbcae6e4b637d7add0", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", + "composer-runtime-api": "^2", "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": "*", @@ -4472,35 +2730,38 @@ "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.1 || ^0.5.1 || ^1.0.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" + "nikic/php-parser": "^4.17", + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0", + "spatie/array-to-xml": "^2.17.0 || ^3.0", + "symfony/console": "^4.1.6 || ^5.0 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0" + }, + "conflict": { + "nikic/php-parser": "4.17.0" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", + "amphp/phpunit-util": "^2.0", + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.9", "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.6", + "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 || ^7.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -4513,20 +2774,17 @@ "psalm-refactor", "psalter" ], - "type": "library", + "type": "project", "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/" } @@ -4544,13 +2802,15 @@ "keywords": [ "code", "inspection", - "php" + "php", + "static analysis" ], "support": { + "docs": "https://psalm.dev/docs", "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.30.0" + "source": "https://github.com/vimeo/psalm" }, - "time": "2022-11-06T20:37:08+00:00" + "time": "2024-09-08T18:53:08+00:00" }, { "name": "webmozart/assert", @@ -4609,57 +2869,6 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+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 273e02e0efe510eb7b19a591184227edc064862d Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 11:23:27 +0900 Subject: [PATCH 14/24] Suppress PHPStan false-positive in test assertions Added comments to clarify the purpose of assertions and ignored lines in `testDomainException`. This ensures that PHPStan does not produce false-positive errors and maintains code clarity for future maintenance. --- tests/DependencyCompilerTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/DependencyCompilerTest.php b/tests/DependencyCompilerTest.php index 98f2cd39..be9c852b 100644 --- a/tests/DependencyCompilerTest.php +++ b/tests/DependencyCompilerTest.php @@ -143,9 +143,10 @@ public function testDependencyObjectInstanceCompile(): void public function testDomainException(): void { $this->expectException(DomainException::class); - assert(class_exists(FakeInvalidDependency::class)); + assert(class_exists(FakeInvalidDependency::class)); // to suppress phpstan false-positive $fake = new FakeInvalidDependency(); assert($fake instanceof DependencyInterface); // @phpstan-ignore-line + // FakeInvalidDependency is not a valid dependency, so the DomainException is thrown. (new DependencyCode(new Container()))->getCode($fake); } From 0223bea698be6cc7d1426c656f4a82ed877db60d Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 12:45:30 +0900 Subject: [PATCH 15/24] fixup! Update doctrine coding standard v12 --- src/ScriptInjector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ScriptInjector.php b/src/ScriptInjector.php index b9d8cd8b..61e9c5d7 100644 --- a/src/ScriptInjector.php +++ b/src/ScriptInjector.php @@ -203,7 +203,7 @@ public function clear(): void public function isSingleton(string $dependencyIndex): bool { - if ($this->container !== null) { + if ($this->container === null) { $module = $this->getModule(); /** @var AbstractModule $module */ $this->container = $module->getContainer()->getContainer(); From 6ef18b883ebebb05a8fba138663ae71f15942645 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 13:01:17 +0900 Subject: [PATCH 16/24] Refactor initialization and add file existence checks Refactor `ScriptInjector` initialization logic by introducing an `init` method, improving clarity and reusability. Added assertions to check file existence before requiring instance files, enhancing robustness and error handling. Updated `__wakeup` method to use the new `init` method. --- src/ScriptInjector.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/ScriptInjector.php b/src/ScriptInjector.php index 61e9c5d7..a0f96bc4 100644 --- a/src/ScriptInjector.php +++ b/src/ScriptInjector.php @@ -97,6 +97,12 @@ final class ScriptInjector implements ScriptInjectorInterface * @psalm-suppress UnresolvableInclude */ public function __construct($scriptDir, ?callable $lazyModule = null) + { + $this->init($scriptDir, $lazyModule); + } + + /** @param ScriptDir $scriptDir */ + private function init(string $scriptDir, ?callable $lazyModule): void { $this->scriptDir = $scriptDir; $this->lazyModule = is_callable($lazyModule) ? $lazyModule : static /** @return NullModule */function (): NullModule { @@ -113,7 +119,10 @@ function (string $dependencyIndex, array $injectionPoint = ['', '', '']) { $this->ip = $injectionPoint; // @phpstan-ignore-line [$prototype, $singleton, $injectionPoint, $injector] = $this->functions; - return require $this->getInstanceFile($dependencyIndex); + $instanceFile = $this->getInstanceFile($dependencyIndex); + assert(file_exists($instanceFile), "File not found: {$instanceFile}"); + + return require $instanceFile; }; $singleton = /** @@ -128,8 +137,10 @@ function (string $dependencyIndex, $injectionPoint = ['', '', '']) { $this->ip = $injectionPoint; [$prototype, $singleton, $injectionPoint, $injector] = $this->functions; + $instanceFile = $this->getInstanceFile($dependencyIndex); + assert(file_exists($instanceFile), "File not found: {$instanceFile}"); - $instance = require $this->getInstanceFile($dependencyIndex); + $instance = require $instanceFile; $this->singletons[$dependencyIndex] = $instance; return $instance; @@ -156,7 +167,7 @@ public function __sleep() public function __wakeup() { - new self($this->scriptDir, function () { + $this->init($this->scriptDir, function () { return $this->getModule(); }); } @@ -174,6 +185,8 @@ public function getInstance($interface, $name = Name::ANY) } [$prototype, $singleton, $injectionPoint, $injector] = $this->functions; + /** @psalm-suppress RedundantConditionGivenDocblockType */ // assert for serialization + assert(is_callable($prototype), 'prototype is not callable'); // @phpstan-ignore-line /** @psalm-suppress UnresolvableInclude */ $instance = require $this->getInstanceFile($dependencyIndex); /** @psalm-suppress UndefinedVariable */ From ba56a35a3af029a8af7ceddde495379adc5e1ef6 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 13:02:09 +0900 Subject: [PATCH 17/24] Update type hint for $ip variable and injection point Changed the type hint of the $ip variable and the injection point parameter from an array to Ip. This improves type safety and code clarity. --- src/ScriptInjector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ScriptInjector.php b/src/ScriptInjector.php index a0f96bc4..a251cf1f 100644 --- a/src/ScriptInjector.php +++ b/src/ScriptInjector.php @@ -61,7 +61,7 @@ final class ScriptInjector implements ScriptInjectorInterface * * [$class, $method, $parameter] * - * @var array{0: string, 1: string, 2: string} + * @var Ip */ private $ip = ['', '', '']; @@ -111,7 +111,7 @@ private function init(string $scriptDir, ?callable $lazyModule): void $this->registerLoader(); $prototype = /** - * @param array{0: string, 1: string, 2: string} $injectionPoint + * @param Ip $injectionPoint * * @return mixed */ From bdfec2ca4bc349ba6480474af677751f2d05cb6c Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 13:19:54 +0900 Subject: [PATCH 18/24] Refactor CompileInjector for better type safety Introduce stricter type definitions and refactor code to use more explicit types. Added `init` method for initialization logic, ensuring better separation of concerns and enhancing readability. Replaced direct `require` calls with assertions to improve debugging and error handling. --- src/CompileInjector.php | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/CompileInjector.php b/src/CompileInjector.php index 3fd09307..0b073c6e 100644 --- a/src/CompileInjector.php +++ b/src/CompileInjector.php @@ -10,6 +10,7 @@ use Ray\Di\Name; use ReflectionParameter; +use function assert; use function file_exists; use function in_array; use function rtrim; @@ -19,8 +20,15 @@ use function touch; /** + * Compile Injector + * + * This injector will compile all bindings into PHP's low-code if they have not already been compiled. + * Once compiled, unknown concrete classes will not be compiled at runtime like ScriptInjector. + * All bindings must be explicitly pre-compiled. + * * @psalm-type ScriptDir = non-empty-string * @psalm-type Ip = array{0: string, 1: string, 2: string} + * @psalm-type Singletons = array */ final class CompileInjector implements ScriptInjectorInterface { @@ -42,7 +50,7 @@ final class CompileInjector implements ScriptInjectorInterface /** * Singleton instance container * - * @var array + * @var Singletons */ private $singletons = []; @@ -61,7 +69,13 @@ final class CompileInjector implements ScriptInjectorInterface * * @psalm-suppress UnresolvableInclude */ - public function __construct($scriptDir, LazyModuleInterface $lazyModule) + public function __construct(string $scriptDir, LazyModuleInterface $lazyModule) + { + $this->init($scriptDir, $lazyModule); + } + + /** @param ScriptDir $scriptDir */ + public function init(string $scriptDir, LazyModuleInterface $lazyModule): void { /** @var ScriptDir $scriptDir */ $scriptDir = rtrim($scriptDir, '/'); @@ -77,8 +91,10 @@ public function __construct($scriptDir, LazyModuleInterface $lazyModule) function (string $dependencyIndex, array $injectionPoint = ['', '', '']) { $this->ip = $injectionPoint; // @phpstan-ignore-line [$prototype, $singleton, $injectionPoint, $injector] = $this->functions; + $instancFile = $this->getInstanceFile($dependencyIndex); + assert(file_exists($instancFile), new Unbound($dependencyIndex)); - return require $this->getInstanceFile($dependencyIndex); + return require $instancFile; }; $singleton = /** @@ -94,8 +110,10 @@ function (string $dependencyIndex, array $injectionPoint = ['', '', '']) { $this->ip = $injectionPoint; // @phpstan-ignore-line [$prototype, $singleton, $injectionPoint, $injector] = $this->functions; + $instanceFile = $this->getInstanceFile($dependencyIndex); + assert(file_exists($instanceFile), new Unbound($dependencyIndex)); /** @var object $instance */ - $instance = require $this->getInstanceFile($dependencyIndex); + $instance = require $instanceFile; $this->singletons[$dependencyIndex] = $instance; return $instance; @@ -120,7 +138,7 @@ public function __sleep() public function __wakeup() { - new self($this->scriptDir, $this->lazyModule); + $this->init($this->scriptDir, $this->lazyModule); } /** From ba4bd91ff00cf87d6b5547bd4f0f961c10440c35 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 13:44:45 +0900 Subject: [PATCH 19/24] Add injection point and injector type annotations This commit introduces new type annotations for injection points and injectors using callable types. These changes enhance type safety and improve code clarity, aiding both static analysis tools and developers in understanding the expected types. --- src/CompileInjector.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/CompileInjector.php b/src/CompileInjector.php index 0b073c6e..6a105464 100644 --- a/src/CompileInjector.php +++ b/src/CompileInjector.php @@ -7,6 +7,7 @@ use Ray\Compiler\Exception\Unbound; use Ray\Di\Annotation\ScriptDir; use Ray\Di\Bind; +use Ray\Di\InjectorInterface; use Ray\Di\Name; use ReflectionParameter; @@ -29,8 +30,14 @@ * @psalm-type ScriptDir = non-empty-string * @psalm-type Ip = array{0: string, 1: string, 2: string} * @psalm-type Singletons = array + * @psalm-type Prottype = callable(string, Ip): mixed + * @psalm-type Singleton = callable(string, Ip): mixed + * @psalm-type InjectionPoint = callable(): InjectionPoint + * @psalm-type Injector = callable(): InjectorInterface + * @psalm-type InstanceFunctions = array{0: Prottype, 1: Singleton, 2: InjectionPoint, 3: Injector} + * @psalm-type ScriptDirs = list */ -final class CompileInjector implements ScriptInjectorInterface +final class CompileInjector implements ScriptInjectorInterface // @phpstan-ignore-line { public const INSTANCE = '%s/%s.php'; public const COMPILE_CHECK = '%s/compiled'; @@ -54,13 +61,13 @@ final class CompileInjector implements ScriptInjectorInterface */ private $singletons = []; - /** @var array */ - private $functions; + /** @var InstanceFunctions */ + private $functions; // @phpstan-ignore-line /** @var LazyModuleInterface */ private $lazyModule; - /** @var array */ + /** @var ScriptDirs */ private static $scriptDirs = []; /** From 0165a59768569e4bfd0284a32a7a9e54fe4d5b62 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 13:51:43 +0900 Subject: [PATCH 20/24] Remove unnecessary unset statements in test files Eliminated redundant unset statements from multiple test files to improve code clarity and maintainability. Adjusted a script command in composer.json to reflect these changes. --- composer.json | 2 +- tests/Fake/Assisted/FakeAssistedConsumer.php | 4 ---- tests/Fake/Assisted/FakeAssistedInjectConsumer.php | 4 ---- tests/Fake/Deep/FakeScriptInjectorContext.php | 3 --- tests/Fake/FakeCar3.php | 1 - tests/Fake/FakeInvalidDependency.php | 3 --- tests/MultiBindingTest.php | 1 - 7 files changed, 1 insertion(+), 17 deletions(-) diff --git a/composer.json b/composer.json index c2b05497..b40b03da 100644 --- a/composer.json +++ b/composer.json @@ -55,7 +55,7 @@ "clean": ["phpstan clear-result-cache", "psalm --clear-cache", "rm -rf tests/tmp/*.php"], "sa": ["psalm --show-info=false", "phpstan analyse -c phpstan.neon --no-progress"], "metrics": ["@test", "phpmetrics --report-html=build/metrics --exclude=Exception --log-junit=build/junit.xml --junit=build/junit.xml src"], - "phpmd": ["phpmd src/di text ./phpmd.xml"], + "phpmd": ["phpmd src text ./phpmd.xml"], "build": ["@cs", "@sa", "@pcov", "@metrics"] }, "extra": { diff --git a/tests/Fake/Assisted/FakeAssistedConsumer.php b/tests/Fake/Assisted/FakeAssistedConsumer.php index 4656188a..be428bb0 100644 --- a/tests/Fake/Assisted/FakeAssistedConsumer.php +++ b/tests/Fake/Assisted/FakeAssistedConsumer.php @@ -16,8 +16,6 @@ class FakeAssistedConsumer */ public function assistOne($a, $b, ?FakeRobotInterface $robot = null) { - unset($a, $b); - return $robot; } @@ -27,8 +25,6 @@ public function assistOne($a, $b, ?FakeRobotInterface $robot = null) */ public function assistWithName($a, $var1 = null) { - unset($a); - return $var1; } diff --git a/tests/Fake/Assisted/FakeAssistedInjectConsumer.php b/tests/Fake/Assisted/FakeAssistedInjectConsumer.php index 19c05cf1..b943b077 100644 --- a/tests/Fake/Assisted/FakeAssistedInjectConsumer.php +++ b/tests/Fake/Assisted/FakeAssistedInjectConsumer.php @@ -13,15 +13,11 @@ class FakeAssistedInjectConsumer { public function assistOne($a, $b, #[Assisted] ?\Ray\Compiler\FakeRobotInterface $robot = null): ?\Ray\Compiler\FakeRobotInterface { - unset($a, $b); - return $robot; } public function assistWithName($a, #[Assisted, Named('one')] $var1 = null) { - unset($a); - return $var1; } diff --git a/tests/Fake/Deep/FakeScriptInjectorContext.php b/tests/Fake/Deep/FakeScriptInjectorContext.php index 04177039..be54a321 100644 --- a/tests/Fake/Deep/FakeScriptInjectorContext.php +++ b/tests/Fake/Deep/FakeScriptInjectorContext.php @@ -25,17 +25,14 @@ protected function doFetch($id) protected function doContains($id) { - unset($id); } protected function doSave($id, $data, $lifeTime = 0) { - unset($id, $data,$lifeTime); } protected function doDelete($id) { - unset($id); } protected function doFlush() diff --git a/tests/Fake/FakeCar3.php b/tests/Fake/FakeCar3.php index 3f71a5e6..05f71901 100644 --- a/tests/Fake/FakeCar3.php +++ b/tests/Fake/FakeCar3.php @@ -10,6 +10,5 @@ class FakeCar3 { public function __construct(DateTimeImmutable $dateTime) { - unset($dateTime); } } diff --git a/tests/Fake/FakeInvalidDependency.php b/tests/Fake/FakeInvalidDependency.php index 3dd3dbdb..8c3fbc1c 100644 --- a/tests/Fake/FakeInvalidDependency.php +++ b/tests/Fake/FakeInvalidDependency.php @@ -12,17 +12,14 @@ class FakeInvalidDependency implements DependencyInterface { public function inject(Container $container) { - unset($container); } public function register(array &$container, Bind $bind) { - unset($container, $bind); } public function setScope($scope) { - unset($scope); } public function __toString() diff --git a/tests/MultiBindingTest.php b/tests/MultiBindingTest.php index 79a93abb..c6e5bca1 100644 --- a/tests/MultiBindingTest.php +++ b/tests/MultiBindingTest.php @@ -103,7 +103,6 @@ public function testOffsetSet(Map $map): void public function testOffsetUnset(Map $map): void { $this->expectException(LogicException::class); - unset($map['one']); } public function testAnotherBinder(): void From 9aa4f765ffa079e62827b252afdc0d5e71e82233 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 13:53:27 +0900 Subject: [PATCH 21/24] fixup! Update PHP versions in CI workflow --- .github/workflows/continuous-integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7caae620..2ffa22ca 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -11,4 +11,3 @@ jobs: with: old_stable: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]' current_stable: 8.4 -c From 0d0db43d8aa137520340f6750e11bf9056aede26 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 15:21:15 +0900 Subject: [PATCH 22/24] fixup! Remove unnecessary unset statements in test files --- tests/MultiBindingTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/MultiBindingTest.php b/tests/MultiBindingTest.php index c6e5bca1..79a93abb 100644 --- a/tests/MultiBindingTest.php +++ b/tests/MultiBindingTest.php @@ -103,6 +103,7 @@ public function testOffsetSet(Map $map): void public function testOffsetUnset(Map $map): void { $this->expectException(LogicException::class); + unset($map['one']); } public function testAnotherBinder(): void From d5c706ca0eb8254d703902368ca0b11d53483a0c Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 15:37:17 +0900 Subject: [PATCH 23/24] Normalize line endings in test assertions for Windows platform Refactor test assertions to use a helper method for normalizing line endings. This ensures consistency across different operating systems and prevents test failures due to line ending discrepancies. --- tests/DependencyCompilerTest.php | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/tests/DependencyCompilerTest.php b/tests/DependencyCompilerTest.php index be9c852b..7d497915 100644 --- a/tests/DependencyCompilerTest.php +++ b/tests/DependencyCompilerTest.php @@ -33,7 +33,7 @@ public function testInstanceCompileString(): void return 'bear'; EOT; - $this->assertSame($expected, (string) $code); + $this->assertSame($this->normalizeLineEndings($expected), (string) $code); } public function testInstanceCompileInt(): void @@ -45,7 +45,7 @@ public function testInstanceCompileInt(): void return 1; EOT; - $this->assertSame($expected, (string) $code); + $this->assertSame($this->normalizeLineEndings($expected), (string) $code); } public function testInstanceCompileArray(): void @@ -58,8 +58,8 @@ public function testInstanceCompileArray(): void return array(1, 2, 3); EOT; $this->assertContains((string) $code, [ - str_replace('array(1, 2, 3)', '[1, 2, 3]', $expected), - $expected, + str_replace('array(1, 2, 3)', '[1, 2, 3]', $this->normalizeLineEndings($expected)), + $this->normalizeLineEndings($expected), ]); } @@ -88,9 +88,9 @@ public function testDependencyCompile(): void str_replace( 'array(\'Ray\\Compiler\\FakeCar\', \'setHandle\', \'handle\')', '[\'Ray\\Compiler\\FakeCar\', \'setHandle\', \'handle\']', - str_replace('\\\\', '\\', $expected) + str_replace('\\\\', '\\', $this->normalizeLineEndings($expected)) ), - $expected, + $this->normalizeLineEndings($expected), ]); } @@ -108,7 +108,7 @@ public function testDependencyProviderCompile(): void $isSingleton = false; return $instance->get(); EOT; - $this->assertSame($expected, (string) $code); + $this->assertSame($this->normalizeLineEndings($expected), (string) $code); } public function testDependencyInstanceCompile(): void @@ -121,7 +121,7 @@ public function testDependencyInstanceCompile(): void return 'momo'; EOT; - $this->assertSame($expected, (string) $code); + $this->assertSame($this->normalizeLineEndings($expected), (string) $code); } public function testDependencyObjectInstanceCompile(): void @@ -135,8 +135,8 @@ public function testDependencyObjectInstanceCompile(): void return unserialize('O:23:"Ray\\Compiler\\FakeEngine":0:{}'); EOT; $this->assertContains((string) $code, [ - str_replace('\\\\', '\\', $expected), - $expected, + str_replace('\\\\', '\\', $this->normalizeLineEndings($expected)), + $this->normalizeLineEndings($expected), ]); } @@ -165,6 +165,12 @@ public function testContextualProviderCompile(): void $isSingleton = false; return $instance->get(); EOT; - $this->assertSame($expected, (string) $code); + $this->assertSame($this->normalizeLineEndings($expected), (string) $code); + } + + private function normalizeLineEndings($content): string + { + // Convert Windows (CRLF: \r\n) and old Mac (CR: \r) to Unix (LF: \n) + return str_replace(["\r\n", "\r"], "\n", $content); } } From df0fe4fcca750e4e59ae75ed16a7e717936b58e4 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Wed, 27 Nov 2024 16:02:24 +0900 Subject: [PATCH 24/24] Refactor: ensure consistent line ending normalization Updated tests to consistently normalize line endings before performing assertions. This improves code readability and ensures uniform assertion practices across all test cases. --- tests/DependencyCompilerTest.php | 46 ++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/tests/DependencyCompilerTest.php b/tests/DependencyCompilerTest.php index 7d497915..725ec7a3 100644 --- a/tests/DependencyCompilerTest.php +++ b/tests/DependencyCompilerTest.php @@ -33,7 +33,10 @@ public function testInstanceCompileString(): void return 'bear'; EOT; - $this->assertSame($this->normalizeLineEndings($expected), (string) $code); + $this->assertSame( + $this->normalizeLineEndings($expected), + $this->normalizeLineEndings((string) $code) + ); } public function testInstanceCompileInt(): void @@ -45,7 +48,10 @@ public function testInstanceCompileInt(): void return 1; EOT; - $this->assertSame($this->normalizeLineEndings($expected), (string) $code); + $this->assertSame( + $this->normalizeLineEndings($expected), + $this->normalizeLineEndings((string) $code) + ); } public function testInstanceCompileArray(): void @@ -57,8 +63,9 @@ public function testInstanceCompileArray(): void return array(1, 2, 3); EOT; - $this->assertContains((string) $code, [ - str_replace('array(1, 2, 3)', '[1, 2, 3]', $this->normalizeLineEndings($expected)), + $normalizedCode = $this->normalizeLineEndings((string) $code); + $this->assertContains($normalizedCode, [ + $this->normalizeLineEndings(str_replace('array(1, 2, 3)', '[1, 2, 3]', $expected)), $this->normalizeLineEndings($expected), ]); } @@ -84,12 +91,13 @@ public function testDependencyCompile(): void return $instance; EOT; $expected = str_replace('{ANY}', Name::ANY, $expectedTemplate); - $this->assertContains((string) $code, [ - str_replace( + $normalizedCode = $this->normalizeLineEndings((string) $code); + $this->assertContains($normalizedCode, [ + $this->normalizeLineEndings(str_replace( 'array(\'Ray\\Compiler\\FakeCar\', \'setHandle\', \'handle\')', '[\'Ray\\Compiler\\FakeCar\', \'setHandle\', \'handle\']', - str_replace('\\\\', '\\', $this->normalizeLineEndings($expected)) - ), + str_replace('\\\\', '\\', $expected) + )), $this->normalizeLineEndings($expected), ]); } @@ -108,7 +116,10 @@ public function testDependencyProviderCompile(): void $isSingleton = false; return $instance->get(); EOT; - $this->assertSame($this->normalizeLineEndings($expected), (string) $code); + $this->assertSame( + $this->normalizeLineEndings($expected), + $this->normalizeLineEndings((string) $code) + ); } public function testDependencyInstanceCompile(): void @@ -121,7 +132,10 @@ public function testDependencyInstanceCompile(): void return 'momo'; EOT; - $this->assertSame($this->normalizeLineEndings($expected), (string) $code); + $this->assertSame( + $this->normalizeLineEndings($expected), + $this->normalizeLineEndings((string) $code) + ); } public function testDependencyObjectInstanceCompile(): void @@ -134,8 +148,9 @@ public function testDependencyObjectInstanceCompile(): void return unserialize('O:23:"Ray\\Compiler\\FakeEngine":0:{}'); EOT; - $this->assertContains((string) $code, [ - str_replace('\\\\', '\\', $this->normalizeLineEndings($expected)), + $normalizedCode = $this->normalizeLineEndings((string) $code); + $this->assertContains($normalizedCode, [ + $this->normalizeLineEndings(str_replace('\\\\', '\\', $expected)), $this->normalizeLineEndings($expected), ]); } @@ -165,10 +180,13 @@ public function testContextualProviderCompile(): void $isSingleton = false; return $instance->get(); EOT; - $this->assertSame($this->normalizeLineEndings($expected), (string) $code); + $this->assertSame( + $this->normalizeLineEndings($expected), + $this->normalizeLineEndings((string) $code) + ); } - private function normalizeLineEndings($content): string + private function normalizeLineEndings(string $content): string { // Convert Windows (CRLF: \r\n) and old Mac (CR: \r) to Unix (LF: \n) return str_replace(["\r\n", "\r"], "\n", $content);