| Conditions | 6 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 6 |
| 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 | foreach ($this->againstValue as $argument) { |
|
| 27 | 6 | if (($imageSize[0] == $argument[0]) && ($imageSize[1] == $argument[1])) { |
|
| 28 | 1 | return; |
|
| 29 | } |
||
| 30 | } |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | 5 | throw new RuleException($this->errorText); |
|
| 35 | } |
||
| 37 |