| Total Complexity | 7 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 63.16% |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class NotificationController extends Controller |
||
| 18 | { |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var NotificationService |
||
| 22 | */ |
||
| 23 | protected $service; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * NotificationController constructor. |
||
| 27 | * |
||
| 28 | * @param $service |
||
| 29 | */ |
||
| 30 | 3 | public function __construct(NotificationServiceContract $service) |
|
| 31 | { |
||
| 32 | 3 | $this->service = $service; |
|
|
|
|||
| 33 | 3 | } |
|
| 34 | |||
| 35 | 1 | public function all() |
|
| 36 | { |
||
| 37 | 1 | return NotificationTransformer::collection($this->service->allNotificationsByUser(get_authenticated_user())); |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | public function allUnread() |
|
| 43 | } |
||
| 44 | |||
| 45 | 2 | public function read($id) |
|
| 55 | ]); |
||
| 56 | } |
||
| 57 | |||
| 58 | public function unread($id) |
||
| 68 | ]); |
||
| 69 | } |
||
| 71 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.