Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | 5 | public function check(): bool |
|
24 | { |
||
25 | 5 | if ($this->value === false) { |
|
26 | 2 | return true; |
|
27 | } |
||
28 | |||
29 | 3 | if (!in_array($this->value->getError(), array(\UPLOAD_ERR_OK, \UPLOAD_ERR_NO_FILE))) { |
|
30 | 1 | $this->message = |
|
31 | 1 | UploadCheckInterface::UPLOAD_ERROR_MESSAGE[$this->value->getError( |
|
32 | 1 | )] ?? UploadCheckInterface::UPLOAD_ERROR_MESSAGE['unknown'] |
|
33 | 1 | ; |
|
34 | 1 | $this->element->setRuleError($this->message); |
|
35 | 1 | return false; |
|
36 | } |
||
37 | 2 | return true; |
|
38 | } |
||
40 |