| Total Complexity | 7 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class MachineService implements MachineServiceContract |
||
| 18 | { |
||
| 19 | public function getByUserId($userId) |
||
| 20 | { |
||
| 21 | return Machine::where('user_id', $userId)->get(); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function find($id): ?Machine |
||
| 25 | { |
||
| 26 | if ($id instanceof Machine) |
||
| 27 | return $id; |
||
| 28 | return Machine::find($id); |
||
| 29 | } |
||
| 30 | |||
| 31 | public function update($id, $data): Machine |
||
| 37 | } |
||
| 38 | |||
| 39 | public function create($data): Machine |
||
| 40 | { |
||
| 41 | $machine = Machine::create($data); |
||
| 42 | event(new MachineRegisteredEvent($machine)); |
||
| 43 | |||
| 44 | return $machine; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function delete($id): bool |
||
| 50 | } |
||
| 51 | |||
| 52 | public function heartbeat($id, $data): void |
||
| 64 |