Total Complexity | 8 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
18 | class NotificationService implements NotificationServiceContract |
||
19 | { |
||
20 | protected $user; |
||
21 | |||
22 | /** |
||
23 | * NotificationService constructor. |
||
24 | * @param $service |
||
25 | */ |
||
26 | public function __construct(UserServiceContract $service) |
||
27 | { |
||
28 | $this->user = $service; |
||
29 | } |
||
30 | |||
31 | public function find($id): ?Notification |
||
32 | { |
||
33 | if ($id instanceof Notification) |
||
34 | return $id; |
||
35 | |||
36 | $notification = Notification::find($id); |
||
37 | |||
38 | if ($notification === null) |
||
39 | throw new NotFoundHttpException(); |
||
40 | |||
41 | return $notification; |
||
42 | } |
||
43 | |||
44 | public function allNotificationsByUser($user) |
||
45 | { |
||
46 | $this->user->find($user)->notifications; |
||
47 | } |
||
48 | |||
49 | public function unreadNotifcationsByUser($user) |
||
50 | { |
||
51 | $this->user->find($user)->unreadNotifications; |
||
52 | } |
||
53 | |||
54 | public function markAsRead($id) |
||
57 | } |
||
58 | |||
59 | public function markAsUnread($id) |
||
60 | { |
||
62 | } |
||
63 | |||
65 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths