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

RouteSecurityExtension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 6 1
A __construct() 0 3 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