PHP Класс Dingo\Api\Exception\Handler

Наследование: implements Dingo\Api\Contract\Debug\ExceptionHandler, implements Illuminate\Contracts\Debug\ExceptionHandler
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$debug boolean Indicates if we are in debug mode.
$format array Generic response format.
$handlers array Array of exception handlers.
$parentHandler Illuminate\Contracts\Debug\ExceptionHandler The parent Illuminate exception handler instance.
$replacements array User defined replacements to merge with defaults.

Открытые методы

Метод Описание
__construct ( Illuminate\Contracts\Debug\ExceptionHandler $parentHandler, array $format, boolean $debug ) : void Create a new exception handler instance.
getHandlers ( ) : array Get the exception handlers.
handle ( Exception $exception ) : Illuminate\Http\Response Handle an exception if it has an existing handler.
register ( callable $callback ) : void Register a new exception handler.
render ( Dingo\Api\Http\Request $request, Exception $exception ) : mixed Render an exception into an HTTP response.
renderForConsole ( Symfony\Component\Console\Output\OutputInterface $output, Exception $exception ) : mixed Render an exception to the console.
report ( Exception $exception ) : void Report or log an exception.
setDebug ( boolean $debug ) : void Set the debug mode.
setErrorFormat ( array $format ) : void Set the error format array.
setReplacements ( array $replacements ) : void Set user defined replacements.

Защищенные методы

Метод Описание
genericResponse ( Exception $exception ) : Illuminate\Http\Response Handle a generic error response if there is no handler available.
getExceptionStatusCode ( Exception $exception, integer $defaultStatusCode = 500 ) : integer Get the exception status code.
getHeaders ( Exception $exception ) : array Get the headers from the exception.
getStatusCode ( Exception $exception ) : integer Get the status code from the exception.
handlerHint ( callable $callback ) : string Get the hint for an exception handler.
newResponseArray ( ) : array Create a new response array with replacement values.
prepareReplacements ( Exception $exception ) : array Prepare the replacements array by gathering the keys and values.
recursivelyRemoveEmptyReplacements ( array $input ) : array Recursirvely remove any empty replacement values in the response array.
runningInDebugMode ( ) : boolean Determines if we are running in debug mode.

Описание методов

__construct() публичный Метод

Create a new exception handler instance.
public __construct ( Illuminate\Contracts\Debug\ExceptionHandler $parentHandler, array $format, boolean $debug ) : void
$parentHandler Illuminate\Contracts\Debug\ExceptionHandler
$format array
$debug boolean
Результат void

genericResponse() защищенный Метод

Handle a generic error response if there is no handler available.
protected genericResponse ( Exception $exception ) : Illuminate\Http\Response
$exception Exception
Результат Illuminate\Http\Response

getExceptionStatusCode() защищенный Метод

Get the exception status code.
protected getExceptionStatusCode ( Exception $exception, integer $defaultStatusCode = 500 ) : integer
$exception Exception
$defaultStatusCode integer
Результат integer

getHandlers() публичный Метод

Get the exception handlers.
public getHandlers ( ) : array
Результат array

getHeaders() защищенный Метод

Get the headers from the exception.
protected getHeaders ( Exception $exception ) : array
$exception Exception
Результат array

getStatusCode() защищенный Метод

Get the status code from the exception.
protected getStatusCode ( Exception $exception ) : integer
$exception Exception
Результат integer

handle() публичный Метод

Handle an exception if it has an existing handler.
public handle ( Exception $exception ) : Illuminate\Http\Response
$exception Exception
Результат Illuminate\Http\Response

handlerHint() защищенный Метод

Get the hint for an exception handler.
protected handlerHint ( callable $callback ) : string
$callback callable
Результат string

newResponseArray() защищенный Метод

Create a new response array with replacement values.
protected newResponseArray ( ) : array
Результат array

prepareReplacements() защищенный Метод

Prepare the replacements array by gathering the keys and values.
protected prepareReplacements ( Exception $exception ) : array
$exception Exception
Результат array

recursivelyRemoveEmptyReplacements() защищенный Метод

Recursirvely remove any empty replacement values in the response array.
protected recursivelyRemoveEmptyReplacements ( array $input ) : array
$input array
Результат array

register() публичный Метод

Register a new exception handler.
public register ( callable $callback ) : void
$callback callable
Результат void

render() публичный Метод

Render an exception into an HTTP response.
public render ( Dingo\Api\Http\Request $request, Exception $exception ) : mixed
$request Dingo\Api\Http\Request
$exception Exception
Результат mixed

renderForConsole() публичный Метод

Render an exception to the console.
public renderForConsole ( Symfony\Component\Console\Output\OutputInterface $output, Exception $exception ) : mixed
$output Symfony\Component\Console\Output\OutputInterface
$exception Exception
Результат mixed

report() публичный Метод

Report or log an exception.
public report ( Exception $exception ) : void
$exception Exception
Результат void

runningInDebugMode() защищенный Метод

Determines if we are running in debug mode.
protected runningInDebugMode ( ) : boolean
Результат boolean

setDebug() публичный Метод

Set the debug mode.
public setDebug ( boolean $debug ) : void
$debug boolean
Результат void

setErrorFormat() публичный Метод

Set the error format array.
public setErrorFormat ( array $format ) : void
$format array
Результат void

setReplacements() публичный Метод

Set user defined replacements.
public setReplacements ( array $replacements ) : void
$replacements array
Результат void

Описание свойств

$debug защищенное свойство

Indicates if we are in debug mode.
protected bool $debug
Результат boolean

$format защищенное свойство

Generic response format.
protected array $format
Результат array

$handlers защищенное свойство

Array of exception handlers.
protected array $handlers
Результат array

$parentHandler защищенное свойство

The parent Illuminate exception handler instance.
protected ExceptionHandler,Illuminate\Contracts\Debug $parentHandler
Результат Illuminate\Contracts\Debug\ExceptionHandler

$replacements защищенное свойство

User defined replacements to merge with defaults.
protected array $replacements
Результат array