Passed
Push — master ( fcabc1...64f2a1 )
by Simon
02:24
created

RouteSecurityExtension::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
/**
3
 * User: Simon Libaud
4
 * Date: 19/03/2017
5
 * Email: [email protected].
6
 */
7
namespace Sil\RouteSecurityBundle\Twig;
8
9
use Sil\RouteSecurityBundle\Security\AccessControl;
10
11
/**
12
 * Class RouteSecurityExtension.
13
 */
14
class RouteSecurityExtension extends \Twig_Extension
0 ignored issues
show
Bug introduced by
The type Twig_Extension was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
15
{
16
    private $accessControl;
17
18
    public function __construct(AccessControl $accessControl)
19
    {
20
        $this->accessControl = $accessControl;
21
    }
22
23
    public function getFunctions()
24
    {
25
        return [
26
            new \Twig_SimpleFunction('hasUserAccessToRoute', [$this->accessControl, 'hasUserAccessToRoute']),
0 ignored issues
show
Bug introduced by
The type Twig_SimpleFunction was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
27
            new \Twig_SimpleFunction('hasUserAccessToRoutes', [$this->accessControl, 'hasUserAccessToRoutes']),
28
            new \Twig_SimpleFunction('hasUserAccessAtLeastOneRoute', [$this->accessControl, 'hasUserAccessAtLeastOneRoute']),
29
        ];
30
    }
31
}
32