2019-11-22 21:49:14 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-01-01 23:11:53 +03:00
|
|
|
use Laminas\Stratigility\Middleware\ErrorHandler;
|
|
|
|
use Mezzio\ProblemDetails\ProblemDetailsMiddleware;
|
2019-11-22 21:49:14 +03:00
|
|
|
use Shlinkio\Shlink\Common\Logger;
|
|
|
|
|
2022-08-14 14:12:10 +03:00
|
|
|
use function Shlinkio\Shlink\Core\toProblemDetailsType;
|
|
|
|
|
2019-11-22 21:49:14 +03:00
|
|
|
return [
|
|
|
|
|
2019-12-31 00:42:29 +03:00
|
|
|
'problem-details' => [
|
|
|
|
'default_types_map' => [
|
2022-08-14 14:12:10 +03:00
|
|
|
404 => toProblemDetailsType('not-found'),
|
|
|
|
500 => toProblemDetailsType('internal-server-error'),
|
2019-11-24 14:41:12 +03:00
|
|
|
],
|
2019-12-31 00:42:29 +03:00
|
|
|
],
|
|
|
|
|
2019-11-22 21:49:14 +03:00
|
|
|
'error_handler' => [
|
|
|
|
'listeners' => [Logger\ErrorLogger::class],
|
|
|
|
],
|
|
|
|
|
|
|
|
'dependencies' => [
|
|
|
|
'delegators' => [
|
|
|
|
ErrorHandler::class => [
|
|
|
|
Logger\ErrorHandlerListenerAttachingDelegator::class,
|
|
|
|
],
|
|
|
|
ProblemDetailsMiddleware::class => [
|
|
|
|
Logger\ErrorHandlerListenerAttachingDelegator::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
];
|