Issues (21)

src/Twig/DataCollectorExtension.php (2 issues)

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