| Conditions | 5 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public function getValue($requester = 'abstract') |
||
| 15 | { |
||
| 16 | if (!$this->_value) { |
||
| 17 | $name = $this->getName(); |
||
| 18 | $name = str_replace(']', '', $name); |
||
| 19 | $parts = explode('[', $name); |
||
| 20 | |||
| 21 | if (count($parts) > 1) { |
||
| 22 | if ($_FILES[$parts[0]]) { |
||
| 23 | $fileData = []; |
||
| 24 | foreach ($_FILES[$parts[0]] as $key=>$data) { |
||
| 25 | $fileData[$key] = $data[$parts[1]]; |
||
| 26 | } |
||
| 27 | $this->_value = $fileData; |
||
| 28 | } else { |
||
| 29 | $this->_value = null; |
||
| 30 | } |
||
| 31 | } else { |
||
| 32 | $this->_value = $_FILES[$name]; |
||
| 33 | } |
||
| 34 | } |
||
| 35 | |||
| 36 | return $this->_value; |
||
| 37 | } |
||
| 39 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.