D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
psa
/
admin
/
plib
/
modules
/
grafana
/
vendor
/
mezzio
/
mezzio
/
src
/
Container
/
Filename :
ErrorHandlerFactory.php
back
Copy
<?php declare (strict_types=1); namespace PleskGrafana\Mezzio\Container; use PleskGrafana\Laminas\Stratigility\Middleware\ErrorHandler; use PleskGrafana\Mezzio\Middleware\ErrorResponseGenerator; use Psr\Container\ContainerInterface; use Psr\Http\Message\ResponseInterface; class ErrorHandlerFactory { public function __invoke(ContainerInterface $container) : ErrorHandler { $generator = $container->has(ErrorResponseGenerator::class) ? $container->get(ErrorResponseGenerator::class) : ($container->has(\PleskGrafana\Zend\Expressive\Middleware\ErrorResponseGenerator::class) ? $container->get(\PleskGrafana\Zend\Expressive\Middleware\ErrorResponseGenerator::class) : null); return new ErrorHandler($container->get(ResponseInterface::class), $generator); } }