Commit a1228e4
committed
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 conditionFile tree
1 file changed
+1
-1
lines changed- src/Symfony/Bundle/FrameworkBundle/DependencyInjection
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
| |||
0 commit comments