| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 5 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 35 | 16 | private function check(UploadedFileInterface|false $value, Ruleable $element): bool |
|
| 36 | { |
||
| 37 | 16 | foreach ($this->getParams() as $rule => $options) { |
|
| 38 | |||
| 39 | 15 | if (is_int($rule) && is_string($options)) { |
|
| 40 | 9 | $rule = $options; |
|
| 41 | 9 | $ruleOpts = null; |
|
| 42 | } |
||
| 43 | |||
| 44 | /** @var class-string<UploadCheckInterface> $className */ |
||
| 45 | 15 | $className = sprintf('\Enjoys\Forms\Rule\UploadCheck\%sCheck', ucfirst($rule)); |
|
| 46 | 15 | Assert::classExists($className, sprintf('Unknown Check Upload: [%s]', $className)); |
|
| 47 | 14 | return (new $className($value, $element, $options))->check(); |
|
| 48 | } |
||
| 49 | 1 | return true; |
|
| 50 | } |
||
| 52 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.