Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
23 | 1 | public function allWithStatus() |
|
24 | { |
||
25 | 1 | $stations = $this->all(); |
|
26 | 1 | $statuses = $this->statuses(); |
|
27 | |||
28 | $stationsWithStatus = $stations->map(function ($station) use ($statuses) { |
||
29 | 1 | $station->setStatus(collect($statuses)->firstWhere('id', $station->id)); |
|
30 | |||
31 | 1 | return $station; |
|
32 | 1 | }); |
|
33 | |||
34 | 1 | return $stationsWithStatus; |
|
35 | } |
||
42 |