diff --git a/src/Illuminate/Bus/Dispatcher.php b/src/Illuminate/Bus/Dispatcher.php
index 9733b442f9c3..1a7b9a4087a9 100644
--- a/src/Illuminate/Bus/Dispatcher.php
+++ b/src/Illuminate/Bus/Dispatcher.php
@@ -71,9 +71,9 @@ public function dispatch($command)
{
if ($this->queueResolver && $this->commandShouldBeQueued($command)) {
return $this->dispatchToQueue($command);
- } else {
- return $this->dispatchNow($command);
}
+
+ return $this->dispatchNow($command);
}
/**
@@ -155,9 +155,9 @@ public function dispatchToQueue($command)
if (method_exists($command, 'queue')) {
return $command->queue($queue, $command);
- } else {
- return $this->pushCommandToQueue($queue, $command);
}
+
+ return $this->pushCommandToQueue($queue, $command);
}
/**
diff --git a/src/Illuminate/Console/Scheduling/CommandBuilder.php b/src/Illuminate/Console/Scheduling/CommandBuilder.php
index acf60dd60484..4e37a0d7c402 100644
--- a/src/Illuminate/Console/Scheduling/CommandBuilder.php
+++ b/src/Illuminate/Console/Scheduling/CommandBuilder.php
@@ -17,9 +17,9 @@ public function buildCommand(Event $event)
{
if ($event->runInBackground) {
return $this->buildBackgroundCommand($event);
- } else {
- return $this->buildForegroundCommand($event);
}
+
+ return $this->buildForegroundCommand($event);
}
/**
diff --git a/src/Illuminate/Database/Connectors/PostgresConnector.php b/src/Illuminate/Database/Connectors/PostgresConnector.php
index 0581b8b2aa5a..5129b4b4474d 100755
--- a/src/Illuminate/Database/Connectors/PostgresConnector.php
+++ b/src/Illuminate/Database/Connectors/PostgresConnector.php
@@ -106,9 +106,9 @@ protected function formatSchema($schema)
{
if (is_array($schema)) {
return '"'.implode('", "', $schema).'"';
- } else {
- return '"'.$schema.'"';
}
+
+ return '"'.$schema.'"';
}
/**
diff --git a/src/Illuminate/Database/Connectors/SqlServerConnector.php b/src/Illuminate/Database/Connectors/SqlServerConnector.php
index 3b008d0b2b3c..87525d121b66 100755
--- a/src/Illuminate/Database/Connectors/SqlServerConnector.php
+++ b/src/Illuminate/Database/Connectors/SqlServerConnector.php
@@ -47,9 +47,9 @@ protected function getDsn(array $config)
return $this->getDblibDsn($config);
} elseif ($this->prefersOdbc($config)) {
return $this->getOdbcDsn($config);
- } else {
- return $this->getSqlSrvDsn($config);
}
+
+ return $this->getSqlSrvDsn($config);
}
/**
diff --git a/src/Illuminate/Database/Migrations/MigrationCreator.php b/src/Illuminate/Database/Migrations/MigrationCreator.php
index 0a9105d581bc..719fbf106c3d 100755
--- a/src/Illuminate/Database/Migrations/MigrationCreator.php
+++ b/src/Illuminate/Database/Migrations/MigrationCreator.php
@@ -97,11 +97,9 @@ protected function getStub($table, $create)
// We also have stubs for creating new tables and modifying existing tables
// to save the developer some typing when they are creating a new tables
// or modifying existing tables. We'll grab the appropriate stub here.
- else {
- $stub = $create ? 'create.stub' : 'update.stub';
+ $stub = $create ? 'create.stub' : 'update.stub';
- return $this->files->get($this->stubPath()."/{$stub}");
- }
+ return $this->files->get($this->stubPath()."/{$stub}");
}
/**
diff --git a/src/Illuminate/Database/Migrations/Migrator.php b/src/Illuminate/Database/Migrations/Migrator.php
index 535bb316facd..051d8a99bf59 100755
--- a/src/Illuminate/Database/Migrations/Migrator.php
+++ b/src/Illuminate/Database/Migrations/Migrator.php
@@ -204,9 +204,9 @@ public function rollback($paths = [], array $options = [])
$this->note('Nothing to rollback.');
return [];
- } else {
- return $this->rollbackMigrations($migrations, $paths, $options);
}
+
+ return $this->rollbackMigrations($migrations, $paths, $options);
}
/**
@@ -281,9 +281,9 @@ public function reset($paths = [], $pretend = false)
$this->note('Nothing to rollback.');
return [];
- } else {
- return $this->resetMigrations($migrations, $paths, $pretend);
}
+
+ return $this->resetMigrations($migrations, $paths, $pretend);
}
/**
diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php
index ef560a6ea93f..5b8f0574e8d2 100755
--- a/src/Illuminate/Database/Query/Builder.php
+++ b/src/Illuminate/Database/Query/Builder.php
@@ -1775,9 +1775,9 @@ public function getCountForPagination($columns = ['*'])
return 0;
} elseif (is_object($results[0])) {
return (int) $results[0]->aggregate;
- } else {
- return (int) array_change_key_case((array) $results[0])['aggregate'];
}
+
+ return (int) array_change_key_case((array) $results[0])['aggregate'];
}
/**
diff --git a/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php b/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
index 9010a43f4762..8dff604ae6c3 100755
--- a/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
+++ b/src/Illuminate/Database/Query/Grammars/MySqlGrammar.php
@@ -145,9 +145,9 @@ protected function compileUpdateColumns($values)
return collect($values)->map(function ($value, $key) {
if ($this->isJsonSelector($key)) {
return $this->compileJsonUpdateColumn($key, new JsonExpression($value));
- } else {
- return $this->wrap($key).' = '.$this->parameter($value);
}
+
+ return $this->wrap($key).' = '.$this->parameter($value);
})->implode(', ');
}
diff --git a/src/Illuminate/Events/Dispatcher.php b/src/Illuminate/Events/Dispatcher.php
index 28115a7d798a..d99031cf0269 100755
--- a/src/Illuminate/Events/Dispatcher.php
+++ b/src/Illuminate/Events/Dispatcher.php
@@ -345,9 +345,9 @@ public function makeListener($listener, $wildcard = false)
return function ($event, $payload) use ($listener, $wildcard) {
if ($wildcard) {
return $listener($event, $payload);
- } else {
- return $listener(...array_values($payload));
}
+
+ return $listener(...array_values($payload));
};
}
@@ -363,11 +363,11 @@ public function createClassListener($listener, $wildcard = false)
return function ($event, $payload) use ($listener, $wildcard) {
if ($wildcard) {
return call_user_func($this->createClassCallable($listener), $event, $payload);
- } else {
- return call_user_func_array(
- $this->createClassCallable($listener), $payload
- );
}
+
+ return call_user_func_array(
+ $this->createClassCallable($listener), $payload
+ );
};
}
@@ -383,9 +383,9 @@ protected function createClassCallable($listener)
if ($this->handlerShouldBeQueued($class)) {
return $this->createQueuedHandlerCallable($class, $method);
- } else {
- return [$this->container->make($class), $method];
}
+
+ return [$this->container->make($class), $method];
}
/**
diff --git a/src/Illuminate/Filesystem/FilesystemAdapter.php b/src/Illuminate/Filesystem/FilesystemAdapter.php
index 572bf33e8983..eeddbe057993 100644
--- a/src/Illuminate/Filesystem/FilesystemAdapter.php
+++ b/src/Illuminate/Filesystem/FilesystemAdapter.php
@@ -447,9 +447,9 @@ protected function getLocalUrl($path)
// are really supposed to use. We will remove the public from this path here.
if (Str::contains($path, '/storage/public/')) {
return Str::replaceFirst('/public/', '/', $path);
- } else {
- return $path;
}
+
+ return $path;
}
/**
diff --git a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php
index bcf6892c7119..ce3e25ef059f 100644
--- a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php
+++ b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php
@@ -67,11 +67,11 @@ protected function getStub()
return $this->option('event')
? __DIR__.'/stubs/listener-queued.stub'
: __DIR__.'/stubs/listener-queued-duck.stub';
- } else {
- return $this->option('event')
- ? __DIR__.'/stubs/listener.stub'
- : __DIR__.'/stubs/listener-duck.stub';
}
+
+ return $this->option('event')
+ ? __DIR__.'/stubs/listener.stub'
+ : __DIR__.'/stubs/listener-duck.stub';
}
/**
diff --git a/src/Illuminate/Foundation/Console/TestMakeCommand.php b/src/Illuminate/Foundation/Console/TestMakeCommand.php
index 15b8cdf85368..7d48a6e66fdb 100644
--- a/src/Illuminate/Foundation/Console/TestMakeCommand.php
+++ b/src/Illuminate/Foundation/Console/TestMakeCommand.php
@@ -37,9 +37,9 @@ protected function getStub()
{
if ($this->option('unit')) {
return __DIR__.'/stubs/unit-test.stub';
- } else {
- return __DIR__.'/stubs/test.stub';
}
+
+ return __DIR__.'/stubs/test.stub';
}
/**
diff --git a/src/Illuminate/Foundation/helpers.php b/src/Illuminate/Foundation/helpers.php
index 864584a69450..ffb1ca53f6cc 100644
--- a/src/Illuminate/Foundation/helpers.php
+++ b/src/Illuminate/Foundation/helpers.php
@@ -149,9 +149,9 @@ function auth($guard = null)
{
if (is_null($guard)) {
return app(AuthFactory::class);
- } else {
- return app(AuthFactory::class)->guard($guard);
}
+
+ return app(AuthFactory::class)->guard($guard);
}
}
@@ -483,9 +483,9 @@ function factory()
return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ?? null);
} elseif (isset($arguments[1])) {
return $factory->of($arguments[0])->times($arguments[1]);
- } else {
- return $factory->of($arguments[0]);
}
+
+ return $factory->of($arguments[0]);
}
}
diff --git a/src/Illuminate/Mail/Mailable.php b/src/Illuminate/Mail/Mailable.php
index ef32adcab231..86ea7a7ebfa8 100644
--- a/src/Illuminate/Mail/Mailable.php
+++ b/src/Illuminate/Mail/Mailable.php
@@ -551,9 +551,9 @@ protected function hasRecipient($address, $name = null, $property = 'to')
return collect($this->{$property})->contains(function ($actual) use ($expected) {
if (! isset($expected['name'])) {
return $actual['address'] == $expected['address'];
- } else {
- return $actual == $expected;
}
+
+ return $actual == $expected;
});
}
diff --git a/src/Illuminate/Routing/RouteUrlGenerator.php b/src/Illuminate/Routing/RouteUrlGenerator.php
index f2336dca5657..b5a4c1cbf1ec 100644
--- a/src/Illuminate/Routing/RouteUrlGenerator.php
+++ b/src/Illuminate/Routing/RouteUrlGenerator.php
@@ -140,9 +140,9 @@ protected function getRouteScheme($route)
return 'http://';
} elseif ($route->httpsOnly()) {
return 'https://';
- } else {
- return $this->url->formatScheme(null);
}
+
+ return $this->url->formatScheme(null);
}
/**
@@ -212,9 +212,9 @@ protected function replaceNamedParameters($path, &$parameters)
return Arr::pull($parameters, $m[1]);
} elseif (isset($this->defaultParameters[$m[1]])) {
return $this->defaultParameters[$m[1]];
- } else {
- return $m[0];
}
+
+ return $m[0];
}, $path);
}
diff --git a/src/Illuminate/Routing/UrlGenerator.php b/src/Illuminate/Routing/UrlGenerator.php
index 3e9481047c0b..93352a272552 100755
--- a/src/Illuminate/Routing/UrlGenerator.php
+++ b/src/Illuminate/Routing/UrlGenerator.php
@@ -142,9 +142,9 @@ public function previous($fallback = false)
return $url;
} elseif ($fallback) {
return $this->to($fallback);
- } else {
- return $this->to('/');
}
+
+ return $this->to('/');
}
/**
diff --git a/src/Illuminate/Session/SessionManager.php b/src/Illuminate/Session/SessionManager.php
index 0a06e48a6266..2ab50830d2de 100755
--- a/src/Illuminate/Session/SessionManager.php
+++ b/src/Illuminate/Session/SessionManager.php
@@ -164,9 +164,9 @@ protected function buildSession($handler)
{
if ($this->app['config']['session.encrypt']) {
return $this->buildEncryptedSession($handler);
- } else {
- return new Store($this->app['config']['session.cookie'], $handler);
}
+
+ return new Store($this->app['config']['session.cookie'], $handler);
}
/**
diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php
index a5f90b4a3f12..a3e2cf434f0c 100644
--- a/src/Illuminate/Support/Collection.php
+++ b/src/Illuminate/Support/Collection.php
@@ -1608,9 +1608,9 @@ public function jsonSerialize()
return json_decode($value->toJson(), true);
} elseif ($value instanceof Arrayable) {
return $value->toArray();
- } else {
- return $value;
}
+
+ return $value;
}, $this->items);
}
diff --git a/src/Illuminate/Validation/ValidationRuleParser.php b/src/Illuminate/Validation/ValidationRuleParser.php
index 96a89baf0252..43a28db989d8 100644
--- a/src/Illuminate/Validation/ValidationRuleParser.php
+++ b/src/Illuminate/Validation/ValidationRuleParser.php
@@ -87,9 +87,9 @@ protected function explodeExplicitRule($rule)
return explode('|', $rule);
} elseif (is_object($rule)) {
return [$this->prepareRule($rule)];
- } else {
- return array_map([$this, 'prepareRule'], $rule);
}
+
+ return array_map([$this, 'prepareRule'], $rule);
}
/**