diff --git a/src/Illuminate/Auth/Middleware/Authorize.php b/src/Illuminate/Auth/Middleware/Authorize.php index aea9801dd345..7908d12f99ad 100644 --- a/src/Illuminate/Auth/Middleware/Authorize.php +++ b/src/Illuminate/Auth/Middleware/Authorize.php @@ -74,10 +74,10 @@ protected function getModel($request, $model) { if ($this->isClassName($model)) { return trim($model); - } else { - return $request->route($model, null) ?: - ((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null); } + + return $request->route($model, null) ?: + ((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null); } /** diff --git a/src/Illuminate/Cache/RedisLock.php b/src/Illuminate/Cache/RedisLock.php index 9f62eada9510..027c4620d8da 100644 --- a/src/Illuminate/Cache/RedisLock.php +++ b/src/Illuminate/Cache/RedisLock.php @@ -36,9 +36,9 @@ public function acquire() { if ($this->seconds > 0) { return $this->redis->set($this->name, $this->owner, 'EX', $this->seconds, 'NX') == true; - } else { - return $this->redis->setnx($this->name, $this->owner) === 1; } + + return $this->redis->setnx($this->name, $this->owner) === 1; } /** diff --git a/src/Illuminate/Database/Connectors/SqlServerConnector.php b/src/Illuminate/Database/Connectors/SqlServerConnector.php index 0424642e2385..99ffac4593fc 100755 --- a/src/Illuminate/Database/Connectors/SqlServerConnector.php +++ b/src/Illuminate/Database/Connectors/SqlServerConnector.php @@ -49,9 +49,9 @@ protected function getDsn(array $config) if (in_array('sqlsrv', $this->getAvailableDrivers())) { return $this->getSqlSrvDsn($config); - } else { - return $this->getDblibDsn($config); } + + return $this->getDblibDsn($config); } /** diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 90999c106a0c..3988ec3fc43b 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -1584,9 +1584,9 @@ public function resolveChildRouteBinding($childType, $value, $field) if ($relationship instanceof HasManyThrough || $relationship instanceof BelongsToMany) { return $relationship->where($relationship->getRelated()->getTable().'.'.$field, $value)->first(); - } else { - return $relationship->where($field, $value)->first(); } + + return $relationship->where($field, $value)->first(); } /** diff --git a/src/Illuminate/Foundation/Console/TestMakeCommand.php b/src/Illuminate/Foundation/Console/TestMakeCommand.php index 0a176cbaba7b..458367979df1 100644 --- a/src/Illuminate/Foundation/Console/TestMakeCommand.php +++ b/src/Illuminate/Foundation/Console/TestMakeCommand.php @@ -76,9 +76,9 @@ protected function getDefaultNamespace($rootNamespace) { if ($this->option('unit')) { return $rootNamespace.'\Unit'; - } else { - return $rootNamespace.'\Feature'; } + + return $rootNamespace.'\Feature'; } /** diff --git a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php b/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php index 11e63a8d044b..cbdf2234eead 100644 --- a/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php +++ b/src/Illuminate/Foundation/Support/Providers/EventServiceProvider.php @@ -63,12 +63,12 @@ public function getEvents() $cache = require $this->app->getCachedEventsPath(); return $cache[get_class($this)] ?? []; - } else { - return array_merge_recursive( - $this->discoveredEvents(), - $this->listens() - ); } + + return array_merge_recursive( + $this->discoveredEvents(), + $this->listens() + ); } /** diff --git a/src/Illuminate/Routing/RouteGroup.php b/src/Illuminate/Routing/RouteGroup.php index 5b96469d092b..bf3a46dcb556 100644 --- a/src/Illuminate/Routing/RouteGroup.php +++ b/src/Illuminate/Routing/RouteGroup.php @@ -63,9 +63,9 @@ protected static function formatPrefix($new, $old, $prependExistingPrefix = true if ($prependExistingPrefix) { return isset($new['prefix']) ? trim($old, '/').'/'.trim($new['prefix'], '/') : $old; - } else { - return isset($new['prefix']) ? trim($new['prefix'], '/').'/'.trim($old, '/') : $old; } + + return isset($new['prefix']) ? trim($new['prefix'], '/').'/'.trim($old, '/') : $old; } /** diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php index 320444d4fc67..48dc261ad40b 100755 --- a/src/Illuminate/Routing/UrlGenerator.php +++ b/src/Illuminate/Routing/UrlGenerator.php @@ -476,9 +476,9 @@ protected function formatAction($action) if ($this->rootNamespace && strpos($action, '\\') !== 0) { return $this->rootNamespace.'\\'.$action; - } else { - return trim($action, '\\'); } + + return trim($action, '\\'); } /** diff --git a/src/Illuminate/Session/Middleware/StartSession.php b/src/Illuminate/Session/Middleware/StartSession.php index 2e73bb8a0753..5921ee848ccd 100644 --- a/src/Illuminate/Session/Middleware/StartSession.php +++ b/src/Illuminate/Session/Middleware/StartSession.php @@ -58,9 +58,9 @@ public function handle($request, Closure $next) if ($this->manager->shouldBlock() || ($request->route() && $request->route()->locksFor())) { return $this->handleRequestWhileBlocking($request, $session, $next); - } else { - return $this->handleStatefulRequest($request, $session, $next); } + + return $this->handleStatefulRequest($request, $session, $next); } /** diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index 2dbceab08a28..8e2d6c25d8b7 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -657,9 +657,9 @@ public static function substrCount($haystack, $needle, $offset = 0, $length = nu { if (! is_null($length)) { return substr_count($haystack, $needle, $offset, $length); - } else { - return substr_count($haystack, $needle, $offset); } + + return substr_count($haystack, $needle, $offset); } /** diff --git a/src/Illuminate/View/Concerns/ManagesComponents.php b/src/Illuminate/View/Concerns/ManagesComponents.php index f14de61a568c..f089f24dec49 100644 --- a/src/Illuminate/View/Concerns/ManagesComponents.php +++ b/src/Illuminate/View/Concerns/ManagesComponents.php @@ -89,9 +89,9 @@ public function renderComponent() if ($view instanceof View) { return $view->with($data)->render(); - } else { - return $this->make($view, $data)->render(); } + + return $this->make($view, $data)->render(); } /**