From d3ff07dbb343b7aaaef2cc623cc32516d8551a68 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 19 Dec 2022 10:24:20 +0000 Subject: [PATCH] CS fixes --- src/Illuminate/Auth/EloquentUserProvider.php | 3 +- src/Illuminate/Database/Eloquent/Builder.php | 4 +- .../Auth/EmailVerificationRequest.php | 6 +- .../Foundation/Console/ServeCommand.php | 2 +- src/Illuminate/Queue/Console/ClearCommand.php | 2 +- src/Illuminate/Queue/Console/WorkCommand.php | 11 ++-- .../Redis/Connectors/PhpRedisConnector.php | 2 +- src/Illuminate/Support/Facades/Cache.php | 2 +- src/Illuminate/Testing/PendingCommand.php | 2 +- src/Illuminate/Testing/TestComponent.php | 4 +- src/Illuminate/Testing/TestResponse.php | 12 ++-- src/Illuminate/Testing/TestView.php | 4 +- .../Concerns/ValidatesAttributes.php | 2 +- tests/Integration/Cookie/CookieTest.php | 4 +- .../Events/QueuedClosureListenerTest.php | 3 +- tests/Integration/Http/ResourceTest.php | 2 +- tests/Pagination/LengthAwarePaginatorTest.php | 60 ++++++++++++------- tests/Pagination/PaginatorTest.php | 21 +++---- tests/Queue/QueueDatabaseQueueUnitTest.php | 9 ++- tests/Queue/RedisQueueIntegrationTest.php | 1 + tests/Support/SupportCollectionTest.php | 6 +- tests/Support/SupportHelpersTest.php | 38 +++++++----- .../SupportLazyCollectionIsLazyTest.php | 2 +- 23 files changed, 109 insertions(+), 93 deletions(-) diff --git a/src/Illuminate/Auth/EloquentUserProvider.php b/src/Illuminate/Auth/EloquentUserProvider.php index 54dff6b87f2c..a9fd66e70064 100755 --- a/src/Illuminate/Auth/EloquentUserProvider.php +++ b/src/Illuminate/Auth/EloquentUserProvider.php @@ -74,8 +74,7 @@ public function retrieveByToken($identifier, $token) $rememberToken = $retrievedModel->getRememberToken(); - return $rememberToken && hash_equals($rememberToken, $token) - ? $retrievedModel : null; + return $rememberToken && hash_equals($rememberToken, $token) ? $retrievedModel : null; } /** diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index babd44b857e7..ceeaaec24a2c 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -1706,8 +1706,8 @@ public static function __callStatic($method, $parameters) protected static function registerMixin($mixin, $replace) { $methods = (new ReflectionClass($mixin))->getMethods( - ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED - ); + ReflectionMethod::IS_PUBLIC | ReflectionMethod::IS_PROTECTED + ); foreach ($methods as $method) { if ($replace || ! static::hasGlobalMacro($method->name)) { diff --git a/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php b/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php index 081d66bdd83a..9cbe9b511827 100644 --- a/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php +++ b/src/Illuminate/Foundation/Auth/EmailVerificationRequest.php @@ -14,13 +14,11 @@ class EmailVerificationRequest extends FormRequest */ public function authorize() { - if (! hash_equals((string) $this->user()->getKey(), - (string) $this->route('id'))) { + if (! hash_equals((string) $this->user()->getKey(), (string) $this->route('id'))) { return false; } - if (! hash_equals(sha1($this->user()->getEmailForVerification()), - (string) $this->route('hash'))) { + if (! hash_equals(sha1($this->user()->getEmailForVerification()), (string) $this->route('hash'))) { return false; } diff --git a/src/Illuminate/Foundation/Console/ServeCommand.php b/src/Illuminate/Foundation/Console/ServeCommand.php index ddb07e824eca..3aaf0d634439 100644 --- a/src/Illuminate/Foundation/Console/ServeCommand.php +++ b/src/Illuminate/Foundation/Console/ServeCommand.php @@ -141,7 +141,7 @@ protected function serverCommand() */ protected function host() { - [$host, ] = $this->getHostAndPort(); + [$host] = $this->getHostAndPort(); return $host; } diff --git a/src/Illuminate/Queue/Console/ClearCommand.php b/src/Illuminate/Queue/Console/ClearCommand.php index ff9f936021f8..48eed2b47001 100644 --- a/src/Illuminate/Queue/Console/ClearCommand.php +++ b/src/Illuminate/Queue/Console/ClearCommand.php @@ -46,7 +46,7 @@ public function handle() // connection being run for the queue operation currently being executed. $queueName = $this->getQueue($connection); - $queue = ($this->laravel['queue'])->connection($connection); + $queue = $this->laravel['queue']->connection($connection); if ($queue instanceof ClearableQueue) { $count = $queue->clear($queueName); diff --git a/src/Illuminate/Queue/Console/WorkCommand.php b/src/Illuminate/Queue/Console/WorkCommand.php index da9176be4063..2eed27b2e9a7 100644 --- a/src/Illuminate/Queue/Console/WorkCommand.php +++ b/src/Illuminate/Queue/Console/WorkCommand.php @@ -111,11 +111,12 @@ public function handle() */ protected function runWorker($connection, $queue) { - return $this->worker->setName($this->option('name')) - ->setCache($this->cache) - ->{$this->option('once') ? 'runNextJob' : 'daemon'}( - $connection, $queue, $this->gatherWorkerOptions() - ); + return $this->worker + ->setName($this->option('name')) + ->setCache($this->cache) + ->{$this->option('once') ? 'runNextJob' : 'daemon'}( + $connection, $queue, $this->gatherWorkerOptions() + ); } /** diff --git a/src/Illuminate/Redis/Connectors/PhpRedisConnector.php b/src/Illuminate/Redis/Connectors/PhpRedisConnector.php index 1c48bdfaaa51..b935a6e2db73 100644 --- a/src/Illuminate/Redis/Connectors/PhpRedisConnector.php +++ b/src/Illuminate/Redis/Connectors/PhpRedisConnector.php @@ -150,7 +150,7 @@ protected function establishConnection($client, array $config) } } - $client->{($persistent ? 'pconnect' : 'connect')}(...$parameters); + $client->{$persistent ? 'pconnect' : 'connect'}(...$parameters); } /** diff --git a/src/Illuminate/Support/Facades/Cache.php b/src/Illuminate/Support/Facades/Cache.php index 70aa1dc48395..168c3518e79b 100755 --- a/src/Illuminate/Support/Facades/Cache.php +++ b/src/Illuminate/Support/Facades/Cache.php @@ -6,7 +6,7 @@ * @method static \Illuminate\Cache\TaggedCache tags(array|mixed $names) * @method static \Illuminate\Contracts\Cache\Lock lock(string $name, int $seconds = 0, mixed $owner = null) * @method static \Illuminate\Contracts\Cache\Lock restoreLock(string $name, string $owner) - * @method static \Illuminate\Contracts\Cache\Repository store(string|null $name = null) + * @method static \Illuminate\Contracts\Cache\Repository store(string|null $name = null) * @method static \Illuminate\Contracts\Cache\Store getStore() * @method static bool add(string $key, $value, \DateTimeInterface|\DateInterval|int $ttl = null) * @method static bool flush() diff --git a/src/Illuminate/Testing/PendingCommand.php b/src/Illuminate/Testing/PendingCommand.php index 870108644336..a193b6a55d78 100644 --- a/src/Illuminate/Testing/PendingCommand.php +++ b/src/Illuminate/Testing/PendingCommand.php @@ -324,7 +324,7 @@ protected function verifyExpectations() protected function mockConsoleOutput() { $mock = Mockery::mock(OutputStyle::class.'[askQuestion]', [ - (new ArrayInput($this->parameters)), $this->createABufferedOutputMock(), + new ArrayInput($this->parameters), $this->createABufferedOutputMock(), ]); foreach ($this->test->expectedQuestions as $i => $question) { diff --git a/src/Illuminate/Testing/TestComponent.php b/src/Illuminate/Testing/TestComponent.php index 21663aa8d2f3..54bf90cd23fe 100644 --- a/src/Illuminate/Testing/TestComponent.php +++ b/src/Illuminate/Testing/TestComponent.php @@ -61,7 +61,7 @@ public function assertSee($value, $escape = true) */ public function assertSeeInOrder(array $values, $escape = true) { - $values = $escape ? array_map('e', ($values)) : $values; + $values = $escape ? array_map('e', $values) : $values; PHPUnit::assertThat($values, new SeeInOrder($this->rendered)); @@ -93,7 +93,7 @@ public function assertSeeText($value, $escape = true) */ public function assertSeeTextInOrder(array $values, $escape = true) { - $values = $escape ? array_map('e', ($values)) : $values; + $values = $escape ? array_map('e', $values) : $values; PHPUnit::assertThat($values, new SeeInOrder(strip_tags($this->rendered))); diff --git a/src/Illuminate/Testing/TestResponse.php b/src/Illuminate/Testing/TestResponse.php index b89af2630a6e..17ad09c1b5e4 100644 --- a/src/Illuminate/Testing/TestResponse.php +++ b/src/Illuminate/Testing/TestResponse.php @@ -575,7 +575,7 @@ public function assertSee($value, $escape = true) { $value = Arr::wrap($value); - $values = $escape ? array_map('e', ($value)) : $value; + $values = $escape ? array_map('e', $value) : $value; foreach ($values as $value) { PHPUnit::assertStringContainsString((string) $value, $this->getContent()); @@ -593,7 +593,7 @@ public function assertSee($value, $escape = true) */ public function assertSeeInOrder(array $values, $escape = true) { - $values = $escape ? array_map('e', ($values)) : $values; + $values = $escape ? array_map('e', $values) : $values; PHPUnit::assertThat($values, new SeeInOrder($this->getContent())); @@ -611,7 +611,7 @@ public function assertSeeText($value, $escape = true) { $value = Arr::wrap($value); - $values = $escape ? array_map('e', ($value)) : $value; + $values = $escape ? array_map('e', $value) : $value; tap(strip_tags($this->getContent()), function ($content) use ($values) { foreach ($values as $value) { @@ -631,7 +631,7 @@ public function assertSeeText($value, $escape = true) */ public function assertSeeTextInOrder(array $values, $escape = true) { - $values = $escape ? array_map('e', ($values)) : $values; + $values = $escape ? array_map('e', $values) : $values; PHPUnit::assertThat($values, new SeeInOrder(strip_tags($this->getContent()))); @@ -649,7 +649,7 @@ public function assertDontSee($value, $escape = true) { $value = Arr::wrap($value); - $values = $escape ? array_map('e', ($value)) : $value; + $values = $escape ? array_map('e', $value) : $value; foreach ($values as $value) { PHPUnit::assertStringNotContainsString((string) $value, $this->getContent()); @@ -669,7 +669,7 @@ public function assertDontSeeText($value, $escape = true) { $value = Arr::wrap($value); - $values = $escape ? array_map('e', ($value)) : $value; + $values = $escape ? array_map('e', $value) : $value; tap(strip_tags($this->getContent()), function ($content) use ($values) { foreach ($values as $value) { diff --git a/src/Illuminate/Testing/TestView.php b/src/Illuminate/Testing/TestView.php index 3642c3f216a1..4b6f510c4d6f 100644 --- a/src/Illuminate/Testing/TestView.php +++ b/src/Illuminate/Testing/TestView.php @@ -62,7 +62,7 @@ public function assertSee($value, $escape = true) */ public function assertSeeInOrder(array $values, $escape = true) { - $values = $escape ? array_map('e', ($values)) : $values; + $values = $escape ? array_map('e', $values) : $values; PHPUnit::assertThat($values, new SeeInOrder($this->rendered)); @@ -94,7 +94,7 @@ public function assertSeeText($value, $escape = true) */ public function assertSeeTextInOrder(array $values, $escape = true) { - $values = $escape ? array_map('e', ($values)) : $values; + $values = $escape ? array_map('e', $values) : $values; PHPUnit::assertThat($values, new SeeInOrder(strip_tags($this->rendered))); diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index 2974174f107a..620e3984e9c7 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -272,7 +272,7 @@ protected function checkDateTimeOrder($format, $first, $second, $operator) $secondDate = $this->getDateTimeWithOptionalFormat($format, $second); } - return ($firstDate && $secondDate) && ($this->compare($firstDate, $secondDate, $operator)); + return ($firstDate && $secondDate) && $this->compare($firstDate, $secondDate, $operator); } /** diff --git a/tests/Integration/Cookie/CookieTest.php b/tests/Integration/Cookie/CookieTest.php index 543d0ffd4bfd..d92829f7a9fa 100644 --- a/tests/Integration/Cookie/CookieTest.php +++ b/tests/Integration/Cookie/CookieTest.php @@ -24,7 +24,7 @@ public function test_cookie_is_sent_back_with_proper_expire_time_when_should_exp $response = $this->get('/'); $this->assertCount(2, $response->headers->getCookies()); - $this->assertEquals(0, ($response->headers->getCookies()[1])->getExpiresTime()); + $this->assertEquals(0, $response->headers->getCookies()[1]->getExpiresTime()); } public function test_cookie_is_sent_back_with_proper_expire_time_with_respect_to_lifetime() @@ -39,7 +39,7 @@ public function test_cookie_is_sent_back_with_proper_expire_time_with_respect_to Carbon::setTestNow(Carbon::now()); $response = $this->get('/'); $this->assertCount(2, $response->headers->getCookies()); - $this->assertEquals(Carbon::now()->getTimestamp() + 60, ($response->headers->getCookies()[1])->getExpiresTime()); + $this->assertEquals(Carbon::now()->getTimestamp() + 60, $response->headers->getCookies()[1]->getExpiresTime()); } protected function getEnvironmentSetUp($app) diff --git a/tests/Integration/Events/QueuedClosureListenerTest.php b/tests/Integration/Events/QueuedClosureListenerTest.php index 790f364afd97..be8a5fc8d120 100644 --- a/tests/Integration/Events/QueuedClosureListenerTest.php +++ b/tests/Integration/Events/QueuedClosureListenerTest.php @@ -4,7 +4,6 @@ use Illuminate\Events\CallQueuedListener; use Illuminate\Events\InvokeQueuedClosure; -use function Illuminate\Events\queueable; use Illuminate\Support\Facades\Bus; use Illuminate\Support\Facades\Event; use Orchestra\Testbench\TestCase; @@ -15,7 +14,7 @@ public function testAnonymousQueuedListenerIsQueued() { Bus::fake(); - Event::listen(queueable(function (TestEvent $event) { + Event::listen(\Illuminate\Events\queueable(function (TestEvent $event) { // })->catch(function (TestEvent $event) { // diff --git a/tests/Integration/Http/ResourceTest.php b/tests/Integration/Http/ResourceTest.php index 94eff8839383..95aab3c640fb 100644 --- a/tests/Integration/Http/ResourceTest.php +++ b/tests/Integration/Http/ResourceTest.php @@ -1321,7 +1321,7 @@ public function work() 'Mohamed', $this->mergeWhen(false, ['Adam', 'Matt']), 'Jeffrey', - $this->mergeWhen(false, (['Abigail', 'Lydia'])), + $this->mergeWhen(false, ['Abigail', 'Lydia']), ]); } }; diff --git a/tests/Pagination/LengthAwarePaginatorTest.php b/tests/Pagination/LengthAwarePaginatorTest.php index bcdc4759218b..d5711d6ba802 100644 --- a/tests/Pagination/LengthAwarePaginatorTest.php +++ b/tests/Pagination/LengthAwarePaginatorTest.php @@ -74,17 +74,25 @@ public function testLengthAwarePaginatorCanGenerateUrls() $this->p->setPath('http://website.com'); $this->p->setPageName('foo'); - $this->assertSame('http://website.com', - $this->p->path()); - - $this->assertSame('http://website.com?foo=2', - $this->p->url($this->p->currentPage())); - - $this->assertSame('http://website.com?foo=1', - $this->p->url($this->p->currentPage() - 1)); - - $this->assertSame('http://website.com?foo=1', - $this->p->url($this->p->currentPage() - 2)); + $this->assertSame( + 'http://website.com', + $this->p->path() + ); + + $this->assertSame( + 'http://website.com?foo=2', + $this->p->url($this->p->currentPage()) + ); + + $this->assertSame( + 'http://website.com?foo=1', + $this->p->url($this->p->currentPage() - 1) + ); + + $this->assertSame( + 'http://website.com?foo=1', + $this->p->url($this->p->currentPage() - 2) + ); } public function testLengthAwarePaginatorCanGenerateUrlsWithQuery() @@ -92,8 +100,10 @@ public function testLengthAwarePaginatorCanGenerateUrlsWithQuery() $this->p->setPath('http://website.com?sort_by=date'); $this->p->setPageName('foo'); - $this->assertSame('http://website.com?sort_by=date&foo=2', - $this->p->url($this->p->currentPage())); + $this->assertSame( + 'http://website.com?sort_by=date&foo=2', + $this->p->url($this->p->currentPage()) + ); } public function testLengthAwarePaginatorCanGenerateUrlsWithoutTrailingSlashes() @@ -101,14 +111,20 @@ public function testLengthAwarePaginatorCanGenerateUrlsWithoutTrailingSlashes() $this->p->setPath('http://website.com/test'); $this->p->setPageName('foo'); - $this->assertSame('http://website.com/test?foo=2', - $this->p->url($this->p->currentPage())); + $this->assertSame( + 'http://website.com/test?foo=2', + $this->p->url($this->p->currentPage()) + ); - $this->assertSame('http://website.com/test?foo=1', - $this->p->url($this->p->currentPage() - 1)); + $this->assertSame( + 'http://website.com/test?foo=1', + $this->p->url($this->p->currentPage() - 1) + ); - $this->assertSame('http://website.com/test?foo=1', - $this->p->url($this->p->currentPage() - 2)); + $this->assertSame( + 'http://website.com/test?foo=1', + $this->p->url($this->p->currentPage() - 2) + ); } public function testLengthAwarePaginatorCorrectlyGenerateUrlsWithQueryAndSpaces() @@ -116,8 +132,10 @@ public function testLengthAwarePaginatorCorrectlyGenerateUrlsWithQueryAndSpaces( $this->p->setPath('http://website.com?key=value%20with%20spaces'); $this->p->setPageName('foo'); - $this->assertSame('http://website.com?key=value%20with%20spaces&foo=2', - $this->p->url($this->p->currentPage())); + $this->assertSame( + 'http://website.com?key=value%20with%20spaces&foo=2', + $this->p->url($this->p->currentPage()) + ); } public function testItRetrievesThePaginatorOptions() diff --git a/tests/Pagination/PaginatorTest.php b/tests/Pagination/PaginatorTest.php index aa1011af5100..5c60ad3caa05 100644 --- a/tests/Pagination/PaginatorTest.php +++ b/tests/Pagination/PaginatorTest.php @@ -9,7 +9,7 @@ class PaginatorTest extends TestCase { public function testSimplePaginatorReturnsRelevantContextInformation() { - $p = new Paginator($array = ['item3', 'item4', 'item5'], 2, 2); + $p = new Paginator(['item3', 'item4', 'item5'], 2, 2); $this->assertEquals(2, $p->currentPage()); $this->assertTrue($p->hasPages()); @@ -33,40 +33,35 @@ public function testSimplePaginatorReturnsRelevantContextInformation() public function testPaginatorRemovesTrailingSlashes() { - $p = new Paginator($array = ['item1', 'item2', 'item3'], 2, 2, - ['path' => 'http://website.com/test/']); + $p = new Paginator(['item1', 'item2', 'item3'], 2, 2, ['path' => 'http://website.com/test/']); $this->assertSame('http://website.com/test?page=1', $p->previousPageUrl()); } public function testPaginatorGeneratesUrlsWithoutTrailingSlash() { - $p = new Paginator($array = ['item1', 'item2', 'item3'], 2, 2, - ['path' => 'http://website.com/test']); + $p = new Paginator(['item1', 'item2', 'item3'], 2, 2, ['path' => 'http://website.com/test']); $this->assertSame('http://website.com/test?page=1', $p->previousPageUrl()); } public function testItRetrievesThePaginatorOptions() { - $p = new Paginator($array = ['item1', 'item2', 'item3'], 2, 2, - $options = ['path' => 'http://website.com/test']); + $p = new Paginator(['item1', 'item2', 'item3'], 2, 2, ['path' => 'http://website.com/test']); - $this->assertSame($p->getOptions(), $options); + $this->assertSame(['path' => 'http://website.com/test'], $p->getOptions()); } public function testPaginatorReturnsPath() { - $p = new Paginator($array = ['item1', 'item2', 'item3'], 2, 2, - ['path' => 'http://website.com/test']); + $p = new Paginator(['item1', 'item2', 'item3'], 2, 2, ['path' => 'http://website.com/test']); - $this->assertSame($p->path(), 'http://website.com/test'); + $this->assertSame('http://website.com/test', $p->path()); } public function testCanTransformPaginatorItems() { - $p = new Paginator($array = ['item1', 'item2', 'item3'], 3, 1, - ['path' => 'http://website.com/test']); + $p = new Paginator(['item1', 'item2', 'item3'], 3, 1, ['path' => 'http://website.com/test']); $p->through(function ($item) { return substr($item, 4, 1); diff --git a/tests/Queue/QueueDatabaseQueueUnitTest.php b/tests/Queue/QueueDatabaseQueueUnitTest.php index 118a38434ac1..021e037de007 100644 --- a/tests/Queue/QueueDatabaseQueueUnitTest.php +++ b/tests/Queue/QueueDatabaseQueueUnitTest.php @@ -54,11 +54,10 @@ public function testDelayedPushProperlyPushesJobOntoDatabase() return $uuid; }); - $queue = $this->getMockBuilder( - DatabaseQueue::class)->onlyMethods( - ['currentTime'])->setConstructorArgs( - [$database = m::mock(Connection::class), 'table', 'default'] - )->getMock(); + $queue = $this->getMockBuilder(DatabaseQueue::class) + ->onlyMethods(['currentTime']) + ->setConstructorArgs([$database = m::mock(Connection::class), 'table', 'default']) + ->getMock(); $queue->expects($this->any())->method('currentTime')->willReturn('time'); $queue->setContainer($container = m::spy(Container::class)); $database->shouldReceive('table')->with('table')->andReturn($query = m::mock(stdClass::class)); diff --git a/tests/Queue/RedisQueueIntegrationTest.php b/tests/Queue/RedisQueueIntegrationTest.php index 18f543492052..6328e7c5ad56 100644 --- a/tests/Queue/RedisQueueIntegrationTest.php +++ b/tests/Queue/RedisQueueIntegrationTest.php @@ -77,6 +77,7 @@ public function testExpiredJobsArePopped($driver) /** * @dataProvider redisDriverProvider + * * @requires extension pcntl * * @param mixed $driver diff --git a/tests/Support/SupportCollectionTest.php b/tests/Support/SupportCollectionTest.php index b699b8df0489..d52493865662 100755 --- a/tests/Support/SupportCollectionTest.php +++ b/tests/Support/SupportCollectionTest.php @@ -4344,7 +4344,7 @@ public function testSplitCollectionIntoThreeWithCountOfFour($collection) $data->split(3)->map(function (Collection $chunk) { return $chunk->values()->toArray(); })->toArray() - ); + ); } /** @@ -4359,7 +4359,7 @@ public function testSplitCollectionIntoThreeWithCountOfFive($collection) $data->split(3)->map(function (Collection $chunk) { return $chunk->values()->toArray(); })->toArray() - ); + ); } /** @@ -4374,7 +4374,7 @@ public function testSplitCollectionIntoSixWithCountOfTen($collection) $data->split(6)->map(function (Collection $chunk) { return $chunk->values()->toArray(); })->toArray() - ); + ); } /** diff --git a/tests/Support/SupportHelpersTest.php b/tests/Support/SupportHelpersTest.php index 50b702a7c15b..e6cea4cec74a 100755 --- a/tests/Support/SupportHelpersTest.php +++ b/tests/Support/SupportHelpersTest.php @@ -327,30 +327,36 @@ public function testLast() public function testClassUsesRecursiveShouldReturnTraitsOnParentClasses() { - $this->assertSame([ - SupportTestTraitTwo::class => SupportTestTraitTwo::class, - SupportTestTraitOne::class => SupportTestTraitOne::class, - ], - class_uses_recursive(SupportTestClassTwo::class)); + $this->assertSame( + [ + SupportTestTraitTwo::class => SupportTestTraitTwo::class, + SupportTestTraitOne::class => SupportTestTraitOne::class, + ], + class_uses_recursive(SupportTestClassTwo::class) + ); } public function testClassUsesRecursiveAcceptsObject() { - $this->assertSame([ - SupportTestTraitTwo::class => SupportTestTraitTwo::class, - SupportTestTraitOne::class => SupportTestTraitOne::class, - ], - class_uses_recursive(new SupportTestClassTwo)); + $this->assertSame( + [ + SupportTestTraitTwo::class => SupportTestTraitTwo::class, + SupportTestTraitOne::class => SupportTestTraitOne::class, + ], + class_uses_recursive(new SupportTestClassTwo) + ); } public function testClassUsesRecursiveReturnParentTraitsFirst() { - $this->assertSame([ - SupportTestTraitTwo::class => SupportTestTraitTwo::class, - SupportTestTraitOne::class => SupportTestTraitOne::class, - SupportTestTraitThree::class => SupportTestTraitThree::class, - ], - class_uses_recursive(SupportTestClassThree::class)); + $this->assertSame( + [ + SupportTestTraitTwo::class => SupportTestTraitTwo::class, + SupportTestTraitOne::class => SupportTestTraitOne::class, + SupportTestTraitThree::class => SupportTestTraitThree::class, + ], + class_uses_recursive(SupportTestClassThree::class) + ); } public function testTap() diff --git a/tests/Support/SupportLazyCollectionIsLazyTest.php b/tests/Support/SupportLazyCollectionIsLazyTest.php index 14ff3f49278a..c82669986e8f 100644 --- a/tests/Support/SupportLazyCollectionIsLazyTest.php +++ b/tests/Support/SupportLazyCollectionIsLazyTest.php @@ -1444,7 +1444,7 @@ public function testWhereInstanceOfIsLazy() $data = $this->make(['a' => 0])->concat( $this->make([['a' => 1], ['a' => 2], ['a' => 3], ['a' => 4]]) ->mapInto(stdClass::class) - ); + ); $this->assertDoesNotEnumerateCollection($data, function ($collection) { $collection->whereInstanceOf(stdClass::class);