| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | protected function generateValueFromRequest() |
||
| 27 | { |
||
| 28 | $name = $this->getName(); |
||
| 29 | $name = str_replace(']', '', $name); |
||
| 30 | $parts = explode('[', $name); |
||
| 31 | |||
| 32 | if (count($parts) <= 1) { |
||
| 33 | return isset($_FILES[$name]) ? $_FILES[$name] : false; |
||
| 34 | } |
||
| 35 | |||
| 36 | if (!isset($_FILES[$parts[0]])) { |
||
| 37 | return false; |
||
| 38 | } |
||
| 39 | $fileData = []; |
||
| 40 | foreach ($_FILES[$parts[0]] as $key=>$data) { |
||
| 41 | $fileData[$key] = $data[$parts[1]]; |
||
| 42 | } |
||
| 43 | return $fileData; |
||
| 44 | } |
||
| 46 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.