Completed
Push — master ( 06c1ce...67d37c )
by Jeroen
06:20
created

SidebarTwigExtension::hideSidebarInNodeEditAdmin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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
Documentation introduced by
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
Documentation introduced by
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