Completed
Push — master ( a9f19e...00e6c7 )
by Dominik
02:06
created

SimpleErrorHandlerProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace Chubbyphp\ErrorHandler\Slim;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
8
final class SimpleErrorHandlerProvider implements ServiceProviderInterface
9
{
10
    /**
11
     * @param Container $container
12
     */
13
    public function register(Container $container)
14
    {
15
        $container['errorHandler.defaultProvider'] = function () use ($container) {
16
            throw new \RuntimeException('Please configure your default provider for error handler!');
17
        };
18
19
        $container['errorHandler'] = function () use ($container) {
20
            return new SimpleErrorHandler($container['errorHandler.defaultProvider']);
21
        };
22
    }
23
}
24