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