diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 2ae1f76c8b99..58cee5281cb1 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -579,7 +579,7 @@ protected function pingCallback($url) return function (Container $container, HttpClient $http) use ($url) { try { $http->request('GET', $url); - } catch (ClientExceptionInterface | TransferException $e) { + } catch (ClientExceptionInterface|TransferException $e) { $container->make(ExceptionHandler::class)->report($e); } }; diff --git a/src/Illuminate/Routing/CompiledRouteCollection.php b/src/Illuminate/Routing/CompiledRouteCollection.php index ab31b6ac34fd..095d3a9b9fee 100644 --- a/src/Illuminate/Routing/CompiledRouteCollection.php +++ b/src/Illuminate/Routing/CompiledRouteCollection.php @@ -121,7 +121,7 @@ public function match(Request $request) if ($result = $matcher->matchRequest($trimmedRequest)) { $route = $this->getByName($result['_route']); } - } catch (ResourceNotFoundException | MethodNotAllowedException $e) { + } catch (ResourceNotFoundException|MethodNotAllowedException $e) { try { return $this->routes->match($request); } catch (NotFoundHttpException $e) { @@ -136,7 +136,7 @@ public function match(Request $request) if (! $dynamicRoute->isFallback) { $route = $dynamicRoute; } - } catch (NotFoundHttpException | MethodNotAllowedHttpException $e) { + } catch (NotFoundHttpException|MethodNotAllowedHttpException $e) { // } } diff --git a/src/Illuminate/Support/Traits/ForwardsCalls.php b/src/Illuminate/Support/Traits/ForwardsCalls.php index bf9a2fc0445f..8b7add869689 100644 --- a/src/Illuminate/Support/Traits/ForwardsCalls.php +++ b/src/Illuminate/Support/Traits/ForwardsCalls.php @@ -21,7 +21,7 @@ protected function forwardCallTo($object, $method, $parameters) { try { return $object->{$method}(...$parameters); - } catch (Error | BadMethodCallException $e) { + } catch (Error|BadMethodCallException $e) { $pattern = '~^Call to undefined method (?P[^:]+)::(?P[^\(]+)\(\)$~'; if (! preg_match($pattern, $e->getMessage(), $matches)) { diff --git a/tests/Database/DatabaseConnectionTest.php b/tests/Database/DatabaseConnectionTest.php index 47764954d2ef..d6507c9b6b8d 100755 --- a/tests/Database/DatabaseConnectionTest.php +++ b/tests/Database/DatabaseConnectionTest.php @@ -99,9 +99,9 @@ public function testUpdateCallsTheAffectingStatementMethod() public function testDeleteCallsTheAffectingStatementMethod() { $connection = $this->getMockConnection(['affectingStatement']); - $connection->expects($this->once())->method('affectingStatement')->with($this->equalTo('foo'), $this->equalTo(['bar']))->willReturn('baz'); + $connection->expects($this->once())->method('affectingStatement')->with($this->equalTo('foo'), $this->equalTo(['bar']))->willReturn(true); $results = $connection->delete('foo', ['bar']); - $this->assertSame('baz', $results); + $this->assertTrue($results); } public function testStatementProperlyCallsPDO() @@ -109,12 +109,12 @@ public function testStatementProperlyCallsPDO() $pdo = $this->getMockBuilder(DatabaseConnectionTestMockPDO::class)->onlyMethods(['prepare'])->getMock(); $statement = $this->getMockBuilder('PDOStatement')->onlyMethods(['execute', 'bindValue'])->getMock(); $statement->expects($this->once())->method('bindValue')->with(1, 'bar', 2); - $statement->expects($this->once())->method('execute')->willReturn('foo'); + $statement->expects($this->once())->method('execute')->willReturn(true); $pdo->expects($this->once())->method('prepare')->with($this->equalTo('foo'))->willReturn($statement); $mock = $this->getMockConnection(['prepareBindings'], $pdo); $mock->expects($this->once())->method('prepareBindings')->with($this->equalTo(['bar']))->willReturn(['bar']); $results = $mock->statement('foo', ['bar']); - $this->assertSame('foo', $results); + $this->assertTrue($results); $log = $mock->getQueryLog(); $this->assertSame('foo', $log[0]['query']); $this->assertEquals(['bar'], $log[0]['bindings']); @@ -127,12 +127,12 @@ public function testAffectingStatementProperlyCallsPDO() $statement = $this->getMockBuilder('PDOStatement')->onlyMethods(['execute', 'rowCount', 'bindValue'])->getMock(); $statement->expects($this->once())->method('bindValue')->with('foo', 'bar', 2); $statement->expects($this->once())->method('execute'); - $statement->expects($this->once())->method('rowCount')->willReturn(['boom']); + $statement->expects($this->once())->method('rowCount')->willReturn(42); $pdo->expects($this->once())->method('prepare')->with('foo')->willReturn($statement); $mock = $this->getMockConnection(['prepareBindings'], $pdo); $mock->expects($this->once())->method('prepareBindings')->with($this->equalTo(['foo' => 'bar']))->willReturn(['foo' => 'bar']); $results = $mock->update('foo', ['foo' => 'bar']); - $this->assertEquals(['boom'], $results); + $this->assertSame(42, $results); $log = $mock->getQueryLog(); $this->assertSame('foo', $log[0]['query']); $this->assertEquals(['foo' => 'bar'], $log[0]['bindings']); diff --git a/tests/Integration/Foundation/Fixtures/EventDiscovery/UnionListeners/UnionListener.php b/tests/Integration/Foundation/Fixtures/EventDiscovery/UnionListeners/UnionListener.php index 5554b49a8df9..6911e9e1f71b 100644 --- a/tests/Integration/Foundation/Fixtures/EventDiscovery/UnionListeners/UnionListener.php +++ b/tests/Integration/Foundation/Fixtures/EventDiscovery/UnionListeners/UnionListener.php @@ -7,7 +7,7 @@ class UnionListener { - public function handle(EventOne | EventTwo $event) + public function handle(EventOne|EventTwo $event) { // } diff --git a/tests/Support/Fixtures/UnionTypesClosure.php b/tests/Support/Fixtures/UnionTypesClosure.php index 3e820646ac46..48cf8f91e73d 100644 --- a/tests/Support/Fixtures/UnionTypesClosure.php +++ b/tests/Support/Fixtures/UnionTypesClosure.php @@ -3,6 +3,6 @@ use Illuminate\Tests\Support\AnotherExampleParameter; use Illuminate\Tests\Support\ExampleParameter; -return function (ExampleParameter | AnotherExampleParameter $a, $b) { +return function (ExampleParameter|AnotherExampleParameter $a, $b) { // };