Skip to content

Commit 2c72603

Browse files
authored
exception handling typehints (#54747)
1 parent 344c37f commit 2c72603

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function withExceptionHandling()
4444
/**
4545
* Only handle the given exceptions via the exception handler.
4646
*
47-
* @param array $exceptions
47+
* @param list<class-string<\Throwable>> $exceptions
4848
* @return $this
4949
*/
5050
protected function handleExceptions(array $exceptions)
@@ -65,7 +65,7 @@ protected function handleValidationExceptions()
6565
/**
6666
* Disable exception handling for the test.
6767
*
68-
* @param array $except
68+
* @param list<class-string<\Throwable>> $except
6969
* @return $this
7070
*/
7171
protected function withoutExceptionHandling(array $except = [])
@@ -87,7 +87,7 @@ protected function withoutExceptionHandling(array $except = [])
8787
* Create a new class instance.
8888
*
8989
* @param \Illuminate\Contracts\Debug\ExceptionHandler $originalHandler
90-
* @param array $except
90+
* @param list<class-string<\Throwable>> $except
9191
* @return void
9292
*/
9393
public function __construct($originalHandler, $except = [])
@@ -113,7 +113,7 @@ public function report(Throwable $e)
113113
* Determine if the exception should be reported.
114114
*
115115
* @param \Throwable $e
116-
* @return bool
116+
* @return false
117117
*/
118118
public function shouldReport(Throwable $e)
119119
{
@@ -172,7 +172,7 @@ public function renderForConsole($output, Throwable $e)
172172
* Assert that the given callback throws an exception with the given message when invoked.
173173
*
174174
* @param \Closure $test
175-
* @param \Closure|class-string<\Throwable> $expectedClass
175+
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $expectedClass
176176
* @param string|null $expectedMessage
177177
* @return $this
178178
*/

src/Illuminate/Support/Testing/Fakes/ExceptionHandlerFake.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ExceptionHandlerFake implements ExceptionHandler, Fake
2323
/**
2424
* All of the exceptions that have been reported.
2525
*
26-
* @var array<int, \Throwable>
26+
* @var list<\Throwable>
2727
*/
2828
protected $reported = [];
2929

@@ -38,7 +38,7 @@ class ExceptionHandlerFake implements ExceptionHandler, Fake
3838
* Create a new exception handler fake.
3939
*
4040
* @param \Illuminate\Contracts\Debug\ExceptionHandler $handler
41-
* @param array<int, class-string<\Throwable>> $exceptions
41+
* @param list<class-string<\Throwable>> $exceptions
4242
* @return void
4343
*/
4444
public function __construct(
@@ -61,7 +61,7 @@ public function handler()
6161
/**
6262
* Assert if an exception of the given type has been reported.
6363
*
64-
* @param \Closure|string $exception
64+
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $exception
6565
* @return void
6666
*/
6767
public function assertReported(Closure|string $exception)
@@ -107,7 +107,7 @@ public function assertReportedCount(int $count)
107107
/**
108108
* Assert if an exception of the given type has not been reported.
109109
*
110-
* @param \Closure|string $exception
110+
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $exception
111111
* @return void
112112
*/
113113
public function assertNotReported(Closure|string $exception)
@@ -263,7 +263,7 @@ public function setHandler(ExceptionHandler $handler)
263263
}
264264

265265
/**
266-
* Handle dynamic method calls to the mailer.
266+
* Handle dynamic method calls to the handler.
267267
*
268268
* @param string $method
269269
* @param array<string, mixed> $parameters

0 commit comments

Comments
 (0)