Completed
Push — master ( 770316...74fc07 )
by Jeroen
09:08 queued 02:44
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
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Extension has been deprecated with message: since Twig 2.7, use "Twig\Extension\AbstractExtension" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
9
{
10
    /**
11
     * Get Twig functions defined in this extension.
12
     *
13
     * @return array
14
     */
15
    public function getFunctions()
16
    {
17
        return array(
18
            new \Twig_SimpleFunction('hideSidebarInNodeEditAdmin', array($this, 'hideSidebarInNodeEditAdmin')),
0 ignored issues
show
Deprecated Code introduced by
The class Twig_SimpleFunction has been deprecated with message: since Twig 2.7, use "Twig\TwigFunction" instead

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
19
        );
20
    }
21
22
    /**
23
     * Return the admin menu MenuBuilder.
24
     *
25
     * @return MenuBuilder
26
     */
27
    public function hideSidebarInNodeEditAdmin($node)
28
    {
29
        return $node instanceof HideSidebarInNodeEditInterface;
30
    }
31
}
32