Issues (8)

Tests/Form/AbstractFormTypeExtension.php (1 issue)

1
<?php declare(strict_types = 1);
2
3
namespace Bukashk0zzz\FilterBundle\Tests\Form;
4
5
use Bukashk0zzz\FilterBundle\Service\Filter;
6
use Doctrine\Common\Annotations\AnnotationReader;
7
use Doctrine\Common\Annotations\CachedReader;
8
use Doctrine\Common\Cache\Psr6\DoctrineProvider;
9
use Symfony\Component\Cache\Adapter\ArrayAdapter;
10
use Symfony\Component\Form\Test\TypeTestCase;
11
12
/**
13
 * AbstractFormTypeExtension.
14
 */
15
abstract class AbstractFormTypeExtension extends TypeTestCase
16
{
17
    /**
18
     * @var bool
19
     */
20
    protected $autoFilter = true;
21
22
    /**
23
     * @return array<mixed>
24
     */
25
    protected function getExtensions(): array
26
    {
27
        $cache = DoctrineProvider::wrap(
28
            new ArrayAdapter()
29
        );
30
31
        return \array_merge(parent::getExtensions(), [
32
            new FilterExtension(new Filter(new CachedReader(new AnnotationReader(), $cache)), $this->autoFilter),
0 ignored issues
show
Deprecated Code introduced by
The class Doctrine\Common\Annotations\CachedReader has been deprecated: the CachedReader is deprecated and will be removed in version 2.0.0 of doctrine/annotations. Please use the {@see \Doctrine\Common\Annotations\PsrCachedReader} instead. ( Ignorable by Annotation )

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

32
            new FilterExtension(new Filter(/** @scrutinizer ignore-deprecated */ new CachedReader(new AnnotationReader(), $cache)), $this->autoFilter),
Loading history...
33
        ]);
34
    }
35
}
36