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