Conditions | 5 |
Paths | 5 |
Total Lines | 24 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
57 | protected function getFields() : array |
||
58 | { |
||
59 | $fields = []; |
||
60 | |||
61 | foreach ($this as $name => $value) { |
||
62 | // empty field... |
||
63 | if (null === $value) { |
||
64 | continue; |
||
65 | } |
||
66 | |||
67 | // ignored field... |
||
68 | if (in_array($name, static::IGNORE_FIELDS)) { |
||
69 | continue; |
||
70 | } |
||
71 | |||
72 | // the field has an alias. renaming... |
||
73 | if (isset(static::FIELD_ALIASES[$name])) { |
||
74 | $name = static::FIELD_ALIASES[$name]; |
||
75 | } |
||
76 | |||
77 | $fields[$name] = $value; |
||
78 | } |
||
79 | |||
80 | return $fields; |
||
81 | } |
||
83 |