ProviderFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 2
b 0
f 0
dl 0
loc 20
ccs 9
cts 9
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 9 1
A __construct() 0 4 1
1
<?php
2
3
/*
4
 *  This file is part of the Micro framework package.
5
 *
6
 *  (c) Stanislau Komar <[email protected]>
7
 *
8
 *  For the full copyright and license information, please view the LICENSE
9
 *  file that was distributed with this source code.
10
 */
11
12
namespace Micro\Plugin\EventEmitter\Business\Provider;
13
14
use Micro\Component\DependencyInjection\Autowire\AutowireHelperInterface;
15
use Micro\Component\EventEmitter\ListenerProviderInterface;
16
use Micro\Plugin\EventEmitter\Business\Locator\EventListenerClassLocatorFactoryInterface;
17
18
class ProviderFactory implements ProviderFactoryInterface
19
{
20 1
    public function __construct(
21
        private readonly AutowireHelperInterface $autowireHelper,
22
        private readonly EventListenerClassLocatorFactoryInterface $eventListenerClassLocatorFactory
23
    ) {
24 1
    }
25
26
    /**
27
     *{@inheritDoc}
28
     */
29 1
    public function create(): ListenerProviderInterface
30
    {
31 1
        $listeners = $this->eventListenerClassLocatorFactory
32 1
            ->create()
33 1
            ->lookupListenerClasses();
34
35 1
        return new ApplicationListenerProvider(
36 1
            $this->autowireHelper,
37 1
            $listeners
38 1
        );
39
    }
40
}
41