diff --git a/.laminas-ci.json b/.laminas-ci.json new file mode 100644 index 00000000..d69bf3f1 --- /dev/null +++ b/.laminas-ci.json @@ -0,0 +1,5 @@ +{ + "ignore_php_platform_requirements": { + "8.4": true + } +} diff --git a/README.md b/README.md index 0d9f40b1..80060bcf 100644 --- a/README.md +++ b/README.md @@ -3,19 +3,19 @@ [![Build Status](https://github.com/laminas/laminas-di/workflows/continuous-integration.yml/badge.svg)](https://github.com/laminas/laminas-di/actions/workflows/continuous-integration.yml) > ## πŸ‡·πŸ‡Ί Русским Π³Ρ€Π°ΠΆΠ΄Π°Π½Π°ΠΌ -> +> > ΠœΡ‹, участники Laminas, Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ ΠΈ ΠΆΠΈΠ²Π΅ΠΌ Π² Ρ€Π°Π·Π½Ρ‹Ρ… странах. Π£ ΠΌΠ½ΠΎΠ³ΠΈΡ… ΠΈΠ· нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, родствСнники ΠΈ ΠΊΠΎΠ»Π»Π΅Π³ΠΈ ΠΊΠ°ΠΊ Π² России, Ρ‚Π°ΠΊ ΠΈ Π² Π£ΠΊΡ€Π°ΠΈΠ½Π΅. НСкоторыС ΠΈΠ· нас Ρ€ΠΎΠ΄ΠΈΠ»ΠΈΡΡŒ Π² России. НСкоторыС ΠΈΠ· нас ΠΆΠΈΠ²ΡƒΡ‚ Π² России. Π£ Π½Π΅ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π±Π°Π±ΡƒΡˆΠΊΠΈ ΠΈ Π΄Π΅Π΄ΡƒΡˆΠΊΠΈ ΡΡ€Π°ΠΆΠ°Π»ΠΈΡΡŒ с Ρ„Π°ΡˆΠΈΡΡ‚Π°ΠΌΠΈ Π²ΠΎ Π’Ρ‚ΠΎΡ€ΠΎΠΉ ΠΌΠΈΡ€ΠΎΠ²ΠΎΠΉ Π²ΠΎΠΉΠ½Π΅. Π—Π΄Π΅ΡΡŒ Π½ΠΈΠΊΡ‚ΠΎ Π½Π΅ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΈΠ²Π°Π΅Ρ‚ Ρ„Π°ΡˆΠΈΠ·ΠΌ. -> +> > Π£ ΠΎΠ΄Π½ΠΎΠ³ΠΎ ΠΈΠ· нас Π΅ΡΡ‚ΡŒ украинская родствСнница, которая спаслась ΠΈΠ· Π΄ΠΎΠΌΠ° вмСстС с сыном. ПоСзд задСрТался ΠΈΠ·-Π·Π° Π±ΠΎΠΌΠ±Π΅ΠΆΠΊΠΈ Π½Π° Π΄ΠΎΡ€ΠΎΠ³Π΅ Π²ΠΏΠ΅Ρ€Π΅Π΄ΠΈ. Π£ нас Π΅ΡΡ‚ΡŒ Π΄Ρ€ΡƒΠ·ΡŒΡ, ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ прячутся Π² Π±ΠΎΠΌΠ±ΠΎΡƒΠ±Π΅ΠΆΠΈΡ‰Π°Ρ…. ΠœΡ‹ с Ρ‚Ρ€Π΅Π²ΠΎΠ³ΠΎΠΉ ΠΆΠ΄Π΅ΠΌ вСсточки ΠΎΡ‚ Π½ΠΈΡ… послС Π²ΠΎΠ·Π΄ΡƒΡˆΠ½Ρ‹Ρ… Π½Π°Π»Π΅Ρ‚ΠΎΠ², ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Π΅ бСспорядочно наносят ΡƒΠ΄Π°Ρ€Ρ‹ ΠΈ ΠΏΠΎΠΏΠ°Π΄Π°ΡŽΡ‚ ΠΏΠΎ Π±ΠΎΠ»ΡŒΠ½ΠΈΡ†Π°ΠΌ, школам, дСтским садам ΠΈ Π΄ΠΎΠΌΠ°ΠΌ. ΠœΡ‹ Π½Π΅ Π±Π΅Ρ€Π΅ΠΌ это ΠΈΠ· ΠΊΠ°ΠΊΠΈΡ…-Π»ΠΈΠ±ΠΎ БМИ. ΠœΡ‹ наблюдаСм это Π½Π°ΠΏΡ€ΡΠΌΡƒΡŽ. -> +> > Π’Ρ‹ довСряСтС Π½Π°ΠΌ достаточно, Ρ‡Ρ‚ΠΎΠ± ΠΈΡΠΏΠΎΠ»ΡŒΠ·ΠΎΠ²Π°Ρ‚ΡŒ наши ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΡ‹, ΠΈ ΠΌΡ‹ просим вас Π΄ΠΎΠ²Π΅Ρ€ΠΈΡ‚ΡŒΡΡ Π½Π°ΠΌ вновь. ΠœΡ‹ нуТдаСмся Π² ΠΏΠΎΠΌΠΎΡ‰ΠΈ. Π’Ρ‹Ρ…ΠΎΠ΄ΠΈΡ‚Π΅ ΠΈ протСстуйтС ΠΏΡ€ΠΎΡ‚ΠΈΠ² этой бСсполСзной Π²ΠΎΠΉΠ½Ρ‹. ΠžΡΡ‚Π°Π½ΠΎΠ²ΠΈΡ‚Π΅ ΠΊΡ€ΠΎΠ²ΠΎΠΏΡ€ΠΎΠ»ΠΈΡ‚ΠΈΠ΅. Π‘ΠΊΠ°ΠΆΠΈΡ‚Π΅ "НСт Π²ΠΎΠΉΠ½Π΅!" -> +> > ## πŸ‡ΊπŸ‡Έ To Citizens of Russia -> +> > We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism. -> +> > One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences. -> +> > You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!" laminas-di provides autowiring to implement Inversion of Control (IoC) containers. @@ -27,10 +27,10 @@ laminas-di is designed to be simple, fast and reusable. It provides the followin - Constructor injection - Autowiring: - - Recursively through all dependencies - - With configured type preferences - - with configured injections - - With injections passed in the create() call + - Recursively through all dependencies + - With configured type preferences + - with configured injections + - With injections passed in the create() call - Code generators to create factories usable by other IoC containers like Laminas\ServiceManager It does __not__ provide: @@ -38,8 +38,8 @@ It does __not__ provide: - Setter, interface, property or any other injection method than constructor injection - Support for factories - Declaring shared/unshared instances - - the injector always creates new instances - - the default container always shares instances + - the injector always creates new instances + - the default container always shares instances - Support for variadic arguments in __construct If you need these features combine it with another IoC container such as diff --git a/composer.json b/composer.json index b5963dbb..a03fd4ed 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ } }, "require": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0", "laminas/laminas-stdlib": "^3.18.0", "psr/container": "^1.1.1", "psr/log": "^1.1.4 || ^2.0.0 || ^3.0.0" @@ -40,9 +40,9 @@ "require-dev": { "laminas/laminas-coding-standard": "~2.5.0", "laminas/laminas-servicemanager": "^3.22", - "mikey179/vfsstream": "^1.6.11@alpha", + "mikey179/vfsstream": "^1.6.12", "phpbench/phpbench": "^1.2.7", - "phpunit/phpunit": "^9.5.26", + "phpunit/phpunit": "^9.6.22", "psalm/plugin-phpunit": "^0.18.0", "squizlabs/php_codesniffer": "^3.7.1", "vimeo/psalm": "^5.0" @@ -50,7 +50,8 @@ "conflict": { "zendframework/zend-di": "*", "laminas/laminas-servicemanager-di": "*", - "laminas/laminas-servicemanager": "<3.13.0 || >=4.0.0" + "laminas/laminas-servicemanager": "<3.13.0 || >=4.0.0", + "amphp/amp": "<2.6.4" }, "suggest": { "laminas/laminas-servicemanager": "An IoC container without auto wiring capabilities" diff --git a/composer.lock b/composer.lock index 7ce7a850..85c3008d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7d8521a1f873c276a9efa8b578b35564", + "content-hash": "e22f4db913ba34434d4ff80e9b643cc4", "packages": [ { "name": "laminas/laminas-stdlib", @@ -425,13 +425,13 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - }, "phpstan": { "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-main": "3.x-dev" } }, "autoload": { @@ -1321,16 +1321,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.1", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", - "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { @@ -1369,7 +1369,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -1377,7 +1377,7 @@ "type": "tidelift" } ], - "time": "2024-11-08T17:47:46+00:00" + "time": "2025-02-12T12:17:51+00:00" }, { "name": "netresearch/jsonmapper", @@ -1655,70 +1655,18 @@ }, "time": "2023-10-30T13:38:26+00:00" }, - { - "name": "phpbench/dom", - "version": "0.3.3", - "source": { - "type": "git", - "url": "https://github.com/phpbench/dom.git", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpbench/dom/zipball/786a96db538d0def931f5b19225233ec42ec7a72", - "reference": "786a96db538d0def931f5b19225233ec42ec7a72", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "php": "^7.3||^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.14", - "phpstan/phpstan": "^1.10", - "phpunit/phpunit": "^8.0||^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpBench\\Dom\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Daniel Leech", - "email": "daniel@dantleech.com" - } - ], - "description": "DOM wrapper to simplify working with the PHP DOM implementation", - "support": { - "issues": "https://github.com/phpbench/dom/issues", - "source": "https://github.com/phpbench/dom/tree/0.3.3" - }, - "abandoned": true, - "time": "2023-03-06T23:46:57+00:00" - }, { "name": "phpbench/phpbench", - "version": "1.3.1", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpbench/phpbench.git", - "reference": "a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0" + "reference": "4248817222514421cba466bfa7adc7d8932345d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpbench/phpbench/zipball/a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0", - "reference": "a3e1ef08d9d7736d43a7fbd444893d6a073c0ca0", + "url": "https://api.github.com/repos/phpbench/phpbench/zipball/4248817222514421cba466bfa7adc7d8932345d4", + "reference": "4248817222514421cba466bfa7adc7d8932345d4", "shasum": "" }, "require": { @@ -1731,7 +1679,6 @@ "ext-tokenizer": "*", "php": "^8.1", "phpbench/container": "^2.2", - "phpbench/dom": "~0.3.3", "psr/log": "^1.1 || ^2.0 || ^3.0", "seld/jsonlint": "^1.1", "symfony/console": "^6.1 || ^7.0", @@ -1750,8 +1697,8 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.0", "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^10.4", - "rector/rector": "^0.18.11 || ^1.0.0", + "phpunit/phpunit": "^10.4 || ^11.0", + "rector/rector": "^1.2", "symfony/error-handler": "^6.1 || ^7.0", "symfony/var-dumper": "^6.1 || ^7.0" }, @@ -1796,7 +1743,7 @@ ], "support": { "issues": "https://github.com/phpbench/phpbench/issues", - "source": "https://github.com/phpbench/phpbench/tree/1.3.1" + "source": "https://github.com/phpbench/phpbench/tree/1.4.0" }, "funding": [ { @@ -1804,7 +1751,7 @@ "type": "github" } ], - "time": "2024-06-30T11:04:37+00:00" + "time": "2025-01-26T19:54:45+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2336,16 +2283,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.21", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -2356,7 +2303,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -2419,7 +2366,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -2435,7 +2382,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:50:18+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "psalm/plugin-phpunit", @@ -3636,16 +3583,16 @@ }, { "name": "spatie/array-to-xml", - "version": "3.3.0", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/spatie/array-to-xml.git", - "reference": "f56b220fe2db1ade4c88098d83413ebdfc3bf876" + "reference": "7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/f56b220fe2db1ade4c88098d83413ebdfc3bf876", - "reference": "f56b220fe2db1ade4c88098d83413ebdfc3bf876", + "url": "https://api.github.com/repos/spatie/array-to-xml/zipball/7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67", + "reference": "7dcfc67d60b0272926dabad1ec01f6b8a5fb5e67", "shasum": "" }, "require": { @@ -3688,7 +3635,7 @@ "xml" ], "support": { - "source": "https://github.com/spatie/array-to-xml/tree/3.3.0" + "source": "https://github.com/spatie/array-to-xml/tree/3.4.0" }, "funding": [ { @@ -3700,20 +3647,20 @@ "type": "github" } ], - "time": "2024-05-01T10:20:27+00:00" + "time": "2024-12-16T12:45:15+00:00" }, { "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": { @@ -3778,22 +3725,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/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": { @@ -3858,7 +3809,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.4.15" + "source": "https://github.com/symfony/console/tree/v6.4.17" }, "funding": [ { @@ -3874,20 +3825,20 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2024-12-07T12:07:30+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", - "reference": "0e0d29ce1f20deffb4ab1b016a7257c4f1e789a1", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -3895,12 +3846,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": { @@ -3925,7 +3876,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -3941,7 +3892,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", @@ -4011,16 +3962,16 @@ }, { "name": "symfony/finder", - "version": "v6.4.13", + "version": "v6.4.17", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "daea9eca0b08d0ed1dc9ab702a46128fd1be4958" + "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/daea9eca0b08d0ed1dc9ab702a46128fd1be4958", - "reference": "daea9eca0b08d0ed1dc9ab702a46128fd1be4958", + "url": "https://api.github.com/repos/symfony/finder/zipball/1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", + "reference": "1d0e8266248c5d9ab6a87e3789e6dc482af3c9c7", "shasum": "" }, "require": { @@ -4055,7 +4006,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.4.13" + "source": "https://github.com/symfony/finder/tree/v6.4.17" }, "funding": [ { @@ -4071,20 +4022,20 @@ "type": "tidelift" } ], - "time": "2024-10-01T08:30:56+00:00" + "time": "2024-12-29T13:51:37+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.4.13", + "version": "v6.4.16", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db" + "reference": "368128ad168f20e22c32159b9f761e456cec0c78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0a62a9f2504a8dd27083f89d21894ceb01cc59db", - "reference": "0a62a9f2504a8dd27083f89d21894ceb01cc59db", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/368128ad168f20e22c32159b9f761e456cec0c78", + "reference": "368128ad168f20e22c32159b9f761e456cec0c78", "shasum": "" }, "require": { @@ -4122,7 +4073,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.13" + "source": "https://github.com/symfony/options-resolver/tree/v6.4.16" }, "funding": [ { @@ -4138,7 +4089,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-11-20T10:57:02+00:00" }, { "name": "symfony/polyfill-ctype", @@ -4166,8 +4117,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4242,8 +4193,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4320,8 +4271,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4404,8 +4355,8 @@ "type": "library", "extra": { "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -4521,16 +4472,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.5.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", - "reference": "bd1d9e59a81d8fa4acdcea3f617c581f7475a80f", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { @@ -4543,12 +4494,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": { @@ -4584,7 +4535,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.5.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -4600,7 +4551,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:32:20+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/string", @@ -4813,11 +4764,11 @@ "type": "project", "extra": { "branch-alias": { - "dev-master": "5.x-dev", - "dev-4.x": "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-4.x": "4.x-dev", + "dev-master": "5.x-dev" } }, "autoload": { @@ -5013,17 +4964,15 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "mikey179/vfsstream": 15 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "platform-dev": [], "platform-overrides": { "php": "8.1.99" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/docs/book/v3/codegen.md b/docs/book/v3/codegen.md index 6f8b479a..bb39f04b 100644 --- a/docs/book/v3/codegen.md +++ b/docs/book/v3/codegen.md @@ -5,7 +5,7 @@ generators to create optimized code for production. These generators will inspect the provided classes, resolve their dependencies, and generate factories based on these results. - + > ### Removal of laminas-code dependencies > > Before version 3.1, this feature required [laminas-code](https://docs.laminas.dev/laminas-code/), diff --git a/docs/book/v3/config.md b/docs/book/v3/config.md index 993fcdf3..200b0004 100644 --- a/docs/book/v3/config.md +++ b/docs/book/v3/config.md @@ -15,15 +15,15 @@ The configuration array respects the following keys (unknown keys are ignored): constructed. Each key in this array is a class or alias name, and its value is another associative array with the following keys: - - `preferences`: The same as `preferences` above, but only for the associated + - `preferences`: The same as `preferences` above, but only for the associated class. - - `parameters`: Associative array declaring the values to inject for the + - `parameters`: Associative array declaring the values to inject for the declared construction parameters. Each key is the parameter name as declared in the constructor method of the associated class name. See the [Parameters](#parameters) section below for details. - - `typeOf`: String that contains a class name. It declares that the + - `typeOf`: String that contains a class name. It declares that the associated key is an alias of the given class name. This class must exist. It cannot be another alias. diff --git a/docs/book/v3/cookbook/aot-guide.md b/docs/book/v3/cookbook/aot-guide.md index 8c8477af..02810d48 100644 --- a/docs/book/v3/cookbook/aot-guide.md +++ b/docs/book/v3/cookbook/aot-guide.md @@ -358,7 +358,7 @@ class ConfigProvider ``` > ### Custom delegator factory (before version 3.2) -> +> > The `Laminas\Di\GeneratedInjectorDelegator` class is available since version 3.2. For > prior versions of laminas-di, a custom delegator factory must be provided. > diff --git a/docs/book/v3/cookbook/use-with-servicemanager.md b/docs/book/v3/cookbook/use-with-servicemanager.md index 12893f5b..f379c2ae 100644 --- a/docs/book/v3/cookbook/use-with-servicemanager.md +++ b/docs/book/v3/cookbook/use-with-servicemanager.md @@ -46,7 +46,6 @@ return [ ]; ``` - ## Service Factory For AoT Code Generation laminas-di also provides a factory for `Laminas\Di\CodeGenerator\InjectorGenerator`. diff --git a/docs/book/v3/injector.md b/docs/book/v3/injector.md index 58dfecda..7a2dc7ff 100644 --- a/docs/book/v3/injector.md +++ b/docs/book/v3/injector.md @@ -38,9 +38,9 @@ Generally the following behavior applies for parameter values that are not `ValueInjection` or `TypeInjection` instances: - If the parameter has a class/interface typehint: - - string values will be wrapped into a `TypeInjection` instance - - objects are wrapped into a `ValueInjection` instance - - everything else will fail with an exception. + - string values will be wrapped into a `TypeInjection` instance + - objects are wrapped into a `ValueInjection` instance + - everything else will fail with an exception. - If the parameter has a scalar or pseudo-type typehint (e.g. string, int, iterable, callable, etc ...), the value will be wrapped in a `ValueInjection`. diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 587f5c7b..338ff4c4 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,561 +1,597 @@ - + - - $this->injector->create($name, $options) + + injector->create($name, $options)]]> - - T + + - - $this->getFactory($name)->create($this->container, $options) + + getFactory($name)->create($this->container, $options)]]> + + + + + + + + + + + outputDirectory]]> + + - - $definition + + + + + - - $this->types[$context]['preferences'][$type] + + types[$context]['preferences'][$type]]]> + + + + - - mixed + + - - $this->create($container, (string) $requestedName, $options) - $this->getInjector($container)->create($requestedName, $options ?: []) + + create($container, (string) $requestedName, $options)]]> + getInjector($container)->create($requestedName, $options ?: [])]]> - - T - T + + + + + + + + + + + + - - InvalidParamNameException + + - - InvalidPositionException + + - - $name + + - - $instance + + - - T + + - - $params + + - - $foundParams[] + + - - (int) $containerException->getCode() + + getCode()]]> - - export - getParameterName - isExportable - setParameterName + + + + + - - $type - $type + + + + + + + + + + + + + + - - self + + + + + + + - - $provider + + - - $invokable + + - - testFactoryIsCreatedFromClassNameString + + + - - testGenerateCreatesFiles - testGeneratedAutoloadFile - testGeneratedAutoloaderClass + + + + - - $dir - $dir - $dir - $root - $root - $root + + + + + + + - - + + + + + + - - $this->fixture + + fixture]]> - - testCanCreateReturnsFalseWithoutInjector - testCanCreateUsesInjector - testCreateUsesInjector - testCreateWithInvalidInjectorThrowsException - testCreateWithoutInjectorThrowsException - testInstanceIsInvokable + + + + + + + - - testCreateRequestsContainerForConfigServiceGracefully - testCreateUsesConfigFromContainer - testInvokeCreatesConfigInstance - testLegacyConfigIsRespected + + + + + - - null + + - - expectDeprecation - + + + + - - setMethods + + - - $mock($container) + + - - $type + + - - setAccessible + + + - - testCreateWillReturnAnInjectorInstance - testFactoryIsInvokable - testInvokeWillReturnAnInjectorInstance - testUsesConfigServiceFromContainer + + + + + - - setAccessible + + - - testCanCreateIsPassedToGenericFactory - testInvokeIsPassedToGenericFactory + + + - - assertIsArray - assertIsArray - assertIsArray - assertIsArray - assertIsArray - assertIsArray - assertIsArray + + + + + + + + - - testBuiltinTypehintedParameters - testIterablePseudoType - testParamterReflectedCorrectly - testScalarTypehintedParameters - testTypehintedParameter - testTypelessParamter + + + + + + + - - array - array + + + - - $classname + + - - array - array - array + + + + - - $class - [$class] + + + - - testAddExplicitClass - testAddInvalidExplicitClassThrowsException - testHasClassReturnsFalseForInvalidClasses - testSetExplicitClasses - testSetExplicitClassesViaConstructor - testSetInvalidExplicitClassThrowsException + + + + + + + - - array + + - - new stdClass() + + - - include $file->getPathname() + + getPathname()]]> - - expectDeprecation - - - toValue - toValue + + + - - $result['p'] + + - - $class + + - - testConfiguredExtendedInterfaceParameterSatisfiesRequiredInterfaceType - testConfiguredInvokableAliasParameterSatisfiesCallable - testConfiguredInvokableTypeParameterSatisfiesCallable - testConfiguredTraversableTypeParameterSatisfiesIterable - testParametresResolverShouldNotCheckTheTypeForString - testResolvePreferenceFallsBackToGlobalPreferenceWhenNotSuitableForClassRequirement - testResolvePreferenceFallsBackToGlobalPreferenceWhenNotSuitableForInterfaceRequirement - testResolvePreferenceReturnsNullWhenNothingIsSuitableForClassRequirement - testResolvePreferenceReturnsNullWhenNothingIsSuitableForInterfaceRequirement - testResolvePreferenceUsesDefinedClassForInterfaceRequirements - testResolvePreferenceUsesInterfaces - testResolvePreferenceUsesSupertypes - testResolveSucceedsWithoutContainer - testResolveWithContainerFailsWhenMissing - testResolveWithoutConfig - testUsableConfigParametersAreAccepted + + + + + + + + + + + + + + + + + - - IteratorAggregate + + - - $config - $options - $options - $options['interfaces'] - $options['parameters'] - $options['supertypes'] + + + + + + + - - $class - $name + + + - - $config['expect'] - $context - $expectedResult - $requested + + + + + - - $definition[$class] + + - - $config - $expectation - $key - $options - $options - [$requested, $expectedResult, $context] + + + + + + + - - PHPUnit_Framework_MockObject_MockObject|ContainerInterface - array - array - array - array - array + + + + + + + - - $key + + - - $this->getEmptyContainerMock() + + getEmptyContainerMock()]]> - - assertIsArray - assertIsArray - assertIsArray - assertIsArray + + + + + - - PHPUnit_Framework_MockObject_MockObject|ContainerInterface + + - - include $configFile + + - - $name - - - getType - expectDeprecation + + - - testExport - testGetTypeIsDeprectaed - testImplementsContract - testIsExportableIsAlwaysTrue - testToValueUsesContainer + + + + + + - - iterable + + - - getValue - expectDeprecation + + - - $this->streamFixture + + streamFixture]]> - - testExportThrowsExceptionForUnexportable - testExportWithExportableValues - testGetValueTriggersDeprecatedNotice - testImplementsContract - testIsExportableReturnsFalseForUnexportable - testIsExportableReturnsTrueForExportableValues - testSetStateConstructsInstance - testToValueBypassesContainer + + + + + + + + + - - array - array - array + + + + - - null + + - - assertIsString + + - - arrayType - callableType + + + - - $p - $r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - $a - $b - $c - $d - $e - $f + + + + + + + - - $result + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - $this->injector->create($name, $options) + + injector->create($name, $options)]]> - - T + + - - __invoke + + + + + + + - - general - typehintOptional - typehintRequired - typelessOptional - typelessRequired + + + + + + - - general - typehintRequired - typelessRequired - typehintOptional - typelessOptional + + + + + + + + - - Traversable + + - - bool + + + + + + + + + + + + - - boolType - floatType - intType - stringType + + + + + - - $p + + + + + - - - has - get - - - - - expectErrorMessage - - - - - expectDeprecation - expectDeprecationMessage - - - - - $b - - - - - $a - - - - - $d - - - - - $e - - - - - $c - - - - - $x - - - - - $y - - - - - $first - $second - $third - - - - - $a - $b - - - - - $objectDep - $anyDep - - - - - $foo - $bar - - - - - $stringDep - $numDep - $callbacDep - - - - - $objectDep - $internalClassDep - $anyDep - - - - - $iterator - - - - - $p - - - - - $data - - diff --git a/test/CodeGenerator/GeneratorTraitTest.php b/test/CodeGenerator/GeneratorTraitTest.php index 618e1b9a..a1ec3634 100644 --- a/test/CodeGenerator/GeneratorTraitTest.php +++ b/test/CodeGenerator/GeneratorTraitTest.php @@ -15,7 +15,7 @@ public function testEnsureDirectoryGivenInvalidDirectoryNameExpectedErrorMessage $invalidDir = 'http://www.invalid-directory'; $this->expectException(GenerateCodeException::class); - $this->expectErrorMessage('Could not create output directory: ' . $invalidDir); + $this->expectExceptionMessage('Could not create output directory: ' . $invalidDir); new class (__DIR__, $invalidDir) { diff --git a/test/Container/ConfigFactoryTest.php b/test/Container/ConfigFactoryTest.php index 1365e90c..37a2da4d 100644 --- a/test/Container/ConfigFactoryTest.php +++ b/test/Container/ConfigFactoryTest.php @@ -134,7 +134,20 @@ public function testLegacyConfigTriggersDeprecationNotice(): void ], ]); - $this->expectDeprecation(); + $deprecationTriggered = false; + + set_error_handler(static function ($errno, $errstr) use (&$deprecationTriggered) { + if ($errno === E_USER_DEPRECATED && strstr($errstr, 'legacy DI config')) { + $deprecationTriggered = true; + return true; + } + return false; + }, E_USER_DEPRECATED); + (new ConfigFactory())->create($container); + + restore_error_handler(); + + $this->assertTrue($deprecationTriggered, 'Expected deprecation notice was triggered.'); } } diff --git a/test/LegacyConfigTest.php b/test/LegacyConfigTest.php index 1c77c49f..c21373ee 100644 --- a/test/LegacyConfigTest.php +++ b/test/LegacyConfigTest.php @@ -12,6 +12,11 @@ use SplFileInfo; use stdClass; +use function restore_error_handler; +use function set_error_handler; + +use const E_USER_DEPRECATED; + /** * @coversDefaultClass Laminas\Di\LegacyConfig */ @@ -52,17 +57,29 @@ public function testLegacyConfigMigration(array $config, array $expected): void public function testFQParamNamesTriggerDeprecated(): void { - $this->expectDeprecation(); + $expectedMessage = 'Full qualified parameter positions are no longer supported'; - new LegacyConfig([ - 'instance' => [ - 'FooClass' => [ - 'parameters' => [ - 'BarClass:__construct:0' => 'Value for fq param name', + set_error_handler(function ($errno, $errstr) use ($expectedMessage) { + if ($errno === E_USER_DEPRECATED) { + $this->assertStringContainsString($expectedMessage, $errstr); + return true; + } + return false; + }, E_USER_DEPRECATED); + + try { + new LegacyConfig([ + 'instance' => [ + 'FooClass' => [ + 'parameters' => [ + 'BarClass:__construct:0' => 'Value for fq param name', + ], ], ], - ], - ]); + ]); + } finally { + restore_error_handler(); + } } public function testConstructWithTraversable(): void diff --git a/test/Resolver/AbstractInjectionTest.php b/test/Resolver/AbstractInjectionTest.php index 9db15b26..e0f5cc12 100644 --- a/test/Resolver/AbstractInjectionTest.php +++ b/test/Resolver/AbstractInjectionTest.php @@ -8,30 +8,45 @@ use Laminas\Di\Resolver\InjectionInterface; use PHPUnit\Framework\TestCase; +use function restore_error_handler; +use function set_error_handler; use function sprintf; +use const E_USER_DEPRECATED; + class AbstractInjectionTest extends TestCase { public function testUsageIsDeprecated(): void { - $this->expectDeprecation(); - $this->expectDeprecationMessage(sprintf( + $expectedMessage = sprintf( '%s is deprecated, please migrate to %s', AbstractInjection::class, InjectionInterface::class - )); + ); - new class () extends AbstractInjection - { - public function export(): string - { - return ''; + set_error_handler(function ($errno, $errstr) use ($expectedMessage) { + if ($errno === E_USER_DEPRECATED) { + $this->assertStringContainsString($expectedMessage, $errstr); + return true; } + return false; + }, E_USER_DEPRECATED); - public function isExportable(): bool + try { + new class () extends AbstractInjection { - return true; - } - }; + public function export(): string + { + return ''; + } + + public function isExportable(): bool + { + return true; + } + }; + } finally { + restore_error_handler(); + } } } diff --git a/test/Resolver/TypeInjectionTest.php b/test/Resolver/TypeInjectionTest.php index 2e2dd3f2..5c6c2f5a 100644 --- a/test/Resolver/TypeInjectionTest.php +++ b/test/Resolver/TypeInjectionTest.php @@ -11,9 +11,13 @@ use Psr\Container\ContainerInterface; use stdClass; +use function restore_error_handler; +use function set_error_handler; use function sprintf; use function uniqid; +use const E_USER_DEPRECATED; + /** * @covers \Laminas\Di\Resolver\TypeInjection */ @@ -64,8 +68,21 @@ public function testIsExportableIsAlwaysTrue(string $typeName) public function testGetTypeIsDeprectaed() { - $subject = new TypeInjection('SomeType'); - $this->expectDeprecation(); - $this->assertSame('SomeType', $subject->getType()); + $expectedMessage = 'Laminas\Di\Resolver\TypeInjection::getType is deprecated. Please migrate to __toString()'; + + set_error_handler(function ($errno, $errstr) use ($expectedMessage) { + if ($errno === E_USER_DEPRECATED) { + $this->assertStringContainsString($expectedMessage, $errstr); + return true; + } + return false; + }, E_USER_DEPRECATED); + + try { + $subject = new TypeInjection('SomeType'); + $subject->getType(); + } finally { + restore_error_handler(); + } } } diff --git a/test/Resolver/ValueInjectionTest.php b/test/Resolver/ValueInjectionTest.php index 59fe710b..5c265979 100644 --- a/test/Resolver/ValueInjectionTest.php +++ b/test/Resolver/ValueInjectionTest.php @@ -15,9 +15,13 @@ use function fclose; use function fopen; use function microtime; +use function restore_error_handler; +use function set_error_handler; use function time; use function uniqid; +use const E_USER_DEPRECATED; + /** @covers \Laminas\Di\Resolver\ValueInjection */ class ValueInjectionTest extends TestCase { @@ -176,7 +180,20 @@ public function testGetValueTriggersDeprecatedNotice() $value = uniqid(); $subject = new ValueInjection($value); - $this->expectDeprecation(); - self::assertSame($value, $subject->getValue()); + $expectedMessage = 'ValueInjection::getValue is deprecated'; + + set_error_handler(function ($errno, $errstr) use ($expectedMessage) { + if ($errno === E_USER_DEPRECATED) { + $this->assertStringContainsString($expectedMessage, $errstr); + return true; + } + return false; + }, E_USER_DEPRECATED); + + try { + self::assertSame($value, $subject->getValue()); + } finally { + restore_error_handler(); + } } } diff --git a/test/TestAsset/CircularClasses/Y.php b/test/TestAsset/CircularClasses/Y.php index 04b7034e..189201c9 100644 --- a/test/TestAsset/CircularClasses/Y.php +++ b/test/TestAsset/CircularClasses/Y.php @@ -9,7 +9,7 @@ class Y { // @codingStandardsIgnoreStart - public function __construct(Y $y = null) + public function __construct(?Y $y = null) { } }