Skip to content

Commit 22a778b

Browse files
committed
feature #45563 Deprecate requiring the "symfony/symfony" package (nicolas-grekas)
This PR was merged into the 6.1 branch. Discussion ---------- Deprecate requiring the "symfony/symfony" package | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | yes | Tickets | - | License | MIT | Doc PR | - Commits ------- fbb2ec0 Deprecate requiring the "symfony/symfony" package
2 parents 27f8f69 + fbb2ec0 commit 22a778b

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

UPGRADE-6.1.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ UPGRADE FROM 6.0 to 6.1
44
All components
55
--------------
66

7+
* Deprecate requiring the "symfony/symfony" package; replace it with standalone components instead
78
* Public and protected properties are now considered final;
89
instead of overriding a property, consider setting its value in the constructor
910

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
1313

14+
use Composer\InstalledVersions;
1415
use Doctrine\Common\Annotations\AnnotationRegistry;
1516
use Doctrine\Common\Annotations\Reader;
1617
use Http\Client\HttpClient;
@@ -246,6 +247,10 @@ public function load(array $configs, ContainerBuilder $container)
246247
{
247248
$loader = new PhpFileLoader($container, new FileLocator(\dirname(__DIR__).'/Resources/config'));
248249

250+
if (class_exists(InstalledVersions::class) && InstalledVersions::isInstalled('symfony/symfony') && 'symfony/symfony' !== (InstalledVersions::getRootPackage()['name'] ?? '')) {
251+
trigger_deprecation('symfony/symfony', '6.1', 'Requiring the "symfony/symfony" package is deprecated; replace it with standalone components instead.');
252+
}
253+
249254
$loader->load('web.php');
250255

251256
if (!class_exists(BackedEnumValueResolver::class)) {

src/Symfony/Bundle/FrameworkBundle/composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"symfony/cache": "^5.4|^6.0",
2323
"symfony/config": "^5.4|^6.0",
2424
"symfony/dependency-injection": "^5.4.5|^6.0.5",
25+
"symfony/deprecation-contracts": "^2.1|^3",
2526
"symfony/event-dispatcher": "^5.4|^6.0",
2627
"symfony/error-handler": "^5.4|^6.0",
2728
"symfony/http-foundation": "^5.4|^6.0",

0 commit comments

Comments
 (0)