Completed
Pull Request — master (#85)
by
unknown
02:27
created

ConfigurationDataFinderQueryHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 27
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 4 1
1
<?php
2
3
namespace PhpGitHooks\Module\Configuration\Contract\QueryHandler;
4
5
use Bruli\EventBusBundle\QueryBus\QueryHandlerInterface;
6
use Bruli\EventBusBundle\QueryBus\QueryInterface;
7
use PhpGitHooks\Module\Configuration\Contract\Response\ConfigurationDataResponse;
8
use PhpGitHooks\Module\Configuration\Service\ConfigurationDataFinder;
9
10
class ConfigurationDataFinderQueryHandler implements QueryHandlerInterface
11
{
12
    /**
13
     * @var ConfigurationDataFinder
14
     */
15
    private $configurationDataFinder;
16
17
    /**
18
     * ConfigurationDataFinderQueryHandler constructor.
19
     *
20
     * @param ConfigurationDataFinder $configurationDataFinder
21
     */
22 1
    public function __construct(ConfigurationDataFinder $configurationDataFinder)
23
    {
24 1
        $this->configurationDataFinder = $configurationDataFinder;
25 1
    }
26
27
    /**
28
     * @param QueryInterface $query
29
     *
30
     * @return ConfigurationDataResponse
31
     */
32
    public function handle(QueryInterface $query)
33
    {
34
        return $this->configurationDataFinder->find();
35
    }
36
}
37