SimpleErrorHandlerProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\ErrorHandler\Slim;
6
7
use Pimple\Container;
8
use Pimple\ServiceProviderInterface;
9
10
/**
11
 * @deprecated use Chubbyphp\ErrorHandler\SimpleErrorHandlerProvider
12
 */
13
final class SimpleErrorHandlerProvider implements ServiceProviderInterface
14
{
15
    /**
16
     * @param Container $container
17
     */
18
    public function register(Container $container)
19
    {
20 1
        $container['errorHandler.defaultProvider'] = function () use ($container) {
21 1
            throw new \RuntimeException('Please configure your default provider for error handler!');
22
        };
23
24 2
        $container['errorHandler'] = function () use ($container) {
25 2
            return new SimpleErrorHandler($container['errorHandler.defaultProvider'], $container['logger'] ?? null);
0 ignored issues
show
Deprecated Code introduced by
The class Chubbyphp\ErrorHandler\Slim\SimpleErrorHandler has been deprecated with message: use Chubbyphp\ErrorHandler\SimpleErrorHandler

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
26
        };
27
    }
28
}
29