From f4906608aef4d490c2e5f75c6770f5e3a0b11d9b Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 15:51:36 +0900 Subject: [PATCH 01/22] Add "baseline" script to composer.json The "baseline" script generates static analysis baselines for PHPStan and Psalm. This simplifies managing analysis results and helps suppress existing issues for future incremental improvements. --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 21d62f5a..fddb37f6 100644 --- a/composer.json +++ b/composer.json @@ -50,7 +50,8 @@ "sa": ["psalm -m -c psalm.xml --show-info=true", "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"] + "build": ["@cs", "@sa", "@pcov", "@metrics"], + "baseline": ["phpstan analyse -c phpstan.neon --generate-baseline", "psalm --set-baseline=psalm-baseline.xml"] }, "extra": { "bamarni-bin": { From 8b883575970521cb00445b81f56bf2945709d13e Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 15:51:49 +0900 Subject: [PATCH 02/22] Add PHPStan and Psalm baselines for static analysis Introduced baseline files for PHPStan and Psalm to suppress known issues temporarily, improving focus on new errors. Added references to these baselines in the respective configuration files to aid static analysis setup. --- phpstan-baseline.neon | 7 +++++++ psalm-baseline.xml | 30 ++++++++++++++++++++++++++++++ psalm.xml | 1 + 3 files changed, 38 insertions(+) create mode 100644 phpstan-baseline.neon create mode 100644 psalm-baseline.xml diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 00000000..5cae13cc --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,7 @@ +parameters: + ignoreErrors: + - + message: '#^Call to an undefined method ReflectionMethod\:\:getAnnotation\(\)\.$#' + identifier: method.notFound + count: 1 + path: src/di/AnnotatedClassMethods.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml new file mode 100644 index 00000000..9f68034d --- /dev/null +++ b/psalm-baseline.xml @@ -0,0 +1,30 @@ + + + + + $named + + + getAnnotation + + + + + $instantiatedBindings[$methodName] + + + $interceptorClassName + $interceptorClassNames + $methodName + + + $instantiatedBindings + array<string, list<MethodInterceptor>> + + + + + $pointcuts + + + diff --git a/psalm.xml b/psalm.xml index d52c11eb..d4a070cd 100644 --- a/psalm.xml +++ b/psalm.xml @@ -4,6 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config https://psalm.dev/schema/config" + errorBaseline="psalm-baseline.xml" > From 0e8c15fa63b7ddc2aa8d8b0b38af3bc11f506ce3 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 16:02:22 +0900 Subject: [PATCH 03/22] Refactor AOP binding logic into a dedicated method Moved Aspect-Oriented Programming (AOP) binding logic to a new `enableAop` method for better modularity and clarity. Replaced direct assertions with a safer method call (`__setBindings`) to streamline the binding process and improve maintainability. --- src/di/NewInstance.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/di/NewInstance.php b/src/di/NewInstance.php index d3b212d7..e7698973 100644 --- a/src/di/NewInstance.php +++ b/src/di/NewInstance.php @@ -5,6 +5,7 @@ namespace Ray\Di; use Ray\Aop\Bind as AopBind; +use Ray\Aop\WeavedInterface; use ReflectionClass; use ReflectionException; @@ -94,15 +95,22 @@ public function accept(VisitorInterface $visitor): void private function postNewInstance(Container $container, object $instance): object { - // bind dependency injected interceptors - if ($this->bind instanceof AspectBind) { - assert(isset($instance->bindings)); - $instance->bindings = $this->bind->inject($container); - } + $this->enableAop($instance, $container); // setter injection ($this->setterMethods)($instance, $container); return $instance; } + + public function enableAop(object $instance, Container $container): void + { + if (! $this->bind instanceof AspectBind) { + return; + } + + assert($instance instanceof WeavedInterface); + + $instance->_setBindings($this->bind->inject($container)); // Ray.Aop ^2.18 + } } From fa7111b1cc61486ae093167adb9d40142e5cd061 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 16:02:53 +0900 Subject: [PATCH 04/22] Update Ray/AOP dependency to ^2.x-dev Switched the Ray/AOP dependency from a stable version to the ^2.x-dev branch. This allows for using the latest development changes while maintaining compatibility with the project. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fddb37f6..b74c99f2 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "koriym/attributes": "^1.0.4", "koriym/null-object": "^1.0", "koriym/param-reader": "^1.0", - "ray/aop": "^2.16", + "ray/aop": "^2.x-dev", "ray/compiler": "^1.10.3" }, "require-dev": { From f8e37389ccdd8c5a27b6b06eb4c9d738d7b6a111 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 16:31:37 +0900 Subject: [PATCH 05/22] Refactor type assertions and annotations for clarity. Added stricter type assertion in `AnnotatedClassMethods` with `assert` to ensure constructor type safety. Removed unnecessary suppression comments and improved type annotations for better code reliability and maintainability. --- src/di/AnnotatedClassMethods.php | 2 ++ src/di/AspectBind.php | 2 +- src/di/BindValidator.php | 2 +- tests/di/AnnotatedClassTest.php | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/di/AnnotatedClassMethods.php b/src/di/AnnotatedClassMethods.php index dc904e6c..9afe3814 100644 --- a/src/di/AnnotatedClassMethods.php +++ b/src/di/AnnotatedClassMethods.php @@ -9,6 +9,7 @@ use Ray\Di\Di\InjectInterface; use Ray\Di\Di\Named; +use function assert; use const PHP_VERSION_ID; final class AnnotatedClassMethods @@ -38,6 +39,7 @@ public function getConstructorName(ReflectionClass $class): Name } } + assert($constructor instanceof ReflectionMethod); $named = $constructor->getAnnotation(Named::class); if ($named instanceof Named) { return new Name($named->value); diff --git a/src/di/AspectBind.php b/src/di/AspectBind.php index ae1a9ad5..9142dfeb 100644 --- a/src/di/AspectBind.php +++ b/src/di/AspectBind.php @@ -22,7 +22,7 @@ public function __construct(AopBind $bind) /** * Instantiate interceptors * - * @return array> + * @return array> */ public function inject(Container $container): array { diff --git a/src/di/BindValidator.php b/src/di/BindValidator.php index 45397fd8..c63a331e 100644 --- a/src/di/BindValidator.php +++ b/src/di/BindValidator.php @@ -42,7 +42,7 @@ public function to(string $interface, string $class): ReflectionClass throw new InvalidType("[{$class}] is no implemented [{$interface}] interface"); } - return new ReflectionClass($class); // @phpstan-ignore-line + return new ReflectionClass($class); } /** diff --git a/tests/di/AnnotatedClassTest.php b/tests/di/AnnotatedClassTest.php index cf926e07..b27623e6 100644 --- a/tests/di/AnnotatedClassTest.php +++ b/tests/di/AnnotatedClassTest.php @@ -21,7 +21,7 @@ protected function setUp(): void public function testInvoke(): void { - $newInstance = $this->annotatedClass->getNewInstance(new ReflectionClass(FakeCar::class)); + $newInstance = $this->annotatedClass->getNewInstance(new ReflectionClass(FakeCar::class)); // @phpstan-ignore-line $this->assertInstanceOf(NewInstance::class, $newInstance); $container = new Container(); (new Bind($container, FakeTyreInterface::class))->to(FakeTyre::class); From 559e01e62b1c2423b0cbcf4905bdc734657fe562 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 16:31:57 +0900 Subject: [PATCH 06/22] fixup! Add "baseline" script to composer.json --- phpstan-baseline.neon | 4 ++-- psalm-baseline.xml | 17 ++++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 5cae13cc..9809e837 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,7 +1,7 @@ parameters: ignoreErrors: - - message: '#^Call to an undefined method ReflectionMethod\:\:getAnnotation\(\)\.$#' - identifier: method.notFound + message: '#^Negated boolean expression is always false\.$#' + identifier: booleanNot.alwaysFalse count: 1 path: src/di/AnnotatedClassMethods.php diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 9f68034d..05a3eac1 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,12 +1,10 @@ - - $named - - - getAnnotation - + + ! $constructor + $constructor + @@ -19,7 +17,7 @@ $instantiatedBindings - array<string, list<MethodInterceptor>> + array<non-empty-string, list<MethodInterceptor>> @@ -27,4 +25,9 @@ $pointcuts + + + $this->bind->inject($container) + + From 47fc6f48a45404206b47f6ad7b3b617956710275 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 16:32:37 +0900 Subject: [PATCH 07/22] Update dependencies in composer.lock to latest versions Upgraded multiple packages to ensure compatibility and receive the latest bug fixes and improvements. Adjusted metadata such as branch aliases and autoload paths where necessary. This helps maintain system stability and prepares for future development. --- vendor-bin/tools/composer.lock | 158 +++++++++++++++++---------------- 1 file changed, 80 insertions(+), 78 deletions(-) diff --git a/vendor-bin/tools/composer.lock b/vendor-bin/tools/composer.lock index 82a3e274..033f692e 100644 --- a/vendor-bin/tools/composer.lock +++ b/vendor-bin/tools/composer.lock @@ -267,13 +267,13 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - }, "phpstan": { "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-main": "3.x-dev" } }, "autoload": { @@ -635,29 +635,27 @@ }, { "name": "doctrine/deprecations", - "version": "1.1.3", + "version": "1.1.4", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab" + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", - "reference": "dfbaa3c2d2e9a9df1118213f3b8b0c597bb99fab", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/31610dbb31faa98e6b5447b62340826f54fbc4e9", + "reference": "31610dbb31faa98e6b5447b62340826f54fbc4e9", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "1.4.10 || 2.0.3", + "phpstan/phpstan-phpunit": "^1.0 || ^2", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -665,7 +663,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -676,9 +674,9 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.3" + "source": "https://github.com/doctrine/deprecations/tree/1.1.4" }, - "time": "2024-01-30T19:34:25+00:00" + "time": "2024-12-07T21:18:45+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -1059,16 +1057,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.0", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -1117,9 +1115,9 @@ "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.6.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-11-12T11:25:25+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -1379,16 +1377,16 @@ }, { "name": "phpstan/phpstan", - "version": "2.0.3", + "version": "2.1.6", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "46b4d3529b12178112d9008337beda0cc2a1a6b4" + "reference": "6eaec7c6c9e90dcfe46ad1e1ffa5171e2dab641c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/46b4d3529b12178112d9008337beda0cc2a1a6b4", - "reference": "46b4d3529b12178112d9008337beda0cc2a1a6b4", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6eaec7c6c9e90dcfe46ad1e1ffa5171e2dab641c", + "reference": "6eaec7c6c9e90dcfe46ad1e1ffa5171e2dab641c", "shasum": "" }, "require": { @@ -1433,25 +1431,25 @@ "type": "github" } ], - "time": "2024-11-28T22:19:37+00:00" + "time": "2025-02-19T15:46:42+00:00" }, { "name": "phpstan/phpstan-phpunit", - "version": "2.0.1", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-phpunit.git", - "reference": "4b6ad7fab8683ff4efd7887ba26ef8ee171c7475" + "reference": "d09e152f403c843998d7a52b5d87040c937525dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/4b6ad7fab8683ff4efd7887ba26ef8ee171c7475", - "reference": "4b6ad7fab8683ff4efd7887ba26ef8ee171c7475", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/d09e152f403c843998d7a52b5d87040c937525dd", + "reference": "d09e152f403c843998d7a52b5d87040c937525dd", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.0" + "phpstan/phpstan": "^2.0.4" }, "conflict": { "phpunit/phpunit": "<7.0" @@ -1482,9 +1480,9 @@ "description": "PHPUnit extensions and rules for PHPStan", "support": { "issues": "https://github.com/phpstan/phpstan-phpunit/issues", - "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.1" + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.4" }, - "time": "2024-11-12T12:48:00+00:00" + "time": "2025-01-22T13:07:38+00:00" }, { "name": "psalm/plugin-phpunit", @@ -1778,16 +1776,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.11.1", + "version": "3.11.3", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87" + "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", - "reference": "19473c30efe4f7b3cd42522d0b2e6e7f243c6f87", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", + "reference": "ba05f990e79cbe69b9f35c8c1ac8dca7eecc3a10", "shasum": "" }, "require": { @@ -1852,22 +1850,26 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-11-16T12:02:36+00:00" + "time": "2025-01-23T17:04:15+00:00" }, { "name": "symfony/config", - "version": "v7.2.0", + "version": "v7.2.3", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "bcd3c4adf0144dee5011bb35454728c38adec055" + "reference": "7716594aaae91d9141be080240172a92ecca4d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/bcd3c4adf0144dee5011bb35454728c38adec055", - "reference": "bcd3c4adf0144dee5011bb35454728c38adec055", + "url": "https://api.github.com/repos/symfony/config/zipball/7716594aaae91d9141be080240172a92ecca4d44", + "reference": "7716594aaae91d9141be080240172a92ecca4d44", "shasum": "" }, "require": { @@ -1913,7 +1915,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/v7.2.0" + "source": "https://github.com/symfony/config/tree/v7.2.3" }, "funding": [ { @@ -1929,20 +1931,20 @@ "type": "tidelift" } ], - "time": "2024-11-04T11:36:24+00:00" + "time": "2025-01-22T12:07:01+00:00" }, { "name": "symfony/console", - "version": "v6.4.15", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd" + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", - "reference": "f1fc6f47283e27336e7cebb9e8946c8de7bff9bd", + "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", + "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", "shasum": "" }, "require": { @@ -2007,7 +2009,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.15" + "source": "https://github.com/symfony/console/tree/v6.4.17" }, "funding": [ { @@ -2023,20 +2025,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2024-12-07T12:07:30+00:00" }, { "name": "symfony/dependency-injection", - "version": "v7.2.0", + "version": "v7.2.3", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "a475747af1a1c98272a5471abc35f3da81197c5d" + "reference": "1d321c4bc3fe926fd4c38999a4c9af4f5d61ddfc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/a475747af1a1c98272a5471abc35f3da81197c5d", - "reference": "a475747af1a1c98272a5471abc35f3da81197c5d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1d321c4bc3fe926fd4c38999a4c9af4f5d61ddfc", + "reference": "1d321c4bc3fe926fd4c38999a4c9af4f5d61ddfc", "shasum": "" }, "require": { @@ -2087,7 +2089,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/v7.2.0" + "source": "https://github.com/symfony/dependency-injection/tree/v7.2.3" }, "funding": [ { @@ -2103,7 +2105,7 @@ "type": "tidelift" } ], - "time": "2024-11-25T15:45:00+00:00" + "time": "2025-01-17T10:56:55+00:00" }, { "name": "symfony/deprecation-contracts", @@ -2124,12 +2126,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2264,8 +2266,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2340,8 +2342,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2418,8 +2420,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2502,8 +2504,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2576,8 +2578,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2660,12 +2662,12 @@ }, "type": "library", "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, "branch-alias": { "dev-main": "3.5-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -2954,10 +2956,10 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev", - "dev-3.x": "3.x-dev", + "dev-1.x": "1.x-dev", "dev-2.x": "2.x-dev", - "dev-1.x": "1.x-dev" + "dev-3.x": "3.x-dev", + "dev-master": "4.x-dev" } }, "autoload": { From 63a90eaca6e8a27640eabef16589b742f83ee324 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 16:35:29 +0900 Subject: [PATCH 08/22] fixup! Refactor type assertions and annotations for clarity. --- src/di/AnnotatedClassMethods.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/di/AnnotatedClassMethods.php b/src/di/AnnotatedClassMethods.php index 9afe3814..f4258257 100644 --- a/src/di/AnnotatedClassMethods.php +++ b/src/di/AnnotatedClassMethods.php @@ -10,6 +10,7 @@ use Ray\Di\Di\Named; use function assert; + use const PHP_VERSION_ID; final class AnnotatedClassMethods From a9711b8892595a924e2aeca03e058067f323e05b Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 16:42:00 +0900 Subject: [PATCH 09/22] Update psalm command to disable info display Disabled the `--show-info` output in the `sa` script for psalm to reduce unnecessary verbosity. This ensures the analysis output remains focused on essential issues. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b74c99f2..5448b067 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,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 -m -c psalm.xml --show-info=true", "phpstan analyse -c phpstan.neon --no-progress "], + "sa": ["psalm -m -c psalm.xml --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"], From 4ad4d5f9bb1ee5da7fe1e9eee45b6e133eac8d2f Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 16:54:26 +0900 Subject: [PATCH 10/22] Normalize line endings in ModuleTest string assertions Added a normalization function to standardize line endings to '\n' in string assertions for consistent behavior across environments. Updated the test to apply this normalization to both expected and actual strings. --- tests/di/ModuleTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/di/ModuleTest.php b/tests/di/ModuleTest.php index 61afd721..28d06bcb 100644 --- a/tests/di/ModuleTest.php +++ b/tests/di/ModuleTest.php @@ -7,6 +7,8 @@ use PHPUnit\Framework\TestCase; use Ray\Di\Exception\NotFound; +use function str_replace; + class ModuleTest extends TestCase { public function testNew(): void @@ -50,7 +52,10 @@ public function testActivate(): void public function testtoString(): void { $string = (string) new FakeLogStringModule(); - $this->assertSame('-array => (array) + $normalize = static function (string $str): string { + return str_replace(["\r\n", "\r"], "\n", $str); + }; + $this->assertSame($normalize('-array => (array) -bool => (boolean) 1 -int => (integer) 1 -null => (NULL) @@ -58,6 +63,6 @@ public function testtoString(): void -string => (string) 1 Ray\Di\FakeAopInterface- => (dependency) Ray\Di\FakeAop (aop) +returnSame(Ray\Di\FakeDoubleInterceptor) Ray\Di\FakeDoubleInterceptor- => (dependency) Ray\Di\FakeDoubleInterceptor -Ray\Di\FakeRobotInterface- => (provider) (dependency) Ray\Di\FakeRobotProvider', $string); +Ray\Di\FakeRobotInterface- => (provider) (dependency) Ray\Di\FakeRobotProvider'), $normalize($string)); } } From 5867f004519bdbe07bcc82dd97e2c3373a37a3c2 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 21:14:41 +0900 Subject: [PATCH 11/22] Update dependencies in tools/composer.json Upgraded `vimeo/psalm` to `^6.8` and adjusted `phpmetrics` to support version `^2.7 || v3.0.0rc8`. Removed `psalm/plugin-phpunit` as it is no longer required. --- psalm.xml | 4 +- vendor-bin/tools/composer.json | 7 +- vendor-bin/tools/composer.lock | 1787 +++++++++++++++++++++++++------- 3 files changed, 1431 insertions(+), 367 deletions(-) diff --git a/psalm.xml b/psalm.xml index d4a070cd..94363b94 100644 --- a/psalm.xml +++ b/psalm.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config https://psalm.dev/schema/config" - errorBaseline="psalm-baseline.xml" + findUnusedCode="true" > @@ -13,4 +13,4 @@ - + diff --git a/vendor-bin/tools/composer.json b/vendor-bin/tools/composer.json index 44669af2..ddb06d81 100644 --- a/vendor-bin/tools/composer.json +++ b/vendor-bin/tools/composer.json @@ -2,12 +2,11 @@ "require-dev": { "doctrine/coding-standard": "^9.0", "phpmd/phpmd": "^2.9", - "phpmetrics/phpmetrics": "^2.7", + "phpmetrics/phpmetrics": "^2.7 || v3.0.0rc8", "phpstan/phpstan": "^2.0", "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.2", - "phpstan/phpstan-phpunit": "^2.0", - "psalm/plugin-phpunit": "^0.17.0" + "vimeo/psalm": "^6.8", + "phpstan/phpstan-phpunit": "^2.0" }, "config": { "allow-plugins": { diff --git a/vendor-bin/tools/composer.lock b/vendor-bin/tools/composer.lock index 033f692e..6a4fa135 100644 --- a/vendor-bin/tools/composer.lock +++ b/vendor-bin/tools/composer.lock @@ -4,48 +4,41 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c253260b0da10b0df776aa26107bee4e", + "content-hash": "ce58914cbf304b940e7e9f90cc3811e9", "packages": [], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.6.4", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d" + "reference": "7cf7fef3d667bfe4b2560bc87e67d5387a7bcde9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", - "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", + "url": "https://api.github.com/repos/amphp/amp/zipball/7cf7fef3d667bfe4b2560bc87e67d5387a7bcde9", + "reference": "7cf7fef3d667bfe4b2560bc87e67d5387a7bcde9", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" }, "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1", - "ext-json": "*", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^7 | ^8 | ^9", - "react/promise": "^2", - "vimeo/psalm": "^3.12" + "amphp/php-cs-fixer-config": "^2", + "phpunit/phpunit": "^9", + "psalm/phar": "5.23.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - } - }, "autoload": { "files": [ - "lib/functions.php", - "lib/Internal/functions.php" + "src/functions.php", + "src/Future/functions.php", + "src/Internal/functions.php" ], "psr-4": { - "Amp\\": "lib" + "Amp\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -53,10 +46,6 @@ "MIT" ], "authors": [ - { - "name": "Daniel Lowrey", - "email": "rdlowrey@php.net" - }, { "name": "Aaron Piotrowski", "email": "aaron@trowski.com" @@ -68,6 +57,10 @@ { "name": "Niklas Keller", "email": "me@kelunik.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" } ], "description": "A non-blocking concurrency framework for PHP applications.", @@ -84,9 +77,8 @@ "promise" ], "support": { - "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.4" + "source": "https://github.com/amphp/amp/tree/v3.1.0" }, "funding": [ { @@ -94,41 +86,45 @@ "type": "github" } ], - "time": "2024-03-21T18:52:26+00:00" + "time": "2025-01-26T16:07:39+00:00" }, { "name": "amphp/byte-stream", - "version": "v1.8.2", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "4f0e968ba3798a423730f567b1b50d3441c16ddc" + "reference": "daa00f2efdbd71565bf64ffefa89e37542addf93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/4f0e968ba3798a423730f567b1b50d3441c16ddc", - "reference": "4f0e968ba3798a423730f567b1b50d3441c16ddc", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/daa00f2efdbd71565bf64ffefa89e37542addf93", + "reference": "daa00f2efdbd71565bf64ffefa89e37542addf93", "shasum": "" }, "require": { - "amphp/amp": "^2", - "php": ">=7.1" + "amphp/amp": "^3", + "amphp/parser": "^1.1", + "amphp/pipeline": "^1", + "amphp/serialization": "^1", + "amphp/sync": "^2", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2.3" }, "require-dev": { - "amphp/php-cs-fixer-config": "dev-master", - "amphp/phpunit-util": "^1.4", - "friendsofphp/php-cs-fixer": "^2.3", - "jetbrains/phpstorm-stubs": "^2019.3", - "phpunit/phpunit": "^6 || ^7 || ^8", - "psalm/phar": "^3.11.4" + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "5.22.1" }, "type": "library", "autoload": { "files": [ - "lib/functions.php" + "src/functions.php", + "src/Internal/functions.php" ], "psr-4": { - "Amp\\ByteStream\\": "lib" + "Amp\\ByteStream\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -157,7 +153,7 @@ ], "support": { "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.2" + "source": "https://github.com/amphp/byte-stream/tree/v2.1.1" }, "funding": [ { @@ -165,44 +161,205 @@ "type": "github" } ], - "time": "2024-04-13T18:00:56+00:00" + "time": "2024-02-17T04:49:38+00:00" }, { - "name": "composer/package-versions-deprecated", - "version": "1.11.99.5", + "name": "amphp/cache", + "version": "v2.0.1", "source": { "type": "git", - "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" + "url": "https://github.com/amphp/cache.git", + "reference": "46912e387e6aa94933b61ea1ead9cf7540b7797c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", - "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", + "url": "https://api.github.com/repos/amphp/cache/zipball/46912e387e6aa94933b61ea1ead9cf7540b7797c", + "reference": "46912e387e6aa94933b61ea1ead9cf7540b7797c", "shasum": "" }, "require": { - "composer-plugin-api": "^1.1.0 || ^2.0", - "php": "^7 || ^8" + "amphp/amp": "^3", + "amphp/serialization": "^1", + "amphp/sync": "^2", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" }, - "replace": { - "ocramius/package-versions": "1.11.99" + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Cache\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + } + ], + "description": "A fiber-aware cache API based on Amp and Revolt.", + "homepage": "https://amphp.org/cache", + "support": { + "issues": "https://github.com/amphp/cache/issues", + "source": "https://github.com/amphp/cache/tree/v2.0.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-04-19T03:38:06+00:00" + }, + { + "name": "amphp/dns", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/dns.git", + "reference": "78eb3db5fc69bf2fc0cb503c4fcba667bc223c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/dns/zipball/78eb3db5fc69bf2fc0cb503c4fcba667bc223c71", + "reference": "78eb3db5fc69bf2fc0cb503c4fcba667bc223c71", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/cache": "^2", + "amphp/parser": "^1", + "amphp/process": "^2", + "daverandom/libdns": "^2.0.2", + "ext-filter": "*", + "ext-json": "*", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" }, "require-dev": { - "composer/composer": "^1.9.3 || ^2.0@dev", - "ext-zip": "^1.13", - "phpunit/phpunit": "^6.5 || ^7" + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "5.20" }, - "type": "composer-plugin", - "extra": { - "class": "PackageVersions\\Installer", - "branch-alias": { - "dev-master": "1.x-dev" + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Amp\\Dns\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Wright", + "email": "addr@daverandom.com" + }, + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + } + ], + "description": "Async DNS resolution for Amp.", + "homepage": "https://github.com/amphp/dns", + "keywords": [ + "amp", + "amphp", + "async", + "client", + "dns", + "resolve" + ], + "support": { + "issues": "https://github.com/amphp/dns/issues", + "source": "https://github.com/amphp/dns/tree/v2.4.0" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" } + ], + "time": "2025-01-19T15:43:40+00:00" + }, + { + "name": "amphp/parallel", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/parallel.git", + "reference": "5113111de02796a782f5d90767455e7391cca190" }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/parallel/zipball/5113111de02796a782f5d90767455e7391cca190", + "reference": "5113111de02796a782f5d90767455e7391cca190", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/cache": "^2", + "amphp/parser": "^1", + "amphp/pipeline": "^1", + "amphp/process": "^2", + "amphp/serialization": "^1", + "amphp/socket": "^2", + "amphp/sync": "^2", + "php": ">=8.1", + "revolt/event-loop": "^1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.18" + }, + "type": "library", "autoload": { + "files": [ + "src/Context/functions.php", + "src/Context/Internal/functions.php", + "src/Ipc/functions.php", + "src/Worker/functions.php" + ], "psr-4": { - "PackageVersions\\": "src/PackageVersions" + "Amp\\Parallel\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -211,34 +368,452 @@ ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com" + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" }, { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be" + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Stephen Coakley", + "email": "me@stephencoakley.com" } ], - "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "description": "Parallel processing component for Amp.", + "homepage": "https://github.com/amphp/parallel", + "keywords": [ + "async", + "asynchronous", + "concurrent", + "multi-processing", + "multi-threading" + ], "support": { - "issues": "https://github.com/composer/package-versions-deprecated/issues", - "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.5" + "issues": "https://github.com/amphp/parallel/issues", + "source": "https://github.com/amphp/parallel/tree/v2.3.1" }, "funding": [ { - "url": "https://packagist.com", - "type": "custom" + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-12-21T01:56:09+00:00" + }, + { + "name": "amphp/parser", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/parser.git", + "reference": "3cf1f8b32a0171d4b1bed93d25617637a77cded7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/parser/zipball/3cf1f8b32a0171d4b1bed93d25617637a77cded7", + "reference": "3cf1f8b32a0171d4b1bed93d25617637a77cded7", + "shasum": "" + }, + "require": { + "php": ">=7.4" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Parser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" }, { - "url": "https://github.com/composer", + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A generator parser to make streaming parsers simple.", + "homepage": "https://github.com/amphp/parser", + "keywords": [ + "async", + "non-blocking", + "parser", + "stream" + ], + "support": { + "issues": "https://github.com/amphp/parser/issues", + "source": "https://github.com/amphp/parser/tree/v1.1.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-03-21T19:16:53+00:00" + }, + { + "name": "amphp/pipeline", + "version": "v1.2.2", + "source": { + "type": "git", + "url": "https://github.com/amphp/pipeline.git", + "reference": "97cbf289f4d8877acfe58dd90ed5a4370a43caa4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/pipeline/zipball/97cbf289f4d8877acfe58dd90ed5a4370a43caa4", + "reference": "97cbf289f4d8877acfe58dd90ed5a4370a43caa4", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "php": ">=8.1", + "revolt/event-loop": "^1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.18" + }, + "type": "library", + "autoload": { + "psr-4": { + "Amp\\Pipeline\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Asynchronous iterators and operators.", + "homepage": "https://amphp.org/pipeline", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "iterator", + "non-blocking" + ], + "support": { + "issues": "https://github.com/amphp/pipeline/issues", + "source": "https://github.com/amphp/pipeline/tree/v1.2.2" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2025-01-19T15:42:46+00:00" + }, + { + "name": "amphp/process", + "version": "v2.0.3", + "source": { + "type": "git", + "url": "https://github.com/amphp/process.git", + "reference": "52e08c09dec7511d5fbc1fb00d3e4e79fc77d58d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/process/zipball/52e08c09dec7511d5fbc1fb00d3e4e79fc77d58d", + "reference": "52e08c09dec7511d5fbc1fb00d3e4e79fc77d58d", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/sync": "^2", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.4" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Amp\\Process\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A fiber-aware process manager based on Amp and Revolt.", + "homepage": "https://amphp.org/process", + "support": { + "issues": "https://github.com/amphp/process/issues", + "source": "https://github.com/amphp/process/tree/v2.0.3" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-04-19T03:13:44+00:00" + }, + { + "name": "amphp/serialization", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/serialization.git", + "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/serialization/zipball/693e77b2fb0b266c3c7d622317f881de44ae94a1", + "reference": "693e77b2fb0b266c3c7d622317f881de44ae94a1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "phpunit/phpunit": "^9 || ^8 || ^7" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Amp\\Serialization\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Serialization tools for IPC and data storage in PHP.", + "homepage": "https://github.com/amphp/serialization", + "keywords": [ + "async", + "asynchronous", + "serialization", + "serialize" + ], + "support": { + "issues": "https://github.com/amphp/serialization/issues", + "source": "https://github.com/amphp/serialization/tree/master" + }, + "time": "2020-03-25T21:39:07+00:00" + }, + { + "name": "amphp/socket", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/amphp/socket.git", + "reference": "58e0422221825b79681b72c50c47a930be7bf1e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/socket/zipball/58e0422221825b79681b72c50c47a930be7bf1e1", + "reference": "58e0422221825b79681b72c50c47a930be7bf1e1", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/dns": "^2", + "ext-openssl": "*", + "kelunik/certificate": "^1.1", + "league/uri": "^6.5 | ^7", + "league/uri-interfaces": "^2.3 | ^7", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "amphp/process": "^2", + "phpunit/phpunit": "^9", + "psalm/phar": "5.20" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php", + "src/Internal/functions.php", + "src/SocketAddress/functions.php" + ], + "psr-4": { + "Amp\\Socket\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@gmail.com" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Non-blocking socket connection / server implementations based on Amp and Revolt.", + "homepage": "https://github.com/amphp/socket", + "keywords": [ + "amp", + "async", + "encryption", + "non-blocking", + "sockets", + "tcp", + "tls" + ], + "support": { + "issues": "https://github.com/amphp/socket/issues", + "source": "https://github.com/amphp/socket/tree/v2.3.1" + }, + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2024-04-21T14:33:03+00:00" + }, + { + "name": "amphp/sync", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/amphp/sync.git", + "reference": "217097b785130d77cfcc58ff583cf26cd1770bf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/sync/zipball/217097b785130d77cfcc58ff583cf26cd1770bf1", + "reference": "217097b785130d77cfcc58ff583cf26cd1770bf1", + "shasum": "" + }, + "require": { + "amphp/amp": "^3", + "amphp/pipeline": "^1", + "amphp/serialization": "^1", + "php": ">=8.1", + "revolt/event-loop": "^1 || ^0.2" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "amphp/phpunit-util": "^3", + "phpunit/phpunit": "^9", + "psalm/phar": "5.23" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Amp\\Sync\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + }, + { + "name": "Stephen Coakley", + "email": "me@stephencoakley.com" + } + ], + "description": "Non-blocking synchronization primitives for PHP based on Amp and Revolt.", + "homepage": "https://github.com/amphp/sync", + "keywords": [ + "async", + "asynchronous", + "mutex", + "semaphore", + "synchronization" + ], + "support": { + "issues": "https://github.com/amphp/sync/issues", + "source": "https://github.com/amphp/sync/tree/v2.3.0" + }, + "funding": [ + { + "url": "https://github.com/amphp", "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" } ], - "time": "2022-01-17T14:14:24+00:00" + "time": "2024-08-03T19:31:26+00:00" }, { "name": "composer/pcre", @@ -466,6 +1041,102 @@ ], "time": "2024-05-06T16:37:16+00:00" }, + { + "name": "danog/advanced-json-rpc", + "version": "v3.2.2", + "source": { + "type": "git", + "url": "https://github.com/danog/php-advanced-json-rpc.git", + "reference": "aadb1c4068a88c3d0530cfe324b067920661efcb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/danog/php-advanced-json-rpc/zipball/aadb1c4068a88c3d0530cfe324b067920661efcb", + "reference": "aadb1c4068a88c3d0530cfe324b067920661efcb", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^5", + "php": ">=8.1", + "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + }, + "replace": { + "felixfbecker/php-advanced-json-rpc": "^3" + }, + "require-dev": { + "phpunit/phpunit": "^9" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + }, + { + "name": "Daniil Gentili", + "email": "daniil@daniil.it" + } + ], + "description": "A more advanced JSONRPC implementation", + "support": { + "issues": "https://github.com/danog/php-advanced-json-rpc/issues", + "source": "https://github.com/danog/php-advanced-json-rpc/tree/v3.2.2" + }, + "time": "2025-02-14T10:55:15+00:00" + }, + { + "name": "daverandom/libdns", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/DaveRandom/LibDNS.git", + "reference": "b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DaveRandom/LibDNS/zipball/b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a", + "reference": "b84c94e8fe6b7ee4aecfe121bfe3b6177d303c8a", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "Required for IDN support" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "LibDNS\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "DNS protocol implementation written in pure PHP", + "keywords": [ + "dns" + ], + "support": { + "issues": "https://github.com/DaveRandom/LibDNS/issues", + "source": "https://github.com/DaveRandom/LibDNS/tree/v2.1.0" + }, + "time": "2024-04-12T12:12:48+00:00" + }, { "name": "dealerdirect/phpcodesniffer-composer-installer", "version": "v0.7.2", @@ -679,31 +1350,36 @@ "time": "2024-12-07T21:18:45+00:00" }, { - "name": "felixfbecker/advanced-json-rpc", - "version": "v3.2.1", + "name": "felixfbecker/language-server-protocol", + "version": "v1.5.3", "source": { "type": "git", - "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447" + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/b5f37dbff9a8ad360ca341f3240dc1c168b45447", - "reference": "b5f37dbff9a8ad360ca341f3240dc1c168b45447", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/a9e113dbc7d849e35b8776da39edaf4313b7b6c9", + "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9", "shasum": "" }, "require": { - "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", - "php": "^7.1 || ^8.0", - "phpdocumentor/reflection-docblock": "^4.3.4 || ^5.0.0" + "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^7.0 || ^8.0" + "phpstan/phpstan": "*", + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, "autoload": { "psr-4": { - "AdvancedJsonRpc\\": "lib/" + "LanguageServerProtocol\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -716,34 +1392,101 @@ "email": "felix.b@outlook.com" } ], - "description": "A more advanced JSONRPC implementation", + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], "support": { - "issues": "https://github.com/felixfbecker/php-advanced-json-rpc/issues", - "source": "https://github.com/felixfbecker/php-advanced-json-rpc/tree/v3.2.1" + "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", + "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.3" }, - "time": "2021-06-11T22:34:44+00:00" + "time": "2024-04-30T00:40:11+00:00" }, { - "name": "felixfbecker/language-server-protocol", - "version": "v1.5.3", + "name": "fidry/cpu-core-counter", + "version": "1.2.0", "source": { "type": "git", - "url": "https://github.com/felixfbecker/php-language-server-protocol.git", - "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/a9e113dbc7d849e35b8776da39edaf4313b7b6c9", - "reference": "a9e113dbc7d849e35b8776da39edaf4313b7b6c9", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { - "php": ">=7.1" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "*", - "squizlabs/php_codesniffer": "^3.1", - "vimeo/psalm": "^4.0" + "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": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2024-08-06T10:04:20+00:00" + }, + { + "name": "kelunik/certificate", + "version": "v1.1.3", + "source": { + "type": "git", + "url": "https://github.com/kelunik/certificate.git", + "reference": "7e00d498c264d5eb4f78c69f41c8bd6719c0199e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kelunik/certificate/zipball/7e00d498c264d5eb4f78c69f41c8bd6719c0199e", + "reference": "7e00d498c264d5eb4f78c69f41c8bd6719c0199e", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">=7.0" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "^2", + "phpunit/phpunit": "^6 | 7 | ^8 | ^9" }, "type": "library", "extra": { @@ -753,44 +1496,220 @@ }, "autoload": { "psr-4": { - "LanguageServerProtocol\\": "src/" + "Kelunik\\Certificate\\": "src" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "ISC" + "MIT" ], "authors": [ { - "name": "Felix Becker", - "email": "felix.b@outlook.com" + "name": "Niklas Keller", + "email": "me@kelunik.com" } ], - "description": "PHP classes for the Language Server Protocol", + "description": "Access certificate details and transform between different formats.", "keywords": [ - "language", - "microsoft", - "php", - "server" + "DER", + "certificate", + "certificates", + "openssl", + "pem", + "x509" ], "support": { - "issues": "https://github.com/felixfbecker/php-language-server-protocol/issues", - "source": "https://github.com/felixfbecker/php-language-server-protocol/tree/v1.5.3" + "issues": "https://github.com/kelunik/certificate/issues", + "source": "https://github.com/kelunik/certificate/tree/v1.1.3" }, - "time": "2024-04-30T00:40:11+00:00" + "time": "2023-02-03T21:26:53+00:00" + }, + { + "name": "league/uri", + "version": "7.5.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri.git", + "reference": "81fb5145d2644324614cc532b28efd0215bda430" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/81fb5145d2644324614cc532b28efd0215bda430", + "reference": "81fb5145d2644324614cc532b28efd0215bda430", + "shasum": "" + }, + "require": { + "league/uri-interfaces": "^7.5", + "php": "^8.1" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-fileinfo": "to create Data URI from file contennts", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "jeremykendall/php-domain-parser": "to resolve Public Suffix and Top Level Domain", + "league/uri-components": "Needed to easily manipulate URI objects components", + "php-64bit": "to improve IPV4 host parsing", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "URI manipulation library", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "uri-template", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri/tree/7.5.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2024-12-08T08:40:02+00:00" + }, + { + "name": "league/uri-interfaces", + "version": "7.5.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "08cfc6c4f3d811584fb09c37e2849e6a7f9b0742" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/08cfc6c4f3d811584fb09c37e2849e6a7f9b0742", + "reference": "08cfc6c4f3d811584fb09c37e2849e6a7f9b0742", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^8.1", + "psr/http-factory": "^1", + "psr/http-message": "^1.1 || ^2.0" + }, + "suggest": { + "ext-bcmath": "to improve IPV4 host parsing", + "ext-gmp": "to improve IPV4 host parsing", + "ext-intl": "to handle IDN host with the best performance", + "php-64bit": "to improve IPV4 host parsing", + "symfony/polyfill-intl-idn": "to handle IDN host via the Symfony polyfill if ext-intl is not present" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "Common interfaces and classes for URI representation and interaction", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri-src/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/7.5.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2024-12-08T08:18:47+00:00" }, { "name": "netresearch/jsonmapper", - "version": "v4.5.0", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5" + "reference": "8c64d8d444a5d764c641ebe97e0e3bc72b25bf6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8e76efb98ee8b6afc54687045e1b8dba55ac76e5", - "reference": "8e76efb98ee8b6afc54687045e1b8dba55ac76e5", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8c64d8d444a5d764c641ebe97e0e3bc72b25bf6c", + "reference": "8c64d8d444a5d764c641ebe97e0e3bc72b25bf6c", "shasum": "" }, "require": { @@ -826,31 +1745,33 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.5.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v5.0.0" }, - "time": "2024-09-08T10:13:13+00:00" + "time": "2024-09-08T10:20:00+00:00" }, { "name": "nikic/php-parser", - "version": "v4.19.4", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.1" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -858,7 +1779,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -882,62 +1803,52 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-09-29T15:01:53+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { - "name": "openlss/lib-array2xml", - "version": "1.0.0", + "name": "openmetrics-php/exposition-text", + "version": "v0.4.1", "source": { "type": "git", - "url": "https://github.com/nullivex/lib-array2xml.git", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" + "url": "https://github.com/openmetrics-php/exposition-text.git", + "reference": "fcfca38f693e168f4520bbd359d91528bbb9a8e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", - "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "url": "https://api.github.com/repos/openmetrics-php/exposition-text/zipball/fcfca38f693e168f4520bbd359d91528bbb9a8e8", + "reference": "fcfca38f693e168f4520bbd359d91528bbb9a8e8", "shasum": "" }, "require": { - "php": ">=5.3.2" + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "ext-xdebug": "*" }, "type": "library", "autoload": { - "psr-0": { - "LSS": "" + "psr-4": { + "OpenMetricsPhp\\Exposition\\Text\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "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" + "name": "Holger Woltersdorf", + "email": "hw@hollo.me" } ], - "description": "Array2XML conversion library credit to lalit.org", - "homepage": "https://www.nullivex.com", - "keywords": [ - "array", - "array conversion", - "xml", - "xml conversion" - ], + "description": "Implementation of the text exposition format of OpenMetrics", "support": { - "issues": "https://github.com/nullivex/lib-array2xml/issues", - "source": "https://github.com/nullivex/lib-array2xml/tree/master" + "issues": "https://github.com/openmetrics-php/exposition-text/issues", + "source": "https://github.com/openmetrics-php/exposition-text/tree/v0.4.1" }, - "time": "2019-03-29T20:06:56+00:00" + "time": "2024-07-16T12:47:30+00:00" }, { "name": "pdepend/pdepend", @@ -1262,44 +2173,53 @@ }, { "name": "phpmetrics/phpmetrics", - "version": "v2.8.2", + "version": "v3.0.0rc8", "source": { "type": "git", "url": "https://github.com/phpmetrics/PhpMetrics.git", - "reference": "4b77140a11452e63c7a9b98e0648320bf6710090" + "reference": "7111fe26c10092ed73c88fd325b43ddcd1b08558" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/4b77140a11452e63c7a9b98e0648320bf6710090", - "reference": "4b77140a11452e63c7a9b98e0648320bf6710090", + "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/7111fe26c10092ed73c88fd325b43ddcd1b08558", + "reference": "7111fe26c10092ed73c88fd325b43ddcd1b08558", "shasum": "" }, "require": { - "ext-dom": "*", "ext-tokenizer": "*", - "nikic/php-parser": "^3|^4", - "php": ">=5.5" + "nikic/php-parser": "^5.4", + "openmetrics-php/exposition-text": "^0.4.1", + "php": ">=8.1" }, "replace": { "halleck45/php-metrics": "*", "halleck45/phpmetrics": "*" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14", - "sebastian/comparator": ">=1.2.3", - "squizlabs/php_codesniffer": "^3.5", - "symfony/dom-crawler": "^3.0 || ^4.0 || ^5.0" + "phake/phake": "^4.5.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^10.5", + "roave/security-advisories": "dev-latest", + "sebastian/comparator": ">=5.0.0", + "squizlabs/php_codesniffer": "^3.11", + "symfony/dom-crawler": "^6.4", + "vimeo/psalm": "^6.3" + }, + "suggest": { + "ext-dom": "To allow XML parsing and report results.", + "ext-yaml": "To allow yaml parsing of configuration files." }, "bin": [ "bin/phpmetrics" ], "type": "library", "autoload": { - "files": [ - "./src/functions.php" - ], - "psr-0": { - "Hal\\": "./src/" + "psr-4": { + "Hal\\": "src/Hal" } }, "notification-url": "https://packagist.org/downloads/", @@ -1324,9 +2244,9 @@ ], "support": { "issues": "https://github.com/PhpMetrics/PhpMetrics/issues", - "source": "https://github.com/phpmetrics/PhpMetrics/tree/v2.8.2" + "source": "https://github.com/phpmetrics/PhpMetrics/tree/v3.0.0rc8" }, - "time": "2023-03-08T15:03:36+00:00" + "time": "2025-02-05T09:10:37+00:00" }, { "name": "phpstan/phpdoc-parser", @@ -1485,46 +2405,85 @@ "time": "2025-01-22T13:07:38+00:00" }, { - "name": "psalm/plugin-phpunit", - "version": "0.17.0", + "name": "psr/container", + "version": "2.0.2", "source": { "type": "git", - "url": "https://github.com/psalm/psalm-plugin-phpunit.git", - "reference": "45951541beef07e93e3ad197daf01da88e85c31d" + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/psalm/psalm-plugin-phpunit/zipball/45951541beef07e93e3ad197daf01da88e85c31d", - "reference": "45951541beef07e93e3ad197daf01da88e85c31d", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", "shasum": "" }, "require": { - "composer/package-versions-deprecated": "^1.10", - "composer/semver": "^1.4 || ^2.0 || ^3.0", - "ext-simplexml": "*", - "php": "^7.1 || ^8.0", - "vimeo/psalm": "dev-master || dev-4.x || ^4.5" + "php": ">=7.4.0" }, - "conflict": { - "phpunit/phpunit": "<7.5" + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } }, - "require-dev": { - "codeception/codeception": "^4.0.3", - "php": "^7.3 || ^8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.0", - "squizlabs/php_codesniffer": "^3.3.1", - "weirdan/codeception-psalm-module": "^0.11.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" + "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" }, - "type": "psalm-plugin", + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", "extra": { - "psalm": { - "pluginClass": "Psalm\\PhpUnitPlugin\\Plugin" + "branch-alias": { + "dev-master": "1.0.x-dev" } }, "autoload": { "psr-4": { - "Psalm\\PhpUnitPlugin\\": "src" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1533,33 +2492,42 @@ ], "authors": [ { - "name": "Matt Brown", - "email": "github@muglug.com" + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" } ], - "description": "Psalm plugin for PHPUnit", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], "support": { - "issues": "https://github.com/psalm/psalm-plugin-phpunit/issues", - "source": "https://github.com/psalm/psalm-plugin-phpunit/tree/0.17.0" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2022-06-14T17:05:57+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { - "name": "psr/container", - "version": "2.0.2", + "name": "psr/http-message", + "version": "2.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { @@ -1569,7 +2537,7 @@ }, "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "Psr\\Http\\Message\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1582,20 +2550,20 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" ], "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2021-11-05T16:47:00+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "psr/log", @@ -1647,31 +2615,103 @@ }, "time": "2024-09-11T13:17:53+00:00" }, + { + "name": "revolt/event-loop", + "version": "v1.0.7", + "source": { + "type": "git", + "url": "https://github.com/revoltphp/event-loop.git", + "reference": "09bf1bf7f7f574453efe43044b06fafe12216eb3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/revoltphp/event-loop/zipball/09bf1bf7f7f574453efe43044b06fafe12216eb3", + "reference": "09bf1bf7f7f574453efe43044b06fafe12216eb3", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^9", + "psalm/phar": "^5.15" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Revolt\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "ceesjank@gmail.com" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "Rock-solid event loop for concurrent PHP applications.", + "keywords": [ + "async", + "asynchronous", + "concurrency", + "event", + "event-loop", + "non-blocking", + "scheduler" + ], + "support": { + "issues": "https://github.com/revoltphp/event-loop/issues", + "source": "https://github.com/revoltphp/event-loop/tree/v1.0.7" + }, + "time": "2025-01-25T19:27:39+00:00" + }, { "name": "sebastian/diff", - "version": "4.0.6", + "version": "7.0.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + "reference": "7ab1ea946c012266ca32390913653d844ecd085f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", - "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f", "shasum": "" }, "require": { - "php": ">=7.3" + "php": ">=8.3" }, "require-dev": { - "phpunit/phpunit": "^9.3", - "symfony/process": "^4.2 || ^5" + "phpunit/phpunit": "^12.0", + "symfony/process": "^7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-main": "7.0-dev" } }, "autoload": { @@ -1703,7 +2743,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" }, "funding": [ { @@ -1711,7 +2752,7 @@ "type": "github" } ], - "time": "2024-03-02T06:30:58+00:00" + "time": "2025-02-07T04:55:46+00:00" }, { "name": "slevomat/coding-standard", @@ -1774,6 +2815,74 @@ ], "time": "2022-05-25T10:58:12+00:00" }, + { + "name": "spatie/array-to-xml", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/spatie/array-to-xml.git", + "reference": "7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67", + "reference": "7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "php": "^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.2", + "pestphp/pest": "^1.21", + "spatie/pest-plugin-snapshots": "^1.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Spatie\\ArrayToXml\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://freek.dev", + "role": "Developer" + } + ], + "description": "Convert an array to xml", + "homepage": "https://github.com/spatie/array-to-xml", + "keywords": [ + "array", + "convert", + "xml" + ], + "support": { + "source": "https://github.com/spatie/array-to-xml/tree/3.4.0" + }, + "funding": [ + { + "url": "https://spatie.be/open-source/support-us", + "type": "custom" + }, + { + "url": "https://github.com/spatie", + "type": "github" + } + ], + "time": "2024-12-16T12:45:15+00:00" + }, { "name": "squizlabs/php_codesniffer", "version": "3.11.3", @@ -1935,47 +3044,46 @@ }, { "name": "symfony/console", - "version": "v6.4.17", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "799445db3f15768ecc382ac5699e6da0520a0a04" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/799445db3f15768ecc382ac5699e6da0520a0a04", - "reference": "799445db3f15768ecc382ac5699e6da0520a0a04", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "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": { @@ -2009,7 +3117,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.17" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -2025,7 +3133,7 @@ "type": "tidelift" } ], - "time": "2024-12-07T12:07:30+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/dependency-injection", @@ -2559,17 +3667,17 @@ "time": "2024-09-09T11:45:10+00:00" }, { - "name": "symfony/polyfill-php80", + "name": "symfony/polyfill-php84", "version": "v1.31.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "e5493eb51311ab0b1cc2243416613f06ed8f18bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", - "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/e5493eb51311ab0b1cc2243416613f06ed8f18bd", + "reference": "e5493eb51311ab0b1cc2243416613f06ed8f18bd", "shasum": "" }, "require": { @@ -2587,7 +3695,7 @@ "bootstrap.php" ], "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "Symfony\\Polyfill\\Php84\\": "" }, "classmap": [ "Resources/stubs" @@ -2598,10 +3706,6 @@ "MIT" ], "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, { "name": "Nicolas Grekas", "email": "p@tchwork.com" @@ -2611,7 +3715,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -2620,7 +3724,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" + "source": "https://github.com/symfony/polyfill-php84/tree/v1.31.0" }, "funding": [ { @@ -2636,7 +3740,7 @@ "type": "tidelift" } ], - "time": "2024-09-09T11:45:10+00:00" + "time": "2024-09-09T12:04:04+00:00" }, { "name": "symfony/service-contracts", @@ -2886,24 +3990,26 @@ }, { "name": "vimeo/psalm", - "version": "4.30.0", + "version": "6.8.6", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69" + "reference": "34ba9e1e5ea2e7396d3e2e644ee3e3a1d4336603" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/d0bc6e25d89f649e4f36a534f330f8bb4643dd69", - "reference": "d0bc6e25d89f649e4f36a534f330f8bb4643dd69", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/34ba9e1e5ea2e7396d3e2e644ee3e3a1d4336603", + "reference": "34ba9e1e5ea2e7396d3e2e644ee3e3a1d4336603", "shasum": "" }, "require": { - "amphp/amp": "^2.4.2", - "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", + "amphp/amp": "^3", + "amphp/byte-stream": "^2", + "amphp/parallel": "^2.3", + "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", + "danog/advanced-json-rpc": "^3.1", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -2912,35 +4018,37 @@ "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", - "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" + "felixfbecker/language-server-protocol": "^1.5.3", + "fidry/cpu-core-counter": "^0.4.1 || ^0.5.1 || ^1.0.0", + "netresearch/jsonmapper": "^5.0", + "nikic/php-parser": "^5.0.0", + "php": "~8.1.31 || ~8.2.27 || ~8.3.16 || ~8.4.3", + "sebastian/diff": "^4.0 || ^5.0 || ^6.0 || ^7.0", + "spatie/array-to-xml": "^2.17.0 || ^3.0", + "symfony/console": "^6.0 || ^7.0", + "symfony/filesystem": "~6.3.12 || ~6.4.3 || ^7.0.3", + "symfony/polyfill-php84": "*" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", + "amphp/phpunit-util": "^3", + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.9", + "danog/class-finder": "^0.4.8", + "dg/bypass-finals": "^1.5", "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.19", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.6", + "symfony/process": "^6.0 || ^7.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -2951,22 +4059,22 @@ "psalm-language-server", "psalm-plugin", "psalm-refactor", + "psalm-review", "psalter" ], - "type": "library", + "type": "project", "extra": { "branch-alias": { "dev-1.x": "1.x-dev", "dev-2.x": "2.x-dev", "dev-3.x": "3.x-dev", - "dev-master": "4.x-dev" + "dev-4.x": "4.x-dev", + "dev-5.x": "5.x-dev", + "dev-6.x": "6.x-dev", + "dev-master": "7.x-dev" } }, "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], "psr-4": { "Psalm\\": "src/Psalm/" } @@ -2978,19 +4086,25 @@ "authors": [ { "name": "Matthew Brown" + }, + { + "name": "Daniil Gentili", + "email": "daniil@daniil.it" } ], "description": "A static analysis tool for finding errors in PHP applications", "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": "2025-02-21T10:03:22+00:00" }, { "name": "webmozart/assert", @@ -3049,62 +4163,13 @@ "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": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": { + "phpmetrics/phpmetrics": 5 + }, "prefer-stable": false, "prefer-lowest": false, "platform": {}, From 590f77b55e6908441cbf4cdb5499297e0fdc345d Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 21:23:52 +0900 Subject: [PATCH 12/22] fixup! Update dependencies in tools/composer.json --- psalm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psalm.xml b/psalm.xml index 94363b94..28342742 100644 --- a/psalm.xml +++ b/psalm.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config https://psalm.dev/schema/config" - findUnusedCode="true" + findUnusedCode="false" > From 005ad4dd0e3ba3b74f8165c801e4acac99ba0df5 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 21:29:20 +0900 Subject: [PATCH 13/22] Make classes final for better safety and immutability. Marking classes as final prevents unwanted inheritance and ensures safer, more predictable behavior. This change improves code maintainability and aligns with best practices for limiting class extensibility where unnecessary. --- src/di/AssistedInjectModule.php | 2 +- src/di/AssistedModule.php | 2 +- src/di/Exception.php | 2 +- src/di/Exception/DirectoryNotWritable.php | 2 +- src/di/Exception/InvalidContext.php | 2 +- src/di/Exception/InvalidProvider.php | 2 +- src/di/Exception/InvalidToConstructorNameParameter.php | 2 +- src/di/Exception/InvalidType.php | 2 +- src/di/Exception/MethodInvocationNotAvailable.php | 2 +- src/di/Exception/NotFound.php | 2 +- src/di/Exception/SetNotFound.php | 2 +- src/di/Exception/Untargeted.php | 2 +- src/di/Injector.php | 2 +- src/di/MultiBinding/MultiBindingModule.php | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/di/AssistedInjectModule.php b/src/di/AssistedInjectModule.php index 891dfcee..096c4944 100644 --- a/src/di/AssistedInjectModule.php +++ b/src/di/AssistedInjectModule.php @@ -9,7 +9,7 @@ /** * Assisted module for php8 attributes */ -class AssistedInjectModule extends AbstractModule +final class AssistedInjectModule extends AbstractModule { protected function configure(): void { diff --git a/src/di/AssistedModule.php b/src/di/AssistedModule.php index 6c61f490..11e202e1 100644 --- a/src/di/AssistedModule.php +++ b/src/di/AssistedModule.php @@ -9,7 +9,7 @@ use const PHP_VERSION_ID; -class AssistedModule extends AbstractModule +final class AssistedModule extends AbstractModule { protected function configure(): void { diff --git a/src/di/Exception.php b/src/di/Exception.php index 69765483..b1265321 100644 --- a/src/di/Exception.php +++ b/src/di/Exception.php @@ -4,6 +4,6 @@ namespace Ray\Di; -class Exception extends \Exception +final class Exception extends \Exception { } diff --git a/src/di/Exception/DirectoryNotWritable.php b/src/di/Exception/DirectoryNotWritable.php index 49f7bf20..f380a151 100644 --- a/src/di/Exception/DirectoryNotWritable.php +++ b/src/di/Exception/DirectoryNotWritable.php @@ -6,6 +6,6 @@ use RuntimeException; -class DirectoryNotWritable extends RuntimeException implements ExceptionInterface +final class DirectoryNotWritable extends RuntimeException implements ExceptionInterface { } diff --git a/src/di/Exception/InvalidContext.php b/src/di/Exception/InvalidContext.php index fb7c3a86..6ebed5de 100644 --- a/src/di/Exception/InvalidContext.php +++ b/src/di/Exception/InvalidContext.php @@ -6,6 +6,6 @@ use InvalidArgumentException; -class InvalidContext extends InvalidArgumentException implements ExceptionInterface +final class InvalidContext extends InvalidArgumentException implements ExceptionInterface { } diff --git a/src/di/Exception/InvalidProvider.php b/src/di/Exception/InvalidProvider.php index fef89767..f282d827 100644 --- a/src/di/Exception/InvalidProvider.php +++ b/src/di/Exception/InvalidProvider.php @@ -6,6 +6,6 @@ use InvalidArgumentException; -class InvalidProvider extends InvalidArgumentException implements ExceptionInterface +final class InvalidProvider extends InvalidArgumentException implements ExceptionInterface { } diff --git a/src/di/Exception/InvalidToConstructorNameParameter.php b/src/di/Exception/InvalidToConstructorNameParameter.php index dcb7f00b..3a0bc900 100644 --- a/src/di/Exception/InvalidToConstructorNameParameter.php +++ b/src/di/Exception/InvalidToConstructorNameParameter.php @@ -9,6 +9,6 @@ /** * @see https://github.com/ray-di/Ray.Di#constructor-bindings */ -class InvalidToConstructorNameParameter extends InvalidArgumentException implements ExceptionInterface +final class InvalidToConstructorNameParameter extends InvalidArgumentException implements ExceptionInterface { } diff --git a/src/di/Exception/InvalidType.php b/src/di/Exception/InvalidType.php index 2b87e8f8..a10473e0 100644 --- a/src/di/Exception/InvalidType.php +++ b/src/di/Exception/InvalidType.php @@ -6,6 +6,6 @@ use InvalidArgumentException; -class InvalidType extends InvalidArgumentException implements ExceptionInterface +final class InvalidType extends InvalidArgumentException implements ExceptionInterface { } diff --git a/src/di/Exception/MethodInvocationNotAvailable.php b/src/di/Exception/MethodInvocationNotAvailable.php index a70232bb..52853790 100644 --- a/src/di/Exception/MethodInvocationNotAvailable.php +++ b/src/di/Exception/MethodInvocationNotAvailable.php @@ -4,6 +4,6 @@ namespace Ray\Di\Exception; -class MethodInvocationNotAvailable extends Unbound +final class MethodInvocationNotAvailable extends Unbound { } diff --git a/src/di/Exception/NotFound.php b/src/di/Exception/NotFound.php index 2148a4c0..96bdf6e6 100644 --- a/src/di/Exception/NotFound.php +++ b/src/di/Exception/NotFound.php @@ -6,6 +6,6 @@ use LogicException; -class NotFound extends LogicException implements ExceptionInterface +final class NotFound extends LogicException implements ExceptionInterface { } diff --git a/src/di/Exception/SetNotFound.php b/src/di/Exception/SetNotFound.php index ecec8285..287a61f1 100644 --- a/src/di/Exception/SetNotFound.php +++ b/src/di/Exception/SetNotFound.php @@ -6,6 +6,6 @@ use LogicException; -class SetNotFound extends LogicException implements ExceptionInterface +final class SetNotFound extends LogicException implements ExceptionInterface { } diff --git a/src/di/Exception/Untargeted.php b/src/di/Exception/Untargeted.php index 08bc891f..de81e409 100644 --- a/src/di/Exception/Untargeted.php +++ b/src/di/Exception/Untargeted.php @@ -4,6 +4,6 @@ namespace Ray\Di\Exception; -class Untargeted extends Unbound +final class Untargeted extends Unbound { } diff --git a/src/di/Injector.php b/src/di/Injector.php index 2e252620..98d99057 100644 --- a/src/di/Injector.php +++ b/src/di/Injector.php @@ -18,7 +18,7 @@ use function str_replace; use function sys_get_temp_dir; -class Injector implements InjectorInterface +final class Injector implements InjectorInterface { /** @var non-empty-string */ private $classDir; diff --git a/src/di/MultiBinding/MultiBindingModule.php b/src/di/MultiBinding/MultiBindingModule.php index 34c08a22..51514f76 100644 --- a/src/di/MultiBinding/MultiBindingModule.php +++ b/src/di/MultiBinding/MultiBindingModule.php @@ -9,7 +9,7 @@ use Ray\Di\AbstractModule; use Ray\Di\Scope; -class MultiBindingModule extends AbstractModule +final class MultiBindingModule extends AbstractModule { protected function configure(): void { From 6543ac7af32eb6e5a30035a69112a3a4ad211b4c Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 21:57:22 +0900 Subject: [PATCH 14/22] Remove unnecessary test directory from psalm.xml configuration. The "tests/type" directory was excluded from the Psalm analysis configuration as it is no longer relevant. This simplifies the configuration and ensures that only essential directories are analyzed. --- psalm.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/psalm.xml b/psalm.xml index 28342742..e291c803 100644 --- a/psalm.xml +++ b/psalm.xml @@ -8,7 +8,6 @@ > - From 2e1899131870816930d51d8fee9f644b3c3a0758 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 21:57:45 +0900 Subject: [PATCH 15/22] Soothe SA:vRefactor type checks and suppress annotations. Replaced implicit null checks with strict comparisons to improve clarity and prevent potential bugs. Adjusted or added suppress annotations for static analysis tools where required. Removed unnecessary assertions and cleaned up redundant code. --- src/di/Argument.php | 3 +++ src/di/Bind.php | 2 +- src/di/Container.php | 1 + src/di/Dependency.php | 8 ++++---- src/di/DependencyProvider.php | 2 +- src/di/Name.php | 2 -- src/di/NewInstance.php | 3 ++- tests/di/DependencyTest.php | 4 ++-- tests/di/NewInstanceTest.php | 2 +- tests/type/InjectorInterfaceTest.php | 2 +- 10 files changed, 16 insertions(+), 13 deletions(-) diff --git a/src/di/Argument.php b/src/di/Argument.php index 43d22a9c..55abd5b4 100644 --- a/src/di/Argument.php +++ b/src/di/Argument.php @@ -4,6 +4,7 @@ namespace Ray\Di; +use Override; use ReflectionException; use ReflectionMethod; use ReflectionNamedType; @@ -101,6 +102,7 @@ public function serialize(): ?string // @phpstan-ignore-line * * @psalm-param string $data */ + #[Override] public function unserialize($data): void { /** @var array{0: string, 1: bool, 2: string, 3: string, 4: string, 5: array{0: string, 1: string, 2:string}} $array */ @@ -146,6 +148,7 @@ public function __unserialize(array $unserialized): void } /** @inheritDoc */ + #[Override] public function accept(VisitorInterface $visitor) { $visitor->visitArgument( diff --git a/src/di/Bind.php b/src/di/Bind.php index 7c07b69f..5a3752ba 100644 --- a/src/di/Bind.php +++ b/src/di/Bind.php @@ -117,7 +117,7 @@ public function toConstructor(string $class, $name, ?InjectionPoints $injectionP } $this->untarget = null; - $postConstructRef = $postConstruct ? new ReflectionMethod($class, $postConstruct) : null; + $postConstructRef = $postConstruct !== null ? new ReflectionMethod($class, $postConstruct) : null; /** @var ReflectionClass $reflection */ $reflection = new ReflectionClass($class); $this->bound = (new DependencyFactory())->newToConstructor($reflection, $name, $injectionPoints, $postConstructRef); diff --git a/src/di/Container.php b/src/di/Container.php index feb0d667..cd0a4820 100644 --- a/src/di/Container.php +++ b/src/di/Container.php @@ -94,6 +94,7 @@ public function getInstanceWithArgs(string $interface, array $params) throw new BadMethodCallException($interface); } + /** @psalm-suppress ArgumentTypeCoercion */ return $dependency->injectWithArgs($this, $params); } diff --git a/src/di/Dependency.php b/src/di/Dependency.php index 427887ca..5a34f689 100644 --- a/src/di/Dependency.php +++ b/src/di/Dependency.php @@ -67,7 +67,7 @@ public function register(array &$container, Bind $bind): void public function inject(Container $container) { // singleton ? - if ($this->isSingleton === true && $this->instance) { + if ($this->isSingleton === true && $this->instance !== null) { return $this->instance; } @@ -75,7 +75,7 @@ public function inject(Container $container) $this->instance = ($this->newInstance)($container); // @PostConstruct - if ($this->postConstruct) { + if ($this->postConstruct !== null) { assert(method_exists($this->instance, $this->postConstruct)); $this->instance->{$this->postConstruct}(); } @@ -91,7 +91,7 @@ public function inject(Container $container) public function injectWithArgs(Container $container, array $params) { // singleton ? - if ($this->isSingleton === true && $this->instance) { + if ($this->isSingleton === true && $this->instance !== null) { return $this->instance; } @@ -99,7 +99,7 @@ public function injectWithArgs(Container $container, array $params) $this->instance = $this->newInstance->newInstanceArgs($container, $params); // @PostConstruct - if ($this->postConstruct) { + if ($this->postConstruct !== null) { assert(method_exists($this->instance, $this->postConstruct)); $this->instance->{$this->postConstruct}(); } diff --git a/src/di/DependencyProvider.php b/src/di/DependencyProvider.php index 4a25c71c..b05be2c8 100644 --- a/src/di/DependencyProvider.php +++ b/src/di/DependencyProvider.php @@ -60,7 +60,7 @@ public function register(array &$container, Bind $bind): void */ public function inject(Container $container) { - if ($this->isSingleton && $this->instance) { + if ($this->isSingleton && $this->instance !== null) { return $this->instance; } diff --git a/src/di/Name.php b/src/di/Name.php index 3344e20c..eb3fbb42 100644 --- a/src/di/Name.php +++ b/src/di/Name.php @@ -12,7 +12,6 @@ use ReflectionMethod; use ReflectionParameter; -use function assert; use function class_exists; use function explode; use function get_class; @@ -153,7 +152,6 @@ private function parseName(string $name): array if (isset($exploded[1])) { [$key, $value] = $exploded; if (isset($key[0]) && $key[0] === '$') { - assert(is_string($key)); // @phpstan-ignore-line $key = substr($key, 1); } diff --git a/src/di/NewInstance.php b/src/di/NewInstance.php index e7698973..288ceeca 100644 --- a/src/di/NewInstance.php +++ b/src/di/NewInstance.php @@ -48,7 +48,7 @@ public function __construct( */ public function __invoke(Container $container): object { - /** @psalm-suppress MixedMethodCall */ + /** @psalm-suppress MixedMethodCall, ArgumentTypeCoercion */ $instance = $this->arguments instanceof Arguments ? (new ReflectionClass($this->class))->newInstanceArgs($this->arguments->inject($container)) : new $this->class(); return $this->postNewInstance($container, $instance); @@ -69,6 +69,7 @@ public function __toString() */ public function newInstanceArgs(Container $container, array $params): object { + /** @psalm-suppress ArgumentTypeCoercion */ $instance = (new ReflectionClass($this->class))->newInstanceArgs($params); return $this->postNewInstance($container, $instance); diff --git a/tests/di/DependencyTest.php b/tests/di/DependencyTest.php index fba3e00a..54448163 100644 --- a/tests/di/DependencyTest.php +++ b/tests/di/DependencyTest.php @@ -30,7 +30,7 @@ protected function setUp(): void $setters[] = new SetterMethod(new ReflectionMethod(FakeCar::class, 'setTires'), $name); $setters[] = new SetterMethod(new ReflectionMethod(FakeCar::class, 'setHardtop'), $name); $setterMethods = new SetterMethods($setters); - $newInstance = new NewInstance($class, $setterMethods); + $newInstance = new NewInstance($class, $setterMethods); // @phpstan-ignore-line $this->dependency = new Dependency($newInstance, new ReflectionMethod(FakeCar::class, 'postConstruct')); } @@ -105,7 +105,7 @@ public function testSingleton(Container $container): void public function testInjectInterceptor(): void { - $dependency = new Dependency(new NewInstance(new ReflectionClass(FakeAop::class), new SetterMethods([]))); + $dependency = new Dependency(new NewInstance(new ReflectionClass(FakeAop::class), new SetterMethods([]))); // @phpstan-ignore-line $pointcut = new Pointcut((new Matcher())->any(), (new Matcher())->any(), [FakeDoubleInterceptor::class]); $dependency->weaveAspects(new Compiler(__DIR__ . '/tmp'), [$pointcut]); $container = new Container(); diff --git a/tests/di/NewInstanceTest.php b/tests/di/NewInstanceTest.php index da3820b7..7326b8b7 100644 --- a/tests/di/NewInstanceTest.php +++ b/tests/di/NewInstanceTest.php @@ -23,7 +23,7 @@ protected function setUp(): void $setters[] = new SetterMethod(new ReflectionMethod(FakeCar::class, 'setTires'), $name); $setters[] = new SetterMethod(new ReflectionMethod(FakeCar::class, 'setHardtop'), $name); $setterMethods = new SetterMethods($setters); - $this->newInstance = new NewInstance($class, $setterMethods); + $this->newInstance = new NewInstance($class, $setterMethods); // @phpstan-ignore-line } public function testInvoke(): void diff --git a/tests/type/InjectorInterfaceTest.php b/tests/type/InjectorInterfaceTest.php index 53883f21..48d3554a 100644 --- a/tests/type/InjectorInterfaceTest.php +++ b/tests/type/InjectorInterfaceTest.php @@ -24,7 +24,7 @@ protected function configure() $this->a = $injector->getInstance(DateTimeInterface::class); /** @psalm-suppress PropertyTypeCoercion */ $this->b = $injector->getInstance(DateTimeInterface::class); // @phpstan-ignore-line - /** @psalm-suppress ArgumentTypeCoercion */ + /** @psalm-suppress */ $this->m = $injector->getInstance('a'); // @phpstan-ignore-line } } From ce7af2d87b832697cd35122fe9bacf3c30f4e611 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Sat, 22 Feb 2025 22:09:50 +0900 Subject: [PATCH 16/22] Add OS-specific requirement annotations to tests Annotations restrict `testIsOptionalValue` and `testToConstructor` to Linux and Darwin. This ensures tests are only executed in compatible environments. --- tests/di/InjectorTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/di/InjectorTest.php b/tests/di/InjectorTest.php index 20b7d90d..e45b4e5e 100644 --- a/tests/di/InjectorTest.php +++ b/tests/di/InjectorTest.php @@ -328,6 +328,7 @@ public function testNewAbstract(): void (new Injector())->getInstance(FakeConcreteClass::class); } + /** @requires OS ^Linux|^Darwin */ public function testIsOptionalValue(): void { if (! defined('HHVM_VERSION')) { @@ -343,6 +344,7 @@ public function testInternalTypes(): void $this->assertInstanceOf(FakeInternalTypes::class, $types); } + /** @requires OS ^Linux|^Darwin */ public function testToConstructor(): void { $module = new class extends AbstractModule { From 704eba1a50e429926b3a3918e4739d81e2362f80 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 24 Feb 2025 01:17:59 +0900 Subject: [PATCH 17/22] Make classes final in DI modules Marking `ProviderSetModule` and `NullModule` as `final` prevents further extension and enforces immutability. This change improves code clarity and ensures that these classes are used as intended. --- src/di/NullModule.php | 2 +- src/di/ProviderSetModule.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/di/NullModule.php b/src/di/NullModule.php index 70926f74..196650a1 100644 --- a/src/di/NullModule.php +++ b/src/di/NullModule.php @@ -4,7 +4,7 @@ namespace Ray\Di; -class NullModule extends AbstractModule +final class NullModule extends AbstractModule { protected function configure(): void { diff --git a/src/di/ProviderSetModule.php b/src/di/ProviderSetModule.php index 94e64c3e..45887f30 100644 --- a/src/di/ProviderSetModule.php +++ b/src/di/ProviderSetModule.php @@ -4,7 +4,7 @@ namespace Ray\Di; -class ProviderSetModule extends AbstractModule +final class ProviderSetModule extends AbstractModule { protected function configure(): void { From ad2cd3a8572ceaf2fe07d06d640eb4bfcff234f1 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 24 Feb 2025 01:18:31 +0900 Subject: [PATCH 18/22] Simplify function name assignment in InjectionPoint. Removed unnecessary typecasting to string for function names, as the `getDeclaringFunction()->name` already returns a string. This improves code clarity and avoids redundant operations. --- src/di/InjectionPoint.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/di/InjectionPoint.php b/src/di/InjectionPoint.php index 7cdc0b07..61f907e3 100644 --- a/src/di/InjectionPoint.php +++ b/src/di/InjectionPoint.php @@ -32,7 +32,7 @@ final class InjectionPoint implements InjectionPointInterface, Serializable public function __construct(ReflectionParameter $parameter) { $this->parameter = $parameter; - $this->pFunction = (string) $parameter->getDeclaringFunction()->name; + $this->pFunction = $parameter->getDeclaringFunction()->name; $class = $parameter->getDeclaringClass(); $this->pClass = $class instanceof ReflectionClass ? $class->name : ''; $this->pName = $parameter->name; From 9c6eeb428f215a9eb76e713e506a37446193b6fa Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 24 Feb 2025 01:18:55 +0900 Subject: [PATCH 19/22] Update psalm config and downgrade sebastian/diff package Suppressed 'MissingOverrideAttribute' errors in psalm configuration to prevent unnecessary warnings. Downgraded the sebastian/diff package from version 7.0.0 to 6.0.2 to maintain compatibility with PHP 8.2 and adjust dependency requirements. --- psalm.xml | 3 +++ vendor-bin/tools/composer.lock | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/psalm.xml b/psalm.xml index e291c803..4e1ca574 100644 --- a/psalm.xml +++ b/psalm.xml @@ -12,4 +12,7 @@ + + + diff --git a/vendor-bin/tools/composer.lock b/vendor-bin/tools/composer.lock index 6a4fa135..fa0f5062 100644 --- a/vendor-bin/tools/composer.lock +++ b/vendor-bin/tools/composer.lock @@ -2689,29 +2689,29 @@ }, { "name": "sebastian/diff", - "version": "7.0.0", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7ab1ea946c012266ca32390913653d844ecd085f" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", - "reference": "7ab1ea946c012266ca32390913653d844ecd085f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { - "php": ">=8.3" + "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^12.0", - "symfony/process": "^7.2" + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "6.0-dev" } }, "autoload": { @@ -2744,7 +2744,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -2752,7 +2752,7 @@ "type": "github" } ], - "time": "2025-02-07T04:55:46+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "slevomat/coding-standard", From 75924fd2af901f59c1b28b91fd9cc9cfc57105d7 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 24 Feb 2025 01:19:07 +0900 Subject: [PATCH 20/22] Update Ray/AOP dependency to ^2.18 Upgraded the Ray/AOP package version from ^2.x-dev to ^2.18 in composer.json. This ensures more stability by relying on a specific version rather than a development branch. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 5448b067..3fc86193 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "koriym/attributes": "^1.0.4", "koriym/null-object": "^1.0", "koriym/param-reader": "^1.0", - "ray/aop": "^2.x-dev", + "ray/aop": "^2.18", "ray/compiler": "^1.10.3" }, "require-dev": { From 3ca6587d2e66a86857e40cd53af909300b5b9e78 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 24 Feb 2025 01:24:20 +0900 Subject: [PATCH 21/22] Soothe phpstan: Fix type annotations and remove unnecessary suppressions Removed redundant inline comments suppressing static analysis warnings in test files. Added explicit type casting for array keys in the Name class to align with strict typing requirements. These changes improve code clarity and maintain consistency with coding standards. --- src/di/Name.php | 2 +- tests/di/DependencyTest.php | 4 ++-- tests/di/NewInstanceTest.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/di/Name.php b/src/di/Name.php index eb3fbb42..66c7a0c7 100644 --- a/src/di/Name.php +++ b/src/di/Name.php @@ -156,7 +156,7 @@ private function parseName(string $name): array } /** @psalm-suppress MixedArgument */ - $names[trim($key)] = trim($value); + $names[trim((string) $key)] = trim($value); } } diff --git a/tests/di/DependencyTest.php b/tests/di/DependencyTest.php index 54448163..fba3e00a 100644 --- a/tests/di/DependencyTest.php +++ b/tests/di/DependencyTest.php @@ -30,7 +30,7 @@ protected function setUp(): void $setters[] = new SetterMethod(new ReflectionMethod(FakeCar::class, 'setTires'), $name); $setters[] = new SetterMethod(new ReflectionMethod(FakeCar::class, 'setHardtop'), $name); $setterMethods = new SetterMethods($setters); - $newInstance = new NewInstance($class, $setterMethods); // @phpstan-ignore-line + $newInstance = new NewInstance($class, $setterMethods); $this->dependency = new Dependency($newInstance, new ReflectionMethod(FakeCar::class, 'postConstruct')); } @@ -105,7 +105,7 @@ public function testSingleton(Container $container): void public function testInjectInterceptor(): void { - $dependency = new Dependency(new NewInstance(new ReflectionClass(FakeAop::class), new SetterMethods([]))); // @phpstan-ignore-line + $dependency = new Dependency(new NewInstance(new ReflectionClass(FakeAop::class), new SetterMethods([]))); $pointcut = new Pointcut((new Matcher())->any(), (new Matcher())->any(), [FakeDoubleInterceptor::class]); $dependency->weaveAspects(new Compiler(__DIR__ . '/tmp'), [$pointcut]); $container = new Container(); diff --git a/tests/di/NewInstanceTest.php b/tests/di/NewInstanceTest.php index 7326b8b7..da3820b7 100644 --- a/tests/di/NewInstanceTest.php +++ b/tests/di/NewInstanceTest.php @@ -23,7 +23,7 @@ protected function setUp(): void $setters[] = new SetterMethod(new ReflectionMethod(FakeCar::class, 'setTires'), $name); $setters[] = new SetterMethod(new ReflectionMethod(FakeCar::class, 'setHardtop'), $name); $setterMethods = new SetterMethods($setters); - $this->newInstance = new NewInstance($class, $setterMethods); // @phpstan-ignore-line + $this->newInstance = new NewInstance($class, $setterMethods); } public function testInvoke(): void From e290e15f88aa25f77ef818f3fdb48a33e44cf692 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 24 Feb 2025 01:31:06 +0900 Subject: [PATCH 22/22] Remove #[Override] annotations from Argument.php The #[Override] annotations were removed as they are unnecessary and do not impact the functionality of the methods. This change simplifies the code without altering its behavior or logic. --- src/di/Argument.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/di/Argument.php b/src/di/Argument.php index 55abd5b4..43d22a9c 100644 --- a/src/di/Argument.php +++ b/src/di/Argument.php @@ -4,7 +4,6 @@ namespace Ray\Di; -use Override; use ReflectionException; use ReflectionMethod; use ReflectionNamedType; @@ -102,7 +101,6 @@ public function serialize(): ?string // @phpstan-ignore-line * * @psalm-param string $data */ - #[Override] public function unserialize($data): void { /** @var array{0: string, 1: bool, 2: string, 3: string, 4: string, 5: array{0: string, 1: string, 2:string}} $array */ @@ -148,7 +146,6 @@ public function __unserialize(array $unserialized): void } /** @inheritDoc */ - #[Override] public function accept(VisitorInterface $visitor) { $visitor->visitArgument(