Total Complexity | 5 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 28.57% |
Changes | 0 |
1 | <?php |
||
15 | class UserService implements UserServiceContract |
||
16 | { |
||
17 | 9 | public function find($id): ?User |
|
18 | { |
||
19 | 9 | return User::find($id); |
|
|
|||
20 | } |
||
21 | |||
22 | public function update($id, $data): ?User |
||
23 | { |
||
24 | $user = $this->find($id); |
||
25 | $user->update($data); |
||
26 | return $user; |
||
27 | } |
||
28 | |||
29 | public function create($data): User |
||
30 | { |
||
31 | $user = User::create($data); |
||
32 | event(new UserRegisteredEvent($user)); |
||
33 | return $user; |
||
34 | } |
||
35 | |||
36 | public function delete($id): bool |
||
37 | { |
||
38 | return User::destroy($id); |
||
39 | } |
||
40 | |||
41 | 9 | public function newUser($data): User |
|
44 | } |
||
45 | |||
46 | } |
||
47 |