Skip to content

Commit ac8f610

Browse files
authored
Removed unused local variables. (#41224)
1 parent 9820e48 commit ac8f610

File tree

11 files changed

+8
-16
lines changed

11 files changed

+8
-16
lines changed

src/Illuminate/Cache/DatabaseLock.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ public function __construct(Connection $connection, $table, $name, $seconds, $ow
5656
*/
5757
public function acquire()
5858
{
59-
$acquired = false;
60-
6159
try {
6260
$this->connection->table($this->table)->insert([
6361
'key' => $this->name,

src/Illuminate/Collections/Collection.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,8 +1371,6 @@ protected function sortByMany(array $comparisons = [])
13711371
$ascending = Arr::get($comparison, 1, true) === true ||
13721372
Arr::get($comparison, 1, true) === 'asc';
13731373

1374-
$result = 0;
1375-
13761374
if (! is_string($prop) && is_callable($prop)) {
13771375
$result = $prop($a, $b);
13781376
} else {

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,7 @@ public function getQueueableRelations()
18321832
}
18331833

18341834
if ($relation instanceof QueueableEntity) {
1835-
foreach ($relation->getQueueableRelations() as $entityKey => $entityValue) {
1835+
foreach ($relation->getQueueableRelations() as $entityValue) {
18361836
$relations[] = $key.'.'.$entityValue;
18371837
}
18381838
}

src/Illuminate/Foundation/Console/RouteListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ protected function parseColumns(array $columns)
262262
{
263263
$results = [];
264264

265-
foreach ($columns as $i => $column) {
265+
foreach ($columns as $column) {
266266
if (str_contains($column, ',')) {
267267
$results = array_merge($results, explode(',', $column));
268268
} else {

src/Illuminate/Queue/Console/PruneBatchesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function handle()
5252

5353
$this->info("{$count} entries deleted!");
5454

55-
if ($unfinished = $this->option('unfinished')) {
55+
if ($this->option('unfinished')) {
5656
$count = 0;
5757

5858
if ($repository instanceof DatabaseBatchRepository) {

src/Illuminate/Queue/Console/PruneFailedJobsCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ public function handle()
4141
{
4242
$failer = $this->laravel['queue.failer'];
4343

44-
$count = 0;
45-
4644
if ($failer instanceof PrunableFailedJobProvider) {
4745
$count = $failer->prune(Carbon::now()->subHours($this->option('hours')));
4846
} else {

src/Illuminate/Routing/AbstractRouteCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ protected function addToSymfonyRoutesCollection(SymfonyRouteCollection $symfonyR
212212
}
213213

214214
if (! $name) {
215-
$route->name($name = $this->generateRouteName());
215+
$route->name($this->generateRouteName());
216216

217217
$this->add($route);
218218
} elseif (! is_null($symfonyRoutes->get($name))) {

src/Illuminate/Support/Str.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,8 +813,8 @@ public static function headline($value)
813813
$parts = explode(' ', $value);
814814

815815
$parts = count($parts) > 1
816-
? $parts = array_map([static::class, 'title'], $parts)
817-
: $parts = array_map([static::class, 'title'], static::ucsplit(implode('_', $parts)));
816+
? array_map([static::class, 'title'], $parts)
817+
: array_map([static::class, 'title'], static::ucsplit(implode('_', $parts)));
818818

819819
$collapsed = static::replace(['-', '_', ' '], '_', implode('_', $parts));
820820

src/Illuminate/Support/helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function optional($value = null, callable $callback = null)
204204
function preg_replace_array($pattern, array $replacements, $subject)
205205
{
206206
return preg_replace_callback($pattern, function () use (&$replacements) {
207-
foreach ($replacements as $key => $value) {
207+
foreach ($replacements as $value) {
208208
return array_shift($replacements);
209209
}
210210
}, $subject);

src/Illuminate/Testing/ParallelTesting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public function option($option)
261261
*/
262262
public function token()
263263
{
264-
return $token = $this->tokenResolver
264+
return $this->tokenResolver
265265
? call_user_func($this->tokenResolver)
266266
: ($_SERVER['TEST_TOKEN'] ?? false);
267267
}

0 commit comments

Comments
 (0)