DispatchThrowableHandlerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 1
f 0
dl 0
loc 12
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 5 1
1
<?php
2
3
/**
4
 * This file is part of coisa/error-handler.
5
 *
6
 * (c) Felipe Sayão Lobato Abreu <[email protected]>
7
 *
8
 * This source file is subject to the license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
declare(strict_types=1);
13
14
namespace CoiSA\ErrorHandler\Container\Factory;
15
16
use CoiSA\ErrorHandler\Handler\DispatchThrowableHandler;
17
use Psr\Container\ContainerInterface;
18
use Psr\EventDispatcher\EventDispatcherInterface;
19
20
/**
21
 * Class DispatchThrowableHandlerFactory.php
22
 *
23
 * @package CoiSA\ErrorHandler\Container\Factory
24
 */
25
final class DispatchThrowableHandlerFactory
26
{
27
    /**
28
     * @param ContainerInterface $container
29
     *
30
     * @return DispatchThrowableHandler
31
     */
32 34
    public function __invoke(ContainerInterface $container): DispatchThrowableHandler
33
    {
34 34
        $eventDispatcher = $container->get(EventDispatcherInterface::class);
35
36 34
        return new DispatchThrowableHandler($eventDispatcher);
37
    }
38
}
39