| Total Complexity | 7 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class AccountService implements AccountServiceContract |
||
| 18 | { |
||
| 19 | public function getByUserId($userId) |
||
| 20 | { |
||
| 21 | return Account::where('user_id', $userId)->get(); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function find($id): ?Account |
||
| 31 | } |
||
| 32 | |||
| 33 | public function update($id, $data): Account |
||
| 34 | { |
||
| 35 | $Account = $this->find($id); |
||
| 36 | $Account->update($data); |
||
| 37 | event(new AccountUpdatedEvent($Account)); |
||
| 38 | |||
| 39 | return $Account; |
||
| 40 | } |
||
| 41 | |||
| 42 | public function create($data): Account |
||
| 43 | { |
||
| 44 | $Account = Account::create($data); |
||
| 45 | event(new AccountCreatedEvent($Account)); |
||
| 46 | |||
| 47 | return $Account; |
||
| 48 | } |
||
| 49 | |||
| 50 | public function delete($id): bool |
||
| 53 | } |
||
| 54 | |||
| 55 | public function heartbeat($id, $data): void |
||
| 60 | ]); |
||
| 61 | } |
||
| 62 | } |
||
| 63 |