| Conditions | 3 |
| Paths | 1 |
| Total Lines | 9 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function getData(): array |
||
| 43 | { |
||
| 44 | return collect(\get_object_vars($this))->filter(function ($value, $name) { |
||
| 45 | return \in_array($name, $this->getFields()) && !empty($value); |
||
| 46 | })->map(function ($value, $name) { |
||
| 47 | $methodName = Str::camel('get_' . $name); |
||
| 48 | |||
| 49 | return \method_exists($this, $methodName) ? $this->$methodName() : $value; |
||
| 50 | })->toArray(); |
||
| 51 | } |
||
| 99 |