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 Kunstmaan\AdminBundle\Twig; |
||
4 | |||
5 | use Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder; |
||
6 | use Kunstmaan\NodeBundle\Entity\HideSidebarInNodeEditInterface; |
||
7 | use Twig\Extension\AbstractExtension; |
||
8 | use Twig\TwigFunction; |
||
9 | |||
10 | /** |
||
11 | * @final since 5.4 |
||
12 | */ |
||
13 | class SidebarTwigExtension extends AbstractExtension |
||
14 | { |
||
15 | /** |
||
16 | * Get Twig functions defined in this extension. |
||
17 | * |
||
18 | * @return array |
||
0 ignored issues
–
show
|
|||
19 | */ |
||
20 | public function getFunctions() |
||
21 | { |
||
22 | return [ |
||
23 | new TwigFunction('hideSidebarInNodeEditAdmin', [$this, 'hideSidebarInNodeEditAdmin']), |
||
24 | ]; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * Return the admin menu MenuBuilder. |
||
29 | * |
||
30 | * @return MenuBuilder |
||
0 ignored issues
–
show
|
|||
31 | */ |
||
32 | public function hideSidebarInNodeEditAdmin($node) |
||
33 | { |
||
34 | return $node instanceof HideSidebarInNodeEditInterface; |
||
35 | } |
||
36 | } |
||
37 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.