Completed
Push — master ( 1de9b7...830752 )
by Kristof
38:46 queued 24:09
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
8
class SidebarTwigExtension extends \Twig_Extension
9
{
10
    /**
11
     * Get Twig functions defined in this extension.
12
     *
13
     * @return array
0 ignored issues
show
Consider making the return type a bit more specific; maybe use \Twig_SimpleFunction[].

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...
14
     */
15
    public function getFunctions()
16
    {
17
        return array(
18
            new \Twig_SimpleFunction('hideSidebarInNodeEditAdmin', array($this, 'hideSidebarInNodeEditAdmin')),
19
        );
20
    }
21
22
    /**
23
     * Return the admin menu MenuBuilder.
24
     *
25
     * @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...
26
     */
27
    public function hideSidebarInNodeEditAdmin($node)
28
    {
29
        return $node instanceof HideSidebarInNodeEditInterface;
30
    }
31
}
32