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

GitIgnoreExtractor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A extract() 0 6 1
1
<?php
2
3
namespace PhpGitHooks\Module\Git\Service;
4
5
use PhpGitHooks\Module\Git\Contract\Response\GitIgnoreDataResponse;
6
use PhpGitHooks\Module\Git\Model\ReaderInterface;
7
8
class GitIgnoreExtractor
9
{
10
    /**
11
     * @var ReaderInterface
12
     */
13
    private $reader;
14
15
    /**
16
     * GitIgnoreExtractor constructor.
17
     *
18
     * @param ReaderInterface $reader
19
     */
20 1
    public function __construct(ReaderInterface $reader)
21
    {
22 1
        $this->reader = $reader;
23 1
    }
24
25
    /**
26
     * @return GitIgnoreDataResponse
27
     */
28 1
    public function extract()
29
    {
30 1
        $content = $this->reader->read();
31
32 1
        return new GitIgnoreDataResponse($content);
33
    }
34
}
35