From 5818e1f41cf6c0aa7e4bd89d0622e149cf3ae6af Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Fri, 15 May 2020 04:11:11 +0000 Subject: [PATCH] Apply fixes from StyleCI [ci skip] [skip ci] --- src/Illuminate/Bus/BusServiceProvider.php | 1 - src/Illuminate/Bus/DatabaseBatchRepository.php | 2 +- .../Support/Testing/Fakes/BatchRepositoryFake.php | 5 ----- src/Illuminate/Support/Testing/Fakes/BusFake.php | 6 +----- tests/Bus/BusBatchableTest.php | 1 - tests/Bus/BusPendingBatchTest.php | 2 +- 6 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/Illuminate/Bus/BusServiceProvider.php b/src/Illuminate/Bus/BusServiceProvider.php index e8aa4fe8e886..bc1fc7b26e72 100644 --- a/src/Illuminate/Bus/BusServiceProvider.php +++ b/src/Illuminate/Bus/BusServiceProvider.php @@ -2,7 +2,6 @@ namespace Illuminate\Bus; -use Illuminate\Bus\BatchFactory; use Illuminate\Contracts\Bus\Dispatcher as DispatcherContract; use Illuminate\Contracts\Bus\QueueingDispatcher as QueueingDispatcherContract; use Illuminate\Contracts\Queue\Factory as QueueFactoryContract; diff --git a/src/Illuminate/Bus/DatabaseBatchRepository.php b/src/Illuminate/Bus/DatabaseBatchRepository.php index a113a51a9ca4..fd0bdad11a63 100644 --- a/src/Illuminate/Bus/DatabaseBatchRepository.php +++ b/src/Illuminate/Bus/DatabaseBatchRepository.php @@ -58,7 +58,7 @@ public function find(string $batchId) ->first(); if (! $batch) { - return null; + return; } return $this->factory->make( diff --git a/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php b/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php index 5e0ba7226383..bbdce932ee60 100644 --- a/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php +++ b/src/Illuminate/Support/Testing/Fakes/BatchRepositoryFake.php @@ -20,7 +20,6 @@ class BatchRepositoryFake implements BatchRepository */ public function find(string $batchId) { - return; } /** @@ -54,7 +53,6 @@ public function store(PendingBatch $batch) */ public function incrementTotalJobs(string $batchId, int $amount) { - return; } /** @@ -87,7 +85,6 @@ public function incrementFailedJobs(string $batchId) */ public function markAsFinished(string $batchId) { - return; } /** @@ -98,7 +95,6 @@ public function markAsFinished(string $batchId) */ public function cancel(string $batchId) { - return; } /** @@ -109,7 +105,6 @@ public function cancel(string $batchId) */ public function delete(string $batchId) { - return; } /** diff --git a/src/Illuminate/Support/Testing/Fakes/BusFake.php b/src/Illuminate/Support/Testing/Fakes/BusFake.php index 9291540e1fcd..cfd7ac61c284 100644 --- a/src/Illuminate/Support/Testing/Fakes/BusFake.php +++ b/src/Illuminate/Support/Testing/Fakes/BusFake.php @@ -2,14 +2,11 @@ namespace Illuminate\Support\Testing\Fakes; -use Carbon\CarbonImmutable; use Closure; use Illuminate\Bus\PendingBatch; use Illuminate\Collections\Arr; use Illuminate\Collections\Collection; use Illuminate\Contracts\Bus\QueueingDispatcher; -use Illuminate\Support\Facades\Facade; -use Illuminate\Support\Str; use Illuminate\Support\Traits\ReflectsClosures; use PHPUnit\Framework\Assert as PHPUnit; @@ -197,7 +194,7 @@ public function assertBatched(callable $callback) { PHPUnit::assertTrue( $this->batched($callback)->count() > 0, - "The expected batch was not dispatched." + 'The expected batch was not dispatched.' ); } @@ -371,7 +368,6 @@ public function dispatchAfterResponse($command) */ public function findBatch(string $batchId) { - return; } /** diff --git a/tests/Bus/BusBatchableTest.php b/tests/Bus/BusBatchableTest.php index 02a2a9efe3b3..422b606298e2 100644 --- a/tests/Bus/BusBatchableTest.php +++ b/tests/Bus/BusBatchableTest.php @@ -30,7 +30,6 @@ public function test_batch_may_be_retrieved() $repository->shouldReceive('find')->once()->with('test-batch-id')->andReturn('test-batch'); $container->instance(BatchRepository::class, $repository); - $this->assertEquals('test-batch', $class->batch()); Container::setInstance(null); diff --git a/tests/Bus/BusPendingBatchTest.php b/tests/Bus/BusPendingBatchTest.php index 5e0dbf15f6fd..e1f5a34f4780 100644 --- a/tests/Bus/BusPendingBatchTest.php +++ b/tests/Bus/BusPendingBatchTest.php @@ -2,8 +2,8 @@ namespace Illuminate\Tests\Bus; -use Illuminate\Bus\BatchRepository; use Illuminate\Bus\Batchable; +use Illuminate\Bus\BatchRepository; use Illuminate\Bus\PendingBatch; use Illuminate\Collections\Collection; use Illuminate\Container\Container;