Completed
Branch guard_coverage (f2aaf0)
by Pablo
03:07
created

GitIgnoreExtractorQueryHandler   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

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