From 1a397207c04baa9908237736e89ef9bf204afc8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Sun, 10 Nov 2024 20:38:29 +0100 Subject: [PATCH 1/2] Enforce compatibility with PHP 8.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Luís Cobucci --- .github/workflows/phpunit.yml | 4 +++- composer.json | 2 +- composer.lock | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index d87efe45..51f3d4d2 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -19,6 +19,8 @@ jobs: - "locked" php-version: - "8.2" + - "8.3" + - "8.4" operating-system: ["ubuntu-latest"] steps: @@ -112,7 +114,7 @@ jobs: strategy: matrix: dependencies: ["locked"] - php-version: ["8.3"] + php-version: ["8.5"] operating-system: ["ubuntu-latest"] steps: diff --git a/composer.json b/composer.json index c8cad15d..00b8b0db 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "homepage": "https://github.com/lcobucci/di-builder", "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", "symfony/config": "^6.3.2", "symfony/dependency-injection": "^6.3.2", "symfony/expression-language": "^6.3.0", diff --git a/composer.lock b/composer.lock index 66ef0e38..2c96ece5 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": "d49400b9b42afb492037407277a8f7f0", + "content-hash": "2b8ac5c2065fac22d9ed926678ded57f", "packages": [ { "name": "psr/cache", @@ -4978,12 +4978,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~8.2.0 || ~8.3.0" + "php": "~8.2.0 || ~8.3.0 || ~8.4.0" }, - "platform-dev": {}, + "platform-dev": [], "plugin-api-version": "2.6.0" } From 1909d019ff11195053c579841a20870a3caf6fef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Sun, 10 Nov 2024 20:49:26 +0100 Subject: [PATCH 2/2] Fix compatibility with Symfony 7+ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From this version there's no need to set container parameters to inline components, instead we should configure options during the compilation. This drops the parameter configuration from everywhere and simplifies the build process. Signed-off-by: Luís Cobucci --- composer.json | 28 ++--- composer.lock | 186 +++++++++++++++++----------------- src/Compiler.php | 3 + src/ContainerBuilder.php | 4 - test/CompilerTest.php | 3 - test/ContainerBuilderTest.php | 4 - 6 files changed, 109 insertions(+), 119 deletions(-) diff --git a/composer.json b/composer.json index 00b8b0db..c6074b78 100644 --- a/composer.json +++ b/composer.json @@ -17,23 +17,23 @@ "homepage": "https://github.com/lcobucci/di-builder", "require": { "php": "~8.2.0 || ~8.3.0 || ~8.4.0", - "symfony/config": "^6.3.2", - "symfony/dependency-injection": "^6.3.2", - "symfony/expression-language": "^6.3.0", - "symfony/filesystem": "^6.3.1" + "symfony/config": "^7.1", + "symfony/dependency-injection": "^7.1", + "symfony/expression-language": "^7.1", + "symfony/filesystem": "^7.1" }, "require-dev": { "infection/infection": "^0.29", - "lcobucci/coding-standard": "^11.0.0", - "mikey179/vfsstream": "^1.6.11", - "phpstan/extension-installer": "^1.2.0", - "phpstan/phpstan": "^1.10.13", - "phpstan/phpstan-deprecation-rules": "^1.1.3", - "phpstan/phpstan-phpunit": "^1.3.11", - "phpstan/phpstan-strict-rules": "^1.5.1", - "phpunit/phpunit": "^11.0", - "squizlabs/php_codesniffer": "^3.7.2", - "symfony/yaml": "^6.3.3" + "lcobucci/coding-standard": "^11.1", + "mikey179/vfsstream": "^1.6.12", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-deprecation-rules": "^1.2", + "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan-strict-rules": "^1.6", + "phpunit/phpunit": "^11.4", + "squizlabs/php_codesniffer": "^3.10", + "symfony/yaml": "^7.1" }, "replace": { "symfony/polyfill-php71": "*", diff --git a/composer.lock b/composer.lock index 2c96ece5..43e9bd53 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": "2b8ac5c2065fac22d9ed926678ded57f", + "content-hash": "799784b0c95ee6673969ecf6f26fa7f2", "packages": [ { "name": "psr/cache", @@ -160,16 +160,16 @@ }, { "name": "symfony/cache", - "version": "v7.1.6", + "version": "v7.1.7", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "567ef6de47fdcba56eb6c0b344b857d1fce1cce0" + "reference": "23b61c9592ee72233c31625f0ae805dd1571e928" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/567ef6de47fdcba56eb6c0b344b857d1fce1cce0", - "reference": "567ef6de47fdcba56eb6c0b344b857d1fce1cce0", + "url": "https://api.github.com/repos/symfony/cache/zipball/23b61c9592ee72233c31625f0ae805dd1571e928", + "reference": "23b61c9592ee72233c31625f0ae805dd1571e928", "shasum": "" }, "require": { @@ -237,7 +237,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.1.6" + "source": "https://github.com/symfony/cache/tree/v7.1.7" }, "funding": [ { @@ -253,7 +253,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:39:55+00:00" + "time": "2024-11-05T15:34:55+00:00" }, { "name": "symfony/cache-contracts", @@ -333,34 +333,34 @@ }, { "name": "symfony/config", - "version": "v6.4.14", + "version": "v7.1.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "4e55e7e4ffddd343671ea972216d4509f46c22ef" + "reference": "dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/4e55e7e4ffddd343671ea972216d4509f46c22ef", - "reference": "4e55e7e4ffddd343671ea972216d4509f46c22ef", + "url": "https://api.github.com/repos/symfony/config/zipball/dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8", + "reference": "dc373a5cbd345354696f5dfd39c5c7a8ea23f4c8", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^7.1", "symfony/polyfill-ctype": "~1.8" }, "conflict": { - "symfony/finder": "<5.4", + "symfony/finder": "<6.4", "symfony/service-contracts": "<2.5" }, "require-dev": { - "symfony/event-dispatcher": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -388,7 +388,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.4.14" + "source": "https://github.com/symfony/config/tree/v7.1.7" }, "funding": [ { @@ -404,44 +404,43 @@ "type": "tidelift" } ], - "time": "2024-11-04T11:33:53+00:00" + "time": "2024-11-04T11:34:07+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.4.13", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96" + "reference": "1f12f9d580ef8dd09e3b756aa111cc2d5f311bfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96", - "reference": "728ae8f4e190133ce99d6d5f0bc1e8c8bd7c7a96", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1f12f9d580ef8dd09e3b756aa111cc2d5f311bfd", + "reference": "1f12f9d580ef8dd09e3b756aa111cc2d5f311bfd", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.5|^3", - "symfony/service-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.2.10|^7.0" + "symfony/service-contracts": "^3.5", + "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { "ext-psr": "<1.1|>=2", - "symfony/config": "<6.1", - "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<6.3", - "symfony/yaml": "<5.4" + "symfony/config": "<6.4", + "symfony/finder": "<6.4", + "symfony/yaml": "<6.4" }, "provide": { "psr/container-implementation": "1.1|2.0", "symfony/service-implementation": "1.1|2.0|3.0" }, "require-dev": { - "symfony/config": "^6.1|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/yaml": "^5.4|^6.0|^7.0" + "symfony/config": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/yaml": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -469,7 +468,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.4.13" + "source": "https://github.com/symfony/dependency-injection/tree/v7.1.6" }, "funding": [ { @@ -485,7 +484,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-10-25T15:11:02+00:00" }, { "name": "symfony/deprecation-contracts", @@ -556,21 +555,21 @@ }, { "name": "symfony/expression-language", - "version": "v6.4.13", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/expression-language.git", - "reference": "3524904fb026356a5230cd197f9a4e6a61e0e7df" + "reference": "c3a1224bc144b36cd79149b42c1aecd5f81395a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/expression-language/zipball/3524904fb026356a5230cd197f9a4e6a61e0e7df", - "reference": "3524904fb026356a5230cd197f9a4e6a61e0e7df", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/c3a1224bc144b36cd79149b42c1aecd5f81395a5", + "reference": "c3a1224bc144b36cd79149b42c1aecd5f81395a5", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/cache": "^5.4|^6.0|^7.0", + "php": ">=8.2", + "symfony/cache": "^6.4|^7.0", "symfony/deprecation-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3" }, @@ -600,7 +599,7 @@ "description": "Provides an engine that can compile and evaluate expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/expression-language/tree/v6.4.13" + "source": "https://github.com/symfony/expression-language/tree/v7.1.6" }, "funding": [ { @@ -616,29 +615,29 @@ "type": "tidelift" } ], - "time": "2024-10-09T08:40:40+00:00" + "time": "2024-10-09T08:46:59+00:00" }, { "name": "symfony/filesystem", - "version": "v6.4.13", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3" + "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/4856c9cf585d5a0313d8d35afd681a526f038dd3", - "reference": "4856c9cf585d5a0313d8d35afd681a526f038dd3", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/c835867b3c62bb05c7fe3d637c871c7ae52024d4", + "reference": "c835867b3c62bb05c7fe3d637c871c7ae52024d4", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, "require-dev": { - "symfony/process": "^5.4|^6.4|^7.0" + "symfony/process": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -666,7 +665,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.13" + "source": "https://github.com/symfony/filesystem/tree/v7.1.6" }, "funding": [ { @@ -682,7 +681,7 @@ "type": "tidelift" } ], - "time": "2024-10-25T15:07:50+00:00" + "time": "2024-10-25T15:11:02+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1959,16 +1958,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -2007,7 +2006,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -2015,7 +2014,7 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", @@ -2321,16 +2320,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.31.0", + "version": "1.33.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "249f15fb843bf240cf058372dad29e100cee6c17" + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/249f15fb843bf240cf058372dad29e100cee6c17", - "reference": "249f15fb843bf240cf058372dad29e100cee6c17", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { @@ -2362,9 +2361,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.31.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, - "time": "2024-09-22T11:32:18+00:00" + "time": "2024-10-13T11:25:22+00:00" }, { "name": "phpstan/phpstan", @@ -3296,16 +3295,16 @@ }, { "name": "sebastian/comparator", - "version": "6.1.1", + "version": "6.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "5ef523a49ae7a302b87b2102b72b1eda8918d686" + "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5ef523a49ae7a302b87b2102b72b1eda8918d686", - "reference": "5ef523a49ae7a302b87b2102b72b1eda8918d686", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/43d129d6a0f81c78bee378b46688293eb7ea3739", + "reference": "43d129d6a0f81c78bee378b46688293eb7ea3739", "shasum": "" }, "require": { @@ -3316,12 +3315,12 @@ "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^11.3" + "phpunit/phpunit": "^11.4" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.1-dev" + "dev-main": "6.2-dev" } }, "autoload": { @@ -3361,7 +3360,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/6.1.1" + "source": "https://github.com/sebastianbergmann/comparator/tree/6.2.1" }, "funding": [ { @@ -3369,7 +3368,7 @@ "type": "github" } ], - "time": "2024-10-18T15:00:48+00:00" + "time": "2024-10-31T05:30:08+00:00" }, { "name": "sebastian/complexity", @@ -4194,16 +4193,16 @@ }, { "name": "symfony/console", - "version": "v7.1.6", + "version": "v7.1.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57" + "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", - "reference": "bb5192af6edc797cbab5c8e8ecfea2fe5f421e57", + "url": "https://api.github.com/repos/symfony/console/zipball/3284aafcac338b6e86fd955ee4d794cbe434151a", + "reference": "3284aafcac338b6e86fd955ee4d794cbe434151a", "shasum": "" }, "require": { @@ -4267,7 +4266,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.6" + "source": "https://github.com/symfony/console/tree/v7.1.7" }, "funding": [ { @@ -4283,7 +4282,7 @@ "type": "tidelift" } ], - "time": "2024-10-09T08:46:59+00:00" + "time": "2024-11-05T15:34:55+00:00" }, { "name": "symfony/finder", @@ -4510,16 +4509,16 @@ }, { "name": "symfony/process", - "version": "v7.1.6", + "version": "v7.1.7", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e" + "reference": "9b8a40b7289767aa7117e957573c2a535efe6585" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e", - "reference": "6aaa189ddb4ff6b5de8fa3210f2fb42c87b4d12e", + "url": "https://api.github.com/repos/symfony/process/zipball/9b8a40b7289767aa7117e957573c2a535efe6585", + "reference": "9b8a40b7289767aa7117e957573c2a535efe6585", "shasum": "" }, "require": { @@ -4551,7 +4550,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.1.6" + "source": "https://github.com/symfony/process/tree/v7.1.7" }, "funding": [ { @@ -4567,7 +4566,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:20:29+00:00" + "time": "2024-11-06T09:25:12+00:00" }, { "name": "symfony/string", @@ -4658,28 +4657,27 @@ }, { "name": "symfony/yaml", - "version": "v6.4.13", + "version": "v7.1.6", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9" + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", - "reference": "e99b4e94d124b29ee4cf3140e1b537d2dad8cec9", + "url": "https://api.github.com/repos/symfony/yaml/zipball/3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", + "reference": "3ced3f29e4f0d6bce2170ff26719f1fe9aacc671", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.5|^3", + "php": ">=8.2", "symfony/polyfill-ctype": "^1.8" }, "conflict": { - "symfony/console": "<5.4" + "symfony/console": "<6.4" }, "require-dev": { - "symfony/console": "^5.4|^6.0|^7.0" + "symfony/console": "^6.4|^7.0" }, "bin": [ "Resources/bin/yaml-lint" @@ -4710,7 +4708,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.4.13" + "source": "https://github.com/symfony/yaml/tree/v7.1.6" }, "funding": [ { @@ -4726,7 +4724,7 @@ "type": "tidelift" } ], - "time": "2024-09-25T14:18:03+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "thecodingmachine/safe", diff --git a/src/Compiler.php b/src/Compiler.php index 3b1cec77..95209cf0 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -81,6 +81,9 @@ private function getContainerContent( $options['debug'] = $container->getParameter('app.devmode'); $options['as_files'] = true; + $options['inline_factories'] = $options['debug'] === false; + $options['inline_class_loader'] = $options['debug'] === false; + $content = (new PhpDumper($container))->dump($options); assert(is_array($content)); diff --git a/src/ContainerBuilder.php b/src/ContainerBuilder.php index 73dd2db8..1524752c 100644 --- a/src/ContainerBuilder.php +++ b/src/ContainerBuilder.php @@ -96,8 +96,6 @@ public static function delegating( private function setDefaultConfiguration(): void { $this->parameterBag->set('app.devmode', false); - $this->parameterBag->set('container.dumper.inline_factories', true); - $this->parameterBag->set('container.dumper.inline_class_loader', true); $this->config->addPass($this->parameterBag); } @@ -149,8 +147,6 @@ public function addPackage(string $className, array $constructArguments = []): B public function useDevelopmentMode(): Builder { $this->parameterBag->set('app.devmode', true); - $this->parameterBag->set('container.dumper.inline_factories', false); - $this->parameterBag->set('container.dumper.inline_class_loader', false); return $this; } diff --git a/test/CompilerTest.php b/test/CompilerTest.php index 8dc7ecbb..4dbe1994 100644 --- a/test/CompilerTest.php +++ b/test/CompilerTest.php @@ -54,8 +54,6 @@ public function configureDependencies(): void $this->parameters = new ParameterBag(); $this->parameters->set('app.devmode', true); - $this->parameters->set('container.dumper.inline_factories', false); - $this->parameters->set('container.dumper.inline_class_loader', true); $this->dump = new ConfigCache($this->dumpDirectory . '/AppContainer.php', false); @@ -91,7 +89,6 @@ public function compileShouldCreateMultipleFilesForDevelopmentMode(): void public function compileShouldInlineFactoriesForProductionMode(): void { $this->parameters->set('app.devmode', false); - $this->parameters->set('container.dumper.inline_factories', true); $compiler = new Compiler(); $compiler->compile($this->config, $this->dump, new Yaml(__FILE__)); diff --git a/test/ContainerBuilderTest.php b/test/ContainerBuilderTest.php index 5e707f18..a004e480 100644 --- a/test/ContainerBuilderTest.php +++ b/test/ContainerBuilderTest.php @@ -96,8 +96,6 @@ public function constructShouldReceiveTheDependenciesAsArguments(): void self::assertNotSame([], iterator_to_array($this->config->getPassList())); self::assertFalse($this->parameterBag->get('app.devmode')); - self::assertTrue($this->parameterBag->get('container.dumper.inline_class_loader')); - self::assertTrue($this->parameterBag->get('container.dumper.inline_factories')); } #[PHPUnit\Test] @@ -185,8 +183,6 @@ public function useDevelopmentModeShouldChangeTheParameterAndReturnSelf(): void self::assertSame($builder, $builder->useDevelopmentMode()); self::assertTrue($this->parameterBag->get('app.devmode')); - self::assertFalse($this->parameterBag->get('container.dumper.inline_class_loader')); - self::assertFalse($this->parameterBag->get('container.dumper.inline_factories')); } #[PHPUnit\Test]