| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 3.576 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 34 | public function check($value): bool |
||
| 35 | { |
||
| 36 | 4 | $this->requireParameters(['allowed_values']); |
|
| 37 | 4 | $this->setAllowedValues($this->parameters = $this->parameter('allowed_values')); |
|
| 38 | |||
| 39 | if (! $this->isValidFileInstance($value)) { |
||
| 40 | return false; |
||
| 41 | } |
||
| 42 | |||
| 43 | if ($this->shouldBlockPhpUpload($value, $this->parameters)) { |
||
| 44 | return false; |
||
| 45 | } |
||
| 46 | |||
| 47 | 4 | return in_array(strtolower($value->clientExtension()), $this->parameters, true); |
|
| 48 | } |
||
| 50 |