Total Complexity | 6 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 53.33% |
Changes | 0 |
1 | <?php |
||
5 | class AssetExtension extends \Twig_Extension |
||
6 | { |
||
7 | private $projectpath; |
||
8 | |||
9 | 26 | public function __construct($projectpath) |
|
12 | 26 | } |
|
13 | |||
14 | public function getFunctions() |
||
15 | { |
||
16 | return [new \Twig_SimpleFunction('asset_exists', [$this, 'assetExists'], ['is_safe' => ['html']])]; |
||
17 | } |
||
18 | |||
19 | 11 | public function assetExists($path) |
|
35 | } |
||
36 | |||
37 | public function getName() |
||
40 | } |
||
41 | } |
||
42 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.