Conditions | 6 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 42 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | protected function configureData($data){ |
||
35 | if (is_string($data)) { |
||
36 | if (!empty($this->Options)) { |
||
37 | $fileField = end($this->Options); |
||
38 | $data = array( |
||
39 | $fileField => $data |
||
40 | ); |
||
41 | } else { |
||
42 | throw new RequiredOptionsException(get_called_class(), "Options are required, when passing String for data."); |
||
43 | } |
||
44 | } |
||
45 | if (is_array($data)){ |
||
46 | foreach ($data as $key => $value){ |
||
47 | if (!array_key_exists($key,$this->_REQUIRED_DATA)){ |
||
48 | $data[$key] = $this->setFileFieldValue($value); |
||
49 | } |
||
50 | } |
||
51 | } |
||
52 | parent::configureData($data); |
||
53 | } |
||
54 | |||
67 | } |