Completed
Pull Request — master (#13)
by Victor
01:57
created

FileReader   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 31
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A readFile() 0 4 1
1
<?php
2
3
namespace LazyEight\DiTesto;
4
5
use LazyEight\DiTesto\Exceptions\FileSystemException;
6
use LazyEight\DiTesto\Interfaces\FileReaderInterface;
7
use LazyEight\DiTesto\Interfaces\FileSystem\FileSystemHandlerInterface;
8
9
class FileReader implements FileReaderInterface
10
{
11
    /**
12
     * @var AbstractFile
13
     */
14
    private $file;
15
16
    /**
17
     * @var FileSystemHandlerInterface
18
     */
19
    private $handler;
20
21
    /**
22
     * FileWriter constructor.
23
     * @param AbstractFile $file
24
     * @param FileSystemHandlerInterface $handler
25
     */
26 1
    public function __construct(AbstractFile $file, FileSystemHandlerInterface $handler)
27
    {
28 1
        $this->file = $file;
29 1
        $this->handler = $handler;
30 1
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35 3
    public function readFile()
36
    {
37 3
        $this->file->setRawContent($this->handler->read());
38 1
    }
39
}
40