1 | <?php |
||
10 | class NotificationController extends Controller |
||
11 | { |
||
12 | /** |
||
13 | * @var NotificationRepositoryInterface |
||
14 | */ |
||
15 | private $notifications; |
||
16 | /** |
||
17 | * @var UserRepositoryInterface |
||
18 | */ |
||
19 | private $users; |
||
20 | |||
21 | /** |
||
22 | * NotificationController constructor. |
||
23 | * |
||
24 | * @param NotificationRepositoryInterface $repository |
||
25 | * @param UserRepositoryInterface $user_repository |
||
26 | */ |
||
27 | public function __construct(NotificationRepositoryInterface $repository, UserRepositoryInterface $user_repository) |
||
32 | |||
33 | /** |
||
34 | * 获取当前用户的通知消息. |
||
35 | * |
||
36 | * @return \Illuminate\Http\Response |
||
37 | */ |
||
38 | public function index() |
||
54 | |||
55 | /** |
||
56 | * 获取当前用户的未读消息数. |
||
57 | * |
||
58 | * @return \Illuminate\Contracts\Routing\ResponseFactory|\Symfony\Component\HttpFoundation\Response |
||
59 | */ |
||
60 | public function unreadMessagesCount() |
||
66 | } |
||
67 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: