| Conditions | 2 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | public function getMotives(StdClass $data) |
||
| 19 | { |
||
| 20 | $map = $this->supportBank->motives($data->occurrenceCode); |
||
|
|
|||
| 21 | $parts = $this->parseMotiveParts($data); |
||
| 22 | |||
| 23 | $mapper = function ($motive) use ($map) { |
||
| 24 | return empty($map[$motive]) ? null : $map[$motive]; |
||
| 25 | }; |
||
| 26 | |||
| 27 | return array_filter(array_map($mapper, $parts)); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: