Файл: vendor/laravel/framework/src/Illuminate/Support/Facades/Exceptions.php
Строк: 218
<?php
namespace IlluminateSupportFacades;
use IlluminateContractsDebugExceptionHandler;
use IlluminateSupportArr;
use IlluminateSupportTestingFakesExceptionHandlerFake;
/**
* @method static void register()
* @method static IlluminateFoundationExceptionsReportableHandler reportable(callable $reportUsing)
* @method static IlluminateFoundationExceptionsHandler renderable(callable $renderUsing)
* @method static IlluminateFoundationExceptionsHandler map(Closure|string $from, Closure|string|null $to = null)
* @method static IlluminateFoundationExceptionsHandler dontReport(array|string $exceptions)
* @method static IlluminateFoundationExceptionsHandler dontReportWhen(callable $dontReportWhen)
* @method static IlluminateFoundationExceptionsHandler ignore(array|string $exceptions)
* @method static IlluminateFoundationExceptionsHandler dontFlash(array|string $attributes)
* @method static IlluminateFoundationExceptionsHandler level(string $type, string $level)
* @method static void report(Throwable $e)
* @method static bool isReporting(Throwable $e)
* @method static bool shouldReport(Throwable $e)
* @method static IlluminateFoundationExceptionsHandler throttleUsing(callable $throttleUsing)
* @method static IlluminateFoundationExceptionsHandler stopIgnoring(array|string $exceptions)
* @method static array buildContextForException(Throwable $e)
* @method static IlluminateFoundationExceptionsHandler buildContextUsing(Closure $contextCallback)
* @method static SymfonyComponentHttpFoundationResponse render(IlluminateHttpRequest $request, Throwable $e)
* @method static IlluminateFoundationExceptionsHandler respondUsing(callable $callback)
* @method static IlluminateFoundationExceptionsHandler shouldRenderJsonWhen(callable $callback)
* @method static IlluminateFoundationExceptionsHandler dontReportDuplicates()
* @method static IlluminateContractsDebugExceptionHandler handler()
* @method static void assertReported(Closure|string $exception)
* @method static void assertReportedCount(int $count)
* @method static void assertNotReported(Closure|string $exception)
* @method static void assertNothingReported()
* @method static void renderForConsole(SymfonyComponentConsoleOutputOutputInterface $output, Throwable $e)
* @method static IlluminateSupportTestingFakesExceptionHandlerFake throwOnReport()
* @method static IlluminateSupportTestingFakesExceptionHandlerFake throwFirstReported()
* @method static array reported()
* @method static IlluminateSupportTestingFakesExceptionHandlerFake setHandler(IlluminateContractsDebugExceptionHandler $handler)
*
* @see IlluminateFoundationExceptionsHandler
* @see IlluminateSupportTestingFakesExceptionHandlerFake
*/
class Exceptions extends Facade
{
/**
* Replace the bound instance with a fake.
*
* @param array<int, class-string<Throwable>>|class-string<Throwable> $exceptions
* @return IlluminateSupportTestingFakesExceptionHandlerFake
*/
public static function fake(array|string $exceptions = [])
{
$exceptionHandler = static::isFake()
? static::getFacadeRoot()->handler()
: static::getFacadeRoot();
return tap(new ExceptionHandlerFake($exceptionHandler, Arr::wrap($exceptions)), function ($fake) {
static::swap($fake);
});
}
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return ExceptionHandler::class;
}
}