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
Loading history...
|
|||
33 | ]); |
||
34 | } |
||
35 | } |
||
36 |