8000 minor #60393 [FrameworkBundle] Improve readability of disallow_search… · kbond/symfony@a1228e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit a1228e4

Browse files
minor symfony#60393 [FrameworkBundle] Improve readability of disallow_search_engine_index condition (Nowfel2501)
This PR was merged into the 6.4 branch. Discussion ---------- [FrameworkBundle] Improve readability of disallow_search_engine_index condition | Q | A | ------------- | --- | Branch? | 6.4, | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT The use of the null coalescing operator (??) combined with the negation operator (!) and PHP's precedence rules makes this condition harder to read and understand—both for humans and IDEs. Even my editor had trouble parsing it correctly. To improve clarity, it's better to make the intention explicit by writing: `if (!($config['disallow_search_engine_index'] ?? false))` This makes the logic easier to follow and avoids any ambiguity. Commits ------- 31be4cf Improve readability of disallow_search_engine_index condition
2 parents 40730a4 + 31be4cf commit a1228e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ static function (ChildDefinition $definition, AsPeriodicTask|AsCronTask $attribu
735735
$container->getDefinition('config_cache_factory')->setArguments([]);
736736
}
737737

738-
if (!$config['disallow_search_engine_index'] ?? false) {
738+
if (!$config['disallow_search_engine_index']) {
739739
$container->removeDefinition('disallow_search_engine_index_response_listener');
740740
}
741741

0 commit comments

Comments
 (0)
0