| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | public function boot() |
||
| 17 | { |
||
| 18 | View::composer('elements._notifications', function ($view) { |
||
| 19 | $notifications = UserRepository::notificationsData(Auth::user()->id); |
||
|
|
|||
| 20 | |||
| 21 | $view->with([ |
||
| 22 | 'notifications' => $notifications['notifications'], |
||
| 23 | 'hasUnreadNotifications' => $notifications['hasUnreadNotifications'], |
||
| 24 | 'unredNotificationsCount' => $notifications['unredNotificationsCount'] |
||
| 25 | ]); |
||
| 26 | }); |
||
| 27 | } |
||
| 28 | } |
||
| 29 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: