8000 Merge pull request #676 from youmingdot/5.5 · laravel/lumen-framework@5c151e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5c151e9

Browse files
authored
Merge pull request #676 from youmingdot/5.5
[5.5] Some optimization based on PHP 7.
2 parents ffcda72 + 6b3e858 commit 5c151e9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Routing/Router.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected static function formatUsesPrefix($new, $old)
133133
: trim($new['namespace'], '\\');
134134
}
135135

136-
return isset($old['namespace']) ? $old['namespace'] : null;
136+
return $old['namespace'] ?? null;
137137
}
138138

139139
/**
@@ -145,7 +145,7 @@ protected static function formatUsesPrefix($new, $old)
145145
*/
146146
protected static function formatGroupPrefix($new, $old)
147147
{
148-
$oldPrefix = isset($old['prefix']) ? $old['prefix'] : null;
148+
$oldPrefix = $old['prefix'] ?? null;
149149

150150
if (isset($new['prefix'])) {
151151
return trim($oldPrefix, '/').'/'.trim($new['prefix'], '/');
@@ -239,9 +239,9 @@ public function hasGroupStack()
239239
*/
240240
protected function mergeGroupAttributes(array $action, array $attributes)
241241
{
242-
$namespace = isset($attributes['namespace']) ? $attributes['namespace'] : null;
243-
$middleware = isset($attributes['middleware']) ? $attributes['middleware'] : null;
244-
$as = isset($attributes['as']) ? $attributes['as'] : null;
242+
$namespace = $attributes['namespace'] ?? null;
243+
$middleware = $attributes['middleware'] ?? null;
244+
$as = $attributes['as'] ?? null;
245245

246246
return $this->mergeNamespaceGroup(
247247
$this->mergeMiddlewareGroup(

0 commit comments

Comments
 (0)
0