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

Appearance settings

Commit a1228e4

Browse filesBrowse files
minor #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
Copy full SHA for a1228e4

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+1-1Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.