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