Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Remove useless else statements #47186

Merged
merged 3 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Illuminate/Cache/RedisLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Routing/ResourceRegistrar.php
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ public static function verbs(array $verbs = [])
{
if (empty($verbs)) {
return static::$verbs;
} else {
static::$verbs = array_merge(static::$verbs, $verbs);
}

static::$verbs = array_merge(static::$verbs, $verbs);
}
}
10 changes: 5 additions & 5 deletions src/Illuminate/Support/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ protected function createDriver($driver)
// callbacks allow developers to build their own "drivers" easily using Closures.
if (isset($this->customCreators[$driver])) {
return $this->callCustomCreator($driver);
} else {
$method = 'create'.Str::studly($driver).'Driver';
}

$method = 'create'.Str::studly($driver).'Driver';

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

throw new InvalidArgumentException("Driver [$driver] not supported.");
Expand Down