Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Illuminate/Cache/CacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ protected function resolve($name)

if (isset($this->customCreators[$config['driver']])) {
return $this->callCustomCreator($config);
} else {
$driverMethod = 'create'.ucfirst($config['driver']).'Driver';

if (method_exists($this, $driverMethod)) {
return $this->{$driverMethod}($config);
} else {
throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
}
}

$driverMethod = 'create'.ucfirst($config['driver']).'Driver';

if (method_exists($this, $driverMethod)) {
return $this->{$driverMethod}($config);
}

throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
}

/**
Expand Down
8 changes: 6 additions & 2 deletions src/Illuminate/Database/Concerns/BuildsQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ public function when($value, $callback, $default = null)
{
if ($value) {
return $callback($this, $value) ?: $this;
} elseif ($default) {
}

if ($default) {
return $default($this, $value) ?: $this;
}

Expand Down Expand Up @@ -119,7 +121,9 @@ public function unless($value, $callback, $default = null)
{
if (! $value) {
return $callback($this, $value) ?: $this;
} elseif ($default) {
}

if ($default) {
return $default($this, $value) ?: $this;
}

Expand Down
8 changes: 5 additions & 3 deletions src/Illuminate/Database/Connectors/SqlServerConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ protected function getDsn(array $config)
// need to establish the PDO connections and return them back for use.
if (in_array('dblib', $this->getAvailableDrivers())) {
return $this->getDblibDsn($config);
} elseif ($this->prefersOdbc($config)) {
}

if ($this->prefersOdbc($config)) {
return $this->getOdbcDsn($config);
}

Expand Down Expand Up @@ -166,9 +168,9 @@ protected function buildHostString(array $config, $separator)
{
if (isset($config['port']) && ! empty($config['port'])) {
return $config['host'].$separator.$config['port'];
} else {
return $config['host'];
}

return $config['host'];
}

/**
Expand Down
12 changes: 9 additions & 3 deletions src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1055,12 +1055,18 @@ protected function originalIsEquivalent($key, $current)

if ($current === $original) {
return true;
} elseif (is_null($current)) {
}

if (is_null($current)) {
return false;
} elseif ($this->isDateAttribute($key)) {
}

if ($this->isDateAttribute($key)) {
return $this->fromDateTime($current) ===
$this->fromDateTime($original);
} elseif ($this->hasCast($key)) {
}

if ($this->hasCast($key)) {
return $this->castAttribute($key, $current) ===
$this->castAttribute($key, $original);
}
Expand Down
8 changes: 6 additions & 2 deletions src/Illuminate/Database/Eloquent/Concerns/HasGlobalScopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ public static function addGlobalScope($scope, Closure $implementation = null)
{
if (is_string($scope) && ! is_null($implementation)) {
return static::$globalScopes[static::class][$scope] = $implementation;
} elseif ($scope instanceof Closure) {
}

if ($scope instanceof Closure) {
return static::$globalScopes[static::class][spl_object_hash($scope)] = $scope;
} elseif ($scope instanceof Scope) {
}

if ($scope instanceof Scope) {
return static::$globalScopes[static::class][get_class($scope)] = $scope;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ protected function getMigrationsForRollback(array $options)
{
if (($steps = $options['step'] ?? 0) > 0) {
return $this->repository->getMigrations($steps);
} else {
return $this->repository->getLast();
}

return $this->repository->getLast();
}

/**
Expand Down
20 changes: 14 additions & 6 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,13 @@ protected function parseSubSelect($query)
$query->columns = [$query->columns[0]];

return [$query->toSql(), $query->getBindings()];
} elseif (is_string($query)) {
}

if (is_string($query)) {
return [$query, []];
} else {
throw new InvalidArgumentException;
}

throw new InvalidArgumentException;
}

/**
Expand Down Expand Up @@ -587,7 +589,9 @@ protected function prepareValueAndOperator($value, $operator, $useDefault = fals
{
if ($useDefault) {
return [$operator, '='];
} elseif ($this->invalidOperatorAndValue($operator, $value)) {
}

if ($this->invalidOperatorAndValue($operator, $value)) {
throw new InvalidArgumentException('Illegal operator and value combination.');
}

Expand Down Expand Up @@ -1769,9 +1773,13 @@ public function getCountForPagination($columns = ['*'])
// just return the count of the entire results set since that will be correct.
if (isset($this->groups)) {
return count($results);
} elseif (! isset($results[0])) {
}

if (! isset($results[0])) {
return 0;
} elseif (is_object($results[0])) {
}

if (is_object($results[0])) {
return (int) $results[0]->aggregate;
}

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ protected function compileCreateEngine($sql, Connection $connection, Blueprint $
{
if (isset($blueprint->engine)) {
return $sql.' engine = '.$blueprint->engine;
} elseif (! is_null($engine = $connection->getConfig('engine'))) {
}

if (! is_null($engine = $connection->getConfig('engine'))) {
return $sql.' engine = '.$engine;
}

Expand Down
28 changes: 19 additions & 9 deletions src/Illuminate/Filesystem/FilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,21 @@ public function url($path)

if (method_exists($adapter, 'getUrl')) {
return $adapter->getUrl($path);
} elseif ($adapter instanceof AwsS3Adapter) {
}

if ($adapter instanceof AwsS3Adapter) {
return $this->getAwsUrl($adapter, $path);
} elseif ($adapter instanceof RackspaceAdapter) {
}

if ($adapter instanceof RackspaceAdapter) {
return $this->getRackspaceUrl($adapter, $path);
} elseif ($adapter instanceof LocalAdapter) {
}

if ($adapter instanceof LocalAdapter) {
return $this->getLocalUrl($path);
} else {
throw new RuntimeException('This driver does not support retrieving URLs.');
}

throw new RuntimeException('This driver does not support retrieving URLs.');
}

/**
Expand Down Expand Up @@ -470,13 +476,17 @@ public function temporaryUrl($path, $expiration, array $options = [])

if (method_exists($adapter, 'getTemporaryUrl')) {
return $adapter->getTemporaryUrl($path, $expiration, $options);
} elseif ($adapter instanceof AwsS3Adapter) {
}

if ($adapter instanceof AwsS3Adapter) {
return $this->getAwsTemporaryUrl($adapter, $path, $expiration, $options);
} elseif ($adapter instanceof RackspaceAdapter) {
}

if ($adapter instanceof RackspaceAdapter) {
return $this->getRackspaceTemporaryUrl($adapter, $path, $expiration, $options);
} else {
throw new RuntimeException('This driver does not support creating temporary URLs.');
}

throw new RuntimeException('This driver does not support creating temporary URLs.');
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Filesystem/FilesystemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ protected function resolve($name)

if (method_exists($this, $driverMethod)) {
return $this->{$driverMethod}($config);
} else {
throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
}

throw new InvalidArgumentException("Driver [{$config['driver']}] is not supported.");
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Console/TestMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ protected function getDefaultNamespace($rootNamespace)
{
if ($this->option('unit')) {
return $rootNamespace.'\Unit';
} else {
return $rootNamespace.'\Feature';
}

return $rootNamespace.'\Feature';
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Foundation/Console/VendorPublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,9 @@ protected function publishItem($from, $to)
{
if ($this->files->isFile($from)) {
return $this->publishFile($from, $to);
} elseif ($this->files->isDirectory($from)) {
}

if ($this->files->isDirectory($from)) {
return $this->publishDirectory($from, $to);
}

Expand Down
12 changes: 9 additions & 3 deletions src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,17 +168,23 @@ public function render($request, Exception $e)
{
if (method_exists($e, 'render') && $response = $e->render($request)) {
return Router::toResponse($request, $response);
} elseif ($e instanceof Responsable) {
}

if ($e instanceof Responsable) {
return $e->toResponse($request);
}

$e = $this->prepareException($e);

if ($e instanceof HttpResponseException) {
return $e->getResponse();
} elseif ($e instanceof AuthenticationException) {
}

if ($e instanceof AuthenticationException) {
return $this->unauthenticated($request, $e);
} elseif ($e instanceof ValidationException) {
}

if ($e instanceof ValidationException) {
return $this->convertValidationExceptionToResponse($e, $request);
}

Expand Down
8 changes: 6 additions & 2 deletions src/Illuminate/Foundation/Http/FormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,13 @@ protected function getRedirectUrl()

if ($this->redirect) {
return $url->to($this->redirect);
} elseif ($this->redirectRoute) {
}

if ($this->redirectRoute) {
return $url->route($this->redirectRoute);
} elseif ($this->redirectAction) {
}

if ($this->redirectAction) {
return $url->action($this->redirectAction);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Foundation/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,9 @@ function factory()

if (isset($arguments[1]) && is_string($arguments[1])) {
return $factory->of($arguments[0], $arguments[1])->times($arguments[2] ?? null);
} elseif (isset($arguments[1])) {
}

if (isset($arguments[1])) {
return $factory->of($arguments[0])->times($arguments[1]);
}

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Http/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ protected function morphToJson($content)
{
if ($content instanceof Jsonable) {
return $content->toJson();
} elseif ($content instanceof Arrayable) {
}

if ($content instanceof Arrayable) {
return json_encode($content->toArray());
}

Expand Down
8 changes: 6 additions & 2 deletions src/Illuminate/Log/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,13 @@ protected function formatMessage($message)
{
if (is_array($message)) {
return var_export($message, true);
} elseif ($message instanceof Jsonable) {
}

if ($message instanceof Jsonable) {
return $message->toJson();
} elseif ($message instanceof Arrayable) {
}

if ($message instanceof Arrayable) {
return var_export($message->toArray(), true);
}

Expand Down
8 changes: 6 additions & 2 deletions src/Illuminate/Mail/Mailable.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ protected function buildView()

if (isset($this->view, $this->textView)) {
return [$this->view, $this->textView];
} elseif (isset($this->textView)) {
}

if (isset($this->textView)) {
return ['text' => $this->textView];
}

Expand Down Expand Up @@ -522,7 +524,9 @@ protected function normalizeRecipient($recipient)
{
if (is_array($recipient)) {
return (object) $recipient;
} elseif (is_string($recipient)) {
}

if (is_string($recipient)) {
return (object) ['email' => $recipient];
}

Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Pipeline/Pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ protected function carry()
// otherwise we'll resolve the pipes out of the container and call it with
// the appropriate method and arguments, returning the results back out.
return $pipe($passable, $stack);
} elseif (! is_object($pipe)) {
}

if (! is_object($pipe)) {
list($name, $parameters) = $this->parsePipeString($pipe);

// If the pipe is a string we will parse the string and resolve the class out
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Queue/Console/ListFailedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ private function extractJobName($payload)

if ($payload && (! isset($payload['data']['command']))) {
return $payload['job'] ?? null;
} elseif ($payload && isset($payload['data']['command'])) {
}

if ($payload && isset($payload['data']['command'])) {
return $this->matchJobName($payload);
}
}
Expand Down
8 changes: 6 additions & 2 deletions src/Illuminate/Routing/Console/ControllerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ protected function getStub()
{
if ($this->option('parent')) {
return __DIR__.'/stubs/controller.nested.stub';
} elseif ($this->option('model')) {
}

if ($this->option('model')) {
return __DIR__.'/stubs/controller.model.stub';
} elseif ($this->option('resource')) {
}

if ($this->option('resource')) {
return __DIR__.'/stubs/controller.stub';
}

Expand Down
Loading