| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 2 | ]; |
|
| 19 | |||
| 20 | 2 | public function validate($value, string $valueIdentifier = null) |
|
| 21 | 2 | { |
|
| 22 | 2 | $this->value = $value; |
|
| 23 | 1 | if (! file_exists($value)) { |
|
| 24 | 1 | $this->success = false; |
|
| 25 | 1 | } else { |
|
| 26 | 1 | $fileSize = @filesize($value); |
|
| 27 | $limit = RuleHelper::normalizeFileSize($this->options[self::OPTION_SIZE]); |
||
| 28 | $this->success = $fileSize && $fileSize <= $limit; |
||
| 29 | 2 | } |
|
| 30 | |||
| 31 | return $this->success; |
||
| 34 |