Skip to content

Commit 0a65760

Browse files
committed
minor #40586 [Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations for using attributes/annots (dunglas)
This PR was merged into the 5.2 branch. Discussion ---------- [Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations for using attributes/annots …s to use attributes/annots | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | See symfony/recipes#916 | License | MIT | Doc PR | n/a Improve the error message to hint that you can upgrade to PHP 8 instead of using `doctrine/annotations`. Commits ------- af6f3c2c08 [Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations to use attributes/annots
2 parents 53a6169 + 9f07ea8 commit 0a65760

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
13191319

13201320
if (\array_key_exists('enable_annotations', $config) && $config['enable_annotations']) {
13211321
if (!$this->annotationsConfigEnabled && \PHP_VERSION_ID < 80000) {
1322-
throw new \LogicException('"enable_annotations" on the validator cannot be set as Doctrine Annotations support is disabled.');
1322+
throw new \LogicException('"enable_annotations" on the validator cannot be set as the PHP version is lower than 8 and Doctrine Annotations support is disabled. Consider upgrading PHP.');
13231323
}
13241324

13251325
$validatorBuilder->addMethodCall('enableAnnotationMapping', [true]);
@@ -1583,7 +1583,7 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
15831583
$serializerLoaders = [];
15841584
if (isset($config['enable_annotations']) && $config['enable_annotations']) {
15851585
if (\PHP_VERSION_ID < 80000 && !$this->annotationsConfigEnabled) {
1586-
throw new \LogicException('"enable_annotations" on the serializer cannot be set as Annotations support is disabled.');
1586+
throw new \LogicException('"enable_annotations" on the serializer cannot be set as the PHP version is lower than 8 and Annotations support is disabled. Consider upgrading PHP.');
15871587
}
15881588

15891589
$annotationLoader = new Definition(

0 commit comments

Comments
 (0)