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

GitIgnoreExtractor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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