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 Huntie\JsonApi\Routing; |
||
4 | |||
5 | trait KernelRouterAssociation |
||
6 | { |
||
7 | /** |
||
8 | * Get the route dispatcher callback. |
||
9 | * |
||
10 | * @return \Closure |
||
11 | */ |
||
12 | protected function dispatchToRouter() |
||
13 | { |
||
14 | // Whilst Laravel provides the package Router instance within all app |
||
15 | // code, it is hardcoded in the base Kernel class and needs to be set |
||
16 | // directly here when we are using custom JSON API router extensions. |
||
17 | parent::__construct($this->app, $this->app['router']); |
||
0 ignored issues
–
show
It seems like you call parent on a different method (
__construct() instead of dispatchToRouter() ). Are you sure this is correct? If so, you might want to change this to $this->__construct() .
This check looks for a call to a parent method whose name is different than the method from which it is called. Consider the following code: class Daddy
{
protected function getFirstName()
{
return "Eidur";
}
protected function getSurName()
{
return "Gudjohnsen";
}
}
class Son
{
public function getFirstName()
{
return parent::getSurname();
}
}
The
Loading history...
|
|||
18 | |||
19 | return parent::dispatchToRouter(); |
||
20 | } |
||
21 | } |
||
22 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: