Conditions | 5 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 6 | public function validate(IValidateFile $entry): void |
|
21 | { |
||
22 | 6 | $filename = $entry->getTempName(); |
|
23 | 6 | if (!empty($filename)) { |
|
24 | 6 | $imageSize = @getimagesize($filename); |
|
25 | 6 | if (false !== $imageSize) { |
|
26 | 6 | if (($imageSize[0] == $this->againstValue[0]) && ($imageSize[1] == $this->againstValue[1])) { |
|
27 | 1 | return; |
|
28 | } |
||
29 | } |
||
30 | } |
||
31 | 5 | throw new RuleException($this->errorText); |
|
32 | } |
||
47 |