Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1dfb031

Browse files
committed
drop support for configuring Symfony with Composer 1
1 parentb6df694 commit1dfb031

File tree

4 files changed

+40
-38
lines changed

4 files changed

+40
-38
lines changed

‎src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function getConfigTreeBuilder(): TreeBuilder
122122
$parentPackages = (array)$parentPackage;
123123
$parentPackages[] ='symfony/framework-bundle';
124124

125-
return ContainerBuilder::willBeAvailable($package,$class,$parentPackages,true);
125+
return ContainerBuilder::willBeAvailable($package,$class,$parentPackages);
126126
};
127127

128128
$enableIfStandalone =staticfunction (string$package,string$class)use ($willBeAvailable) {

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

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class FrameworkExtension extends Extension
235235
publicfunctionload(array$configs,ContainerBuilder$container)
236236
{
237237
if (!class_exists(InstalledVersions::class)) {
238-
trigger_deprecation('symfony/framework-bundle','5.4','Configuring Symfony without theComposer Runtime API isdeprecated. Consider upgrading to Composer 2.');
238+
thrownewLogicException('TheComposer Runtime API isrequired to configure Symfony. You need to upgrade to Composer 2.');
239239
}
240240

241241
$loader =newPhpFileLoader($container,newFileLocator(\dirname(__DIR__).'/Resources/config'));
@@ -245,7 +245,7 @@ public function load(array $configs, ContainerBuilder $container)
245245
$loader->load('fragment_renderer.php');
246246
$loader->load('error_renderer.php');
247247

248-
if (ContainerBuilder::willBeAvailable('psr/event-dispatcher', PsrEventDispatcherInterface::class, ['symfony/framework-bundle'],true)) {
248+
if (ContainerBuilder::willBeAvailable('psr/event-dispatcher', PsrEventDispatcherInterface::class, ['symfony/framework-bundle'])) {
249249
$container->setAlias(PsrEventDispatcherInterface::class,'event_dispatcher');
250250
}
251251

@@ -292,11 +292,11 @@ public function load(array $configs, ContainerBuilder $container)
292292
$container->getDefinition('response_listener')->replaceArgument(1,$config['set_content_language_from_locale']);
293293

294294
// If the slugger is used but the String component is not available, we should throw an error
295-
if (!ContainerBuilder::willBeAvailable('symfony/string', SluggerInterface::class, ['symfony/framework-bundle'],true)) {
295+
if (!ContainerBuilder::willBeAvailable('symfony/string', SluggerInterface::class, ['symfony/framework-bundle'])) {
296296
$container->register('slugger','stdClass')
297297
->addError('You cannot use the "slugger" service since the String component is not installed. Try running "composer require symfony/string".');
298298
}else {
299-
if (!ContainerBuilder::willBeAvailable('symfony/translation', LocaleAwareInterface::class, ['symfony/framework-bundle'],true)) {
299+
if (!ContainerBuilder::willBeAvailable('symfony/translation', LocaleAwareInterface::class, ['symfony/framework-bundle'])) {
300300
$container->register('slugger','stdClass')
301301
->addError('You cannot use the "slugger" service since the Translation contracts are not installed. Try running "composer require symfony/translation".');
302302
}
@@ -352,7 +352,7 @@ public function load(array $configs, ContainerBuilder $container)
352352
}
353353

354354
if (null ===$config['csrf_protection']['enabled']) {
355-
$config['csrf_protection']['enabled'] =$this->sessionConfigEnabled && !class_exists(FullStack::class) && ContainerBuilder::willBeAvailable('symfony/security-csrf', CsrfTokenManagerInterface::class, ['symfony/framework-bundle'],true);
355+
$config['csrf_protection']['enabled'] =$this->sessionConfigEnabled && !class_exists(FullStack::class) && ContainerBuilder::willBeAvailable('symfony/security-csrf', CsrfTokenManagerInterface::class, ['symfony/framework-bundle']);
356356
}
357357
$this->registerSecurityCsrfConfiguration($config['csrf_protection'],$container,$loader);
358358

@@ -364,7 +364,7 @@ public function load(array $configs, ContainerBuilder $container)
364364
$this->formConfigEnabled =true;
365365
$this->registerFormConfiguration($config,$container,$loader);
366366

367-
if (ContainerBuilder::willBeAvailable('symfony/validator', Validation::class, ['symfony/framework-bundle','symfony/form'],true)) {
367+
if (ContainerBuilder::willBeAvailable('symfony/validator', Validation::class, ['symfony/framework-bundle','symfony/form'])) {
368368
$config['validation']['enabled'] =true;
369369
}else {
370370
$container->setParameter('validator.translation_domain','validators');
@@ -494,7 +494,7 @@ public function load(array $configs, ContainerBuilder $container)
494494
'Symfony\\Bundle\\FrameworkBundle\\Controller\\AbstractController',
495495
]);
496496

497-
if (ContainerBuilder::willBeAvailable('symfony/mime', MimeTypes::class, ['symfony/framework-bundle'],true)) {
497+
if (ContainerBuilder::willBeAvailable('symfony/mime', MimeTypes::class, ['symfony/framework-bundle'])) {
498498
$loader->load('mime_type.php');
499499
}
500500

@@ -647,7 +647,7 @@ private function registerFormConfiguration(array $config, ContainerBuilder $cont
647647
$container->setParameter('form.type_extension.csrf.enabled',false);
648648
}
649649

650-
if (!ContainerBuilder::willBeAvailable('symfony/translation', Translator::class, ['symfony/framework-bundle','symfony/form'],true)) {
650+
if (!ContainerBuilder::willBeAvailable('symfony/translation', Translator::class, ['symfony/framework-bundle','symfony/form'])) {
651651
$container->removeDefinition('form.type_extension.upload.validator');
652652
}
653653
if (!method_exists(CachingFactoryDecorator::class,'reset')) {
@@ -1030,7 +1030,7 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
10301030
$container->getDefinition('routing.loader')->replaceArgument(2, ['_locale' =>$enabledLocales]);
10311031
}
10321032

1033-
if (!ContainerBuilder::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/framework-bundle','symfony/routing'],true)) {
1033+
if (!ContainerBuilder::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/framework-bundle','symfony/routing'])) {
10341034
$container->removeDefinition('router.expression_language_provider');
10351035
}
10361036

@@ -1244,17 +1244,17 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
12441244
$dirs = [];
12451245
$transPaths = [];
12461246
$nonExistingDirs = [];
1247-
if (ContainerBuilder::willBeAvailable('symfony/validator', Validation::class, ['symfony/framework-bundle','symfony/translation'],true)) {
1247+
if (ContainerBuilder::willBeAvailable('symfony/validator', Validation::class, ['symfony/framework-bundle','symfony/translation'])) {
12481248
$r =new \ReflectionClass(Validation::class);
12491249

12501250
$dirs[] =$transPaths[] =\dirname($r->getFileName()).'/Resources/translations';
12511251
}
1252-
if (ContainerBuilder::willBeAvailable('symfony/form', Form::class, ['symfony/framework-bundle','symfony/translation'],true)) {
1252+
if (ContainerBuilder::willBeAvailable('symfony/form', Form::class, ['symfony/framework-bundle','symfony/translation'])) {
12531253
$r =new \ReflectionClass(Form::class);
12541254

12551255
$dirs[] =$transPaths[] =\dirname($r->getFileName()).'/Resources/translations';
12561256
}
1257-
if (ContainerBuilder::willBeAvailable('symfony/security-core', AuthenticationException::class, ['symfony/framework-bundle','symfony/translation'],true)) {
1257+
if (ContainerBuilder::willBeAvailable('symfony/security-core', AuthenticationException::class, ['symfony/framework-bundle','symfony/translation'])) {
12581258
$r =new \ReflectionClass(AuthenticationException::class);
12591259

12601260
$dirs[] =$transPaths[] =\dirname($r->getFileName(),2).'/Resources/translations';
@@ -1359,7 +1359,7 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
13591359
foreach ($classToServicesas$class =>$service) {
13601360
$package =substr($service,\strlen('translation.provider_factory.'));
13611361

1362-
if (!$container->hasDefinition('http_client') || !ContainerBuilder::willBeAvailable(sprintf('symfony/%s-translation-provider',$package),$class,$parentPackages,true)) {
1362+
if (!$container->hasDefinition('http_client') || !ContainerBuilder::willBeAvailable(sprintf('symfony/%s-translation-provider',$package),$class,$parentPackages)) {
13631363
$container->removeDefinition($service);
13641364
}
13651365
}
@@ -1474,7 +1474,7 @@ private function registerValidatorMapping(ContainerBuilder $container, array $co
14741474
$files['yaml' ===$extension ?'yml' :$extension][] =$path;
14751475
};
14761476

1477-
if (ContainerBuilder::willBeAvailable('symfony/form', Form::class, ['symfony/framework-bundle','symfony/validator'],true)) {
1477+
if (ContainerBuilder::willBeAvailable('symfony/form', Form::class, ['symfony/framework-bundle','symfony/validator'])) {
14781478
$reflClass =new \ReflectionClass(Form::class);
14791479
$fileRecorder('xml',\dirname($reflClass->getFileName()).'/Resources/config/validation.xml');
14801480
}
@@ -1640,7 +1640,7 @@ private function registerSecretsConfiguration(array $config, ContainerBuilder $c
16401640
thrownewInvalidArgumentException(sprintf('Invalid value "%s" set as "decryption_env_var": only "word" characters are allowed.',$config['decryption_env_var']));
16411641
}
16421642

1643-
if (ContainerBuilder::willBeAvailable('symfony/string', LazyString::class, ['symfony/framework-bundle'],true)) {
1643+
if (ContainerBuilder::willBeAvailable('symfony/string', LazyString::class, ['symfony/framework-bundle'])) {
16441644
$container->getDefinition('secrets.decryption_key')->replaceArgument(1,$config['decryption_env_var']);
16451645
}else {
16461646
$container->getDefinition('secrets.vault')->replaceArgument(1,"%env({$config['decryption_env_var']})%");
@@ -1776,7 +1776,7 @@ private function registerPropertyInfoConfiguration(ContainerBuilder $container,
17761776

17771777
$loader->load('property_info.php');
17781778

1779-
if (ContainerBuilder::willBeAvailable('phpdocumentor/reflection-docblock', DocBlockFactoryInterface::class, ['symfony/framework-bundle','symfony/property-info'],true)) {
1779+
if (ContainerBuilder::willBeAvailable('phpdocumentor/reflection-docblock', DocBlockFactoryInterface::class, ['symfony/framework-bundle','symfony/property-info'])) {
17801780
$definition =$container->register('property_info.php_doc_extractor','Symfony\Component\PropertyInfo\Extractor\PhpDocExtractor');
17811781
$definition->addTag('property_info.description_extractor', ['priority' => -1000]);
17821782
$definition->addTag('property_info.type_extractor', ['priority' => -1001]);
@@ -1847,19 +1847,19 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
18471847

18481848
$loader->load('messenger.php');
18491849

1850-
if (ContainerBuilder::willBeAvailable('symfony/amqp-messenger', AmqpTransportFactory::class, ['symfony/framework-bundle','symfony/messenger'],true)) {
1850+
if (ContainerBuilder::willBeAvailable('symfony/amqp-messenger', AmqpTransportFactory::class, ['symfony/framework-bundle','symfony/messenger'])) {
18511851
$container->getDefinition('messenger.transport.amqp.factory')->addTag('messenger.transport_factory');
18521852
}
18531853

1854-
if (ContainerBuilder::willBeAvailable('symfony/redis-messenger', RedisTransportFactory::class, ['symfony/framework-bundle','symfony/messenger'],true)) {
1854+
if (ContainerBuilder::willBeAvailable('symfony/redis-messenger', RedisTransportFactory::class, ['symfony/framework-bundle','symfony/messenger'])) {
18551855
$container->getDefinition('messenger.transport.redis.factory')->addTag('messenger.transport_factory');
18561856
}
18571857

1858-
if (ContainerBuilder::willBeAvailable('symfony/amazon-sqs-messenger', AmazonSqsTransportFactory::class, ['symfony/framework-bundle','symfony/messenger'],true)) {
1858+
if (ContainerBuilder::willBeAvailable('symfony/amazon-sqs-messenger', AmazonSqsTransportFactory::class, ['symfony/framework-bundle','symfony/messenger'])) {
18591859
$container->getDefinition('messenger.transport.sqs.factory')->addTag('messenger.transport_factory');
18601860
}
18611861

1862-
if (ContainerBuilder::willBeAvailable('symfony/beanstalkd-messenger', BeanstalkdTransportFactory::class, ['symfony/framework-bundle','symfony/messenger'],true)) {
1862+
if (ContainerBuilder::willBeAvailable('symfony/beanstalkd-messenger', BeanstalkdTransportFactory::class, ['symfony/framework-bundle','symfony/messenger'])) {
18631863
$container->getDefinition('messenger.transport.beanstalkd.factory')->addTag('messenger.transport_factory');
18641864
}
18651865

@@ -2185,12 +2185,12 @@ private function registerHttpClientConfiguration(array $config, ContainerBuilder
21852185
unset($options['retry_failed']);
21862186
$container->getDefinition('http_client')->setArguments([$options,$config['max_host_connections'] ??6]);
21872187

2188-
if (!$hasPsr18 = ContainerBuilder::willBeAvailable('psr/http-client', ClientInterface::class, ['symfony/framework-bundle','symfony/http-client'],true)) {
2188+
if (!$hasPsr18 = ContainerBuilder::willBeAvailable('psr/http-client', ClientInterface::class, ['symfony/framework-bundle','symfony/http-client'])) {
21892189
$container->removeDefinition('psr18.http_client');
21902190
$container->removeAlias(ClientInterface::class);
21912191
}
21922192

2193-
if (!ContainerBuilder::willBeAvailable('php-http/httplug', HttpClient::class, ['symfony/framework-bundle','symfony/http-client'],true)) {
2193+
if (!ContainerBuilder::willBeAvailable('php-http/httplug', HttpClient::class, ['symfony/framework-bundle','symfony/http-client'])) {
21942194
$container->removeDefinition(HttpClient::class);
21952195
}
21962196

@@ -2320,7 +2320,7 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
23202320
foreach ($classToServicesas$class =>$service) {
23212321
$package =substr($service,\strlen('mailer.transport_factory.'));
23222322

2323-
if (!ContainerBuilder::willBeAvailable(sprintf('symfony/%s-mailer','gmail' ===$package ?'google' :$package),$class, ['symfony/framework-bundle','symfony/mailer'],true)) {
2323+
if (!ContainerBuilder::willBeAvailable(sprintf('symfony/%s-mailer','gmail' ===$package ?'google' :$package),$class, ['symfony/framework-bundle','symfony/mailer'])) {
23242324
$container->removeDefinition($service);
23252325
}
23262326
}
@@ -2462,25 +2462,25 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
24622462
case'turbosms':$package ='turbo-sms';break;
24632463
}
24642464

2465-
if (!ContainerBuilder::willBeAvailable(sprintf('symfony/%s-notifier',$package),$class,$parentPackages,true)) {
2465+
if (!ContainerBuilder::willBeAvailable(sprintf('symfony/%s-notifier',$package),$class,$parentPackages)) {
24662466
$container->removeDefinition($service);
24672467
}
24682468
}
24692469

2470-
if (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class,$parentPackages,true) && ContainerBuilder::willBeAvailable('symfony/mercure-bundle', MercureBundle::class,$parentPackages,true)) {
2470+
if (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class,$parentPackages) && ContainerBuilder::willBeAvailable('symfony/mercure-bundle', MercureBundle::class,$parentPackages)) {
24712471
$container->getDefinition($classToServices[MercureTransportFactory::class])
24722472
->replaceArgument('$registry',newReference(HubRegistry::class));
2473-
}elseif (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class,$parentPackages,true)) {
2473+
}elseif (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class,$parentPackages)) {
24742474
$container->removeDefinition($classToServices[MercureTransportFactory::class]);
24752475
}
24762476

2477-
if (ContainerBuilder::willBeAvailable('symfony/fake-chat-notifier', FakeChatTransportFactory::class, ['symfony/framework-bundle','symfony/notifier','symfony/mailer'],true)) {
2477+
if (ContainerBuilder::willBeAvailable('symfony/fake-chat-notifier', FakeChatTransportFactory::class, ['symfony/framework-bundle','symfony/notifier','symfony/mailer'])) {
24782478
$container->getDefinition($classToServices[FakeChatTransportFactory::class])
24792479
->replaceArgument('$mailer',newReference('mailer'))
24802480
->replaceArgument('$logger',newReference('logger'));
24812481
}
24822482

2483-
if (ContainerBuilder::willBeAvailable('symfony/fake-sms-notifier', FakeSmsTransportFactory::class, ['symfony/framework-bundle','symfony/notifier','symfony/mailer'],true)) {
2483+
if (ContainerBuilder::willBeAvailable('symfony/fake-sms-notifier', FakeSmsTransportFactory::class, ['symfony/framework-bundle','symfony/notifier','symfony/mailer'])) {
24842484
$container->getDefinition($classToServices[FakeSmsTransportFactory::class])
24852485
->replaceArgument('$mailer',newReference('mailer'))
24862486
->replaceArgument('$logger',newReference('logger'));

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
useSymfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass;
2828
useSymfony\Component\DependencyInjection\ContainerBuilder;
2929
useSymfony\Component\DependencyInjection\Definition;
30+
useSymfony\Component\DependencyInjection\Exception\LogicException;
3031
useSymfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
3132
useSymfony\Component\DependencyInjection\Loader\PhpFileLoader;
3233
useSymfony\Component\DependencyInjection\Reference;
@@ -73,7 +74,7 @@ public function prepend(ContainerBuilder $container)
7374
publicfunctionload(array$configs,ContainerBuilder$container)
7475
{
7576
if (!class_exists(InstalledVersions::class)) {
76-
trigger_deprecation('symfony/security-bundle','5.4','Configuring Symfony without theComposer Runtime API isdeprecated. Consider upgrading to Composer 2.');
77+
thrownewLogicException('TheComposer Runtime API isrequired to configure Symfony. You need to upgrade to Composer 2.');
7778
}
7879

7980
if (!array_filter($configs)) {
@@ -97,7 +98,7 @@ public function load(array $configs, ContainerBuilder $container)
9798

9899
$loader->load('security_authenticator.php');
99100

100-
if ($container::willBeAvailable('symfony/twig-bridge', LogoutUrlExtension::class, ['symfony/security-bundle'],true)) {
101+
if ($container::willBeAvailable('symfony/twig-bridge', LogoutUrlExtension::class, ['symfony/security-bundle'])) {
101102
$loader->load('templating_twig.php');
102103
}
103104

@@ -107,7 +108,7 @@ public function load(array $configs, ContainerBuilder $container)
107108
$loader->load('security_debug.php');
108109
}
109110

110-
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'],true)) {
111+
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'])) {
111112
$container->removeDefinition('security.expression_language');
112113
$container->removeDefinition('security.access.expression_voter');
113114
}
@@ -802,7 +803,7 @@ private function createExpression(ContainerBuilder $container, string $expressio
802803
return$this->expressions[$id];
803804
}
804805

805-
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'],true)) {
806+
if (!$container::willBeAvailable('symfony/expression-language', ExpressionLanguage::class, ['symfony/security-bundle'])) {
806807
thrownew \RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed. Try running "composer require symfony/expression-language".');
807808
}
808809

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp