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

Commitb45e13e

Browse files
committed
[FrameworkBundle] Configure PHP Attributes without doctrine/annotations.
1 parent2c39acd commitb45e13e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -965,11 +965,11 @@ private function registerRouterConfiguration(array $config, ContainerBuilder $co
965965
->replaceArgument(0,$config['default_uri']);
966966
}
967967

968-
if ($this->annotationsConfigEnabled) {
968+
if (\PHP_VERSION_ID >=80000 ||$this->annotationsConfigEnabled) {
969969
$container->register('routing.loader.annotation', AnnotatedRouteControllerLoader::class)
970970
->setPublic(false)
971971
->addTag('routing.loader', ['priority' => -10])
972-
->addArgument(newReference('annotation_reader'));
972+
->addArgument(newReference('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE));
973973

974974
$container->register('routing.loader.annotation.directory', AnnotationDirectoryLoader::class)
975975
->setPublic(false)
@@ -1564,13 +1564,13 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
15641564

15651565
$serializerLoaders = [];
15661566
if (isset($config['enable_annotations']) &&$config['enable_annotations']) {
1567-
if (!$this->annotationsConfigEnabled) {
1567+
if (\PHP_VERSION_ID <80000 &&!$this->annotationsConfigEnabled) {
15681568
thrownew \LogicException('"enable_annotations" on the serializer cannot be set as Annotations support is disabled.');
15691569
}
15701570

15711571
$annotationLoader =newDefinition(
15721572
'Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader',
1573-
[newReference('annotation_reader')]
1573+
[newReference('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE)]
15741574
);
15751575
$annotationLoader->setPublic(false);
15761576

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ public function testSerializerMapping()
12321232
$projectDir =$container->getParameter('kernel.project_dir');
12331233
$configDir =__DIR__.'/Fixtures/TestBundle/Resources/config';
12341234
$expectedLoaders = [
1235-
newDefinition(AnnotationLoader::class, [newReference('annotation_reader')]),
1235+
newDefinition(AnnotationLoader::class, [newReference('annotation_reader', ContainerInterface::NULL_ON_INVALID_REFERENCE)]),
12361236
newDefinition(XmlFileLoader::class, [$configDir.'/serialization.xml']),
12371237
newDefinition(YamlFileLoader::class, [$configDir.'/serialization.yml']),
12381238
newDefinition(YamlFileLoader::class, [$projectDir.'/config/serializer/foo.yml']),

‎src/Symfony/Bundle/FrameworkBundle/composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"symfony/polyfill-php80":"^1.15",
3030
"symfony/filesystem":"^4.4|^5.0",
3131
"symfony/finder":"^4.4|^5.0",
32-
"symfony/routing":"^5.1"
32+
"symfony/routing":"^5.2"
3333
},
3434
"require-dev": {
3535
"doctrine/annotations":"~1.7",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp