These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace App\Http\Controllers\API; |
||
4 | |||
5 | use App\Events\NotificationWasDismissed; |
||
6 | use App\Notification; |
||
7 | use App\Http\Controllers\Controller; |
||
8 | use App\Transformers\NotificationTransformer; |
||
9 | |||
10 | class NotificationController extends Controller |
||
11 | { |
||
12 | /** |
||
13 | * NotificationController constructor. |
||
14 | */ |
||
15 | public function __construct() |
||
16 | { |
||
17 | $this->middleware('auth'); |
||
18 | } |
||
19 | |||
20 | /** |
||
21 | * Get all the notifications. |
||
22 | * |
||
23 | * @return array |
||
24 | */ |
||
25 | public function all() |
||
26 | { |
||
27 | $notifications = Notification::pending()->get(); |
||
28 | |||
29 | return fractal()->collection($notifications, new NotificationTransformer) |
||
30 | ->toArray(); |
||
31 | } |
||
32 | |||
33 | public function dismiss($id) |
||
34 | { |
||
35 | $notification = Notification::findOrFail($id); |
||
36 | $notification->dismiss(); |
||
37 | event(new NotificationWasDismissed($notification)); |
||
0 ignored issues
–
show
|
|||
38 | } |
||
39 | } |
||
40 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.