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

SimpleErrorHandlerProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 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