| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | 78 | public function getExistedValues($fieldList) |
|
| 16 | { |
||
| 17 | 78 | $fields = []; |
|
| 18 | 78 | foreach ($fieldList as $field) { |
|
| 19 | 78 | $fields[$field] = isset($this->$field) ? $this->$field : null; |
|
| 20 | 78 | } |
|
| 21 | |||
| 22 | 78 | $fields = array_filter($fields, function($field) { |
|
| 23 | 78 | if (is_array($field)) { |
|
| 24 | 1 | return !empty($field); |
|
| 25 | } |
||
| 26 | |||
| 27 | 78 | return strlen($field); |
|
| 28 | 78 | }); |
|
| 29 | |||
| 30 | 78 | return $fields; |
|
| 31 | } |
||
| 32 | |||
| 44 |