Completed
Push — master ( 82aeee...e45d47 )
by Dawid
05:00
created

DataCollectorExtension::schemaFileExists()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 2
rs 9.4285
c 1
b 0
f 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
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']),
31
        ];
32
    }
33
}
34