Completed
Push — master ( ae5e03...0447ee )
by Jeroen
10:35 queued 04:37
created

AdminBundle/Twig/SidebarTwigExtension.php (2 issues)

Upgrade to new PHP Analysis Engine

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\NodeBundle\Entity\HideSidebarInNodeEditInterface;
6
use Kunstmaan\AdminBundle\Helper\Menu\MenuBuilder;
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
Consider making the return type a bit more specific; maybe use TwigFunction[].

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.

Loading history...
19
     */
20
    public function getFunctions()
21
    {
22
        return array(
23
            new TwigFunction('hideSidebarInNodeEditAdmin', array($this, 'hideSidebarInNodeEditAdmin')),
24
        );
25
    }
26
27
    /**
28
     * Return the admin menu MenuBuilder.
29
     *
30
     * @return MenuBuilder
0 ignored issues
show
Should the return type not be boolean?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
31
     */
32
    public function hideSidebarInNodeEditAdmin($node)
33
    {
34
        return $node instanceof HideSidebarInNodeEditInterface;
35
    }
36
}
37