Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Improved typehints for InteractsWithExceptionHandling && ExceptionHandlerFake #54747

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function withExceptionHandling()
/**
* Only handle the given exceptions via the exception handler.
*
* @param array $exceptions
* @param list<class-string<\Throwable>> $exceptions
* @return $this
*/
protected function handleExceptions(array $exceptions)
Expand All @@ -65,7 +65,7 @@ protected function handleValidationExceptions()
/**
* Disable exception handling for the test.
*
* @param array $except
* @param list<class-string<\Throwable>> $except
* @return $this
*/
protected function withoutExceptionHandling(array $except = [])
Expand All @@ -87,7 +87,7 @@ protected function withoutExceptionHandling(array $except = [])
* Create a new class instance.
*
* @param \Illuminate\Contracts\Debug\ExceptionHandler $originalHandler
* @param array $except
* @param list<class-string<\Throwable>> $except
* @return void
*/
public function __construct($originalHandler, $except = [])
Expand All @@ -113,7 +113,7 @@ public function report(Throwable $e)
* Determine if the exception should be reported.
*
* @param \Throwable $e
* @return bool
* @return false
*/
public function shouldReport(Throwable $e)
{
Expand Down Expand Up @@ -172,7 +172,7 @@ public function renderForConsole($output, Throwable $e)
* Assert that the given callback throws an exception with the given message when invoked.
*
* @param \Closure $test
* @param \Closure|class-string<\Throwable> $expectedClass
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $expectedClass
* @param string|null $expectedMessage
* @return $this
*/
Expand Down
10 changes: 5 additions & 5 deletions src/Illuminate/Support/Testing/Fakes/ExceptionHandlerFake.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ExceptionHandlerFake implements ExceptionHandler, Fake
/**
* All of the exceptions that have been reported.
*
* @var array<int, \Throwable>
* @var list<\Throwable>
*/
protected $reported = [];

Expand All @@ -38,7 +38,7 @@ class ExceptionHandlerFake implements ExceptionHandler, Fake
* Create a new exception handler fake.
*
* @param \Illuminate\Contracts\Debug\ExceptionHandler $handler
* @param array<int, class-string<\Throwable>> $exceptions
* @param list<class-string<\Throwable>> $exceptions
* @return void
*/
public function __construct(
Expand All @@ -61,7 +61,7 @@ public function handler()
/**
* Assert if an exception of the given type has been reported.
*
* @param \Closure|string $exception
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $exception
* @return void
*/
public function assertReported(Closure|string $exception)
Expand Down Expand Up @@ -107,7 +107,7 @@ public function assertReportedCount(int $count)
/**
* Assert if an exception of the given type has not been reported.
*
* @param \Closure|string $exception
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $exception
* @return void
*/
public function assertNotReported(Closure|string $exception)
Expand Down Expand Up @@ -263,7 +263,7 @@ public function setHandler(ExceptionHandler $handler)
}

/**
* Handle dynamic method calls to the mailer.
* Handle dynamic method calls to the handler.
*
* @param string $method
* @param array<string, mixed> $parameters
Expand Down
Loading