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