DataCollectorExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 5
Bugs 0 Features 1
Metric Value
eloc 5
c 5
b 0
f 1
dl 0
loc 22
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFunctions() 0 4 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Spiechu\SymfonyCommonsBundle\Twig;
6
7
use Spiechu\SymfonyCommonsBundle\Service\SchemaLocator;
8
9
class DataCollectorExtension extends \Twig_Extension
0 ignored issues
show
Deprecated Code introduced by
The class Twig_Extension has been deprecated: since Twig 2.7, use "Twig\Extension\AbstractExtension" instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

9
class DataCollectorExtension extends /** @scrutinizer ignore-deprecated */ \Twig_Extension
Loading history...
10
{
11
    /**
12
     * @var SchemaLocator
13
     */
14
    protected $schemaLocator;
15
16
    /**
17
     * @param SchemaLocator $schemaLocator
18
     */
19 3
    public function __construct(SchemaLocator $schemaLocator)
20
    {
21 3
        $this->schemaLocator = $schemaLocator;
22 3
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27 1
    public function getFunctions(): array
28
    {
29
        return [
30 1
            new \Twig_SimpleFunction('schema_file_exists', [$this->schemaLocator, 'schemaFileExists']),
0 ignored issues
show
Deprecated Code introduced by
The class Twig_SimpleFunction has been deprecated: since Twig 2.7, use "Twig\TwigFunction" instead ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

30
            /** @scrutinizer ignore-deprecated */ new \Twig_SimpleFunction('schema_file_exists', [$this->schemaLocator, 'schemaFileExists']),
Loading history...
31
        ];
32
    }
33
}
34