Skip to content

Commit d4a3c14

Browse files
committed
SCA: simplify some ifs in favour of null coalescing operator
1 parent 537803f commit d4a3c14

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Generator/UrlGenerator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
254254
});
255255

256256
// extract fragment
257-
$fragment = '';
258-
if (isset($defaults['_fragment'])) {
259-
$fragment = $defaults['_fragment'];
260-
}
257+
$fragment = $defaults['_fragment'] ?? '';
261258

262259
if (isset($extra['_fragment'])) {
263260
$fragment = $extra['_fragment'];

0 commit comments

Comments
 (0)