Skip to content

Commit 21ede71

Browse files
Deprecate requiring the "symfony/symfony" package
1 parent 2f3f538 commit 21ede71

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 5 additions & 0 deletions
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)) {

composer.json

Lines changed: 1 addition & 0 deletions
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)