for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Chubbyphp\ErrorHandler;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
final class SimpleErrorHandlerProvider implements ServiceProviderInterface
{
/**
* @param Container $container
*/
public function register(Container $container)
$container['errorHandler.defaultProvider'] = function () use ($container) {
throw new \RuntimeException('Please configure your default provider for error handler!');
};
$container['errorHandler.middleware'] = function () use ($container) {
return new ErrorHandlerMiddleware(
new SimpleErrorHandler($container['errorHandler.defaultProvider'], $container['logger'] ?? null)
);
}