Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 2 | public function validate(IValidateFile $entry): void |
|
22 | { |
||
23 | 2 | $filename = $entry->getTempName(); |
|
24 | 2 | $finfo = new finfo(FILEINFO_MIME_TYPE); |
|
25 | 2 | if (!empty($filename)) { |
|
26 | 2 | foreach ($this->againstValue as $argumentValue) { |
|
27 | 2 | if ($finfo->file($filename) == $argumentValue) { |
|
28 | 1 | return; |
|
29 | } |
||
30 | } |
||
31 | } |
||
32 | 1 | throw new RuleException($this->errorText); |
|
33 | } |
||
48 |