Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.576 |
Changes | 0 |
1 | <?php |
||
21 | 1 | public function __construct($filePath) |
|
22 | { |
||
23 | 1 | $this->filePath = $filePath; |
|
24 | |||
25 | 1 | $this->file = new SplFileInfo($filePath); |
|
26 | |||
27 | 1 | if (! $this->file->getExtension()) { |
|
28 | throw ImportFileException::noExtension(); |
||
29 | } |
||
30 | |||
31 | 1 | if (! $this->file->isFile()) { |
|
32 | 1 | throw ImportFileException::notExist($filePath); |
|
33 | } |
||
34 | |||
35 | $this->fileHandle = $this->file->openFile(); |
||
36 | |||
37 | $this->validateSyntax(); |
||
38 | } |
||
39 | |||
47 |