4
4
5
5
namespace Meilisearch \Bundle \Tests ;
6
6
7
+ use Doctrine \Bundle \DoctrineBundle \ConnectionFactory ;
7
8
use Doctrine \Bundle \DoctrineBundle \DoctrineBundle ;
8
9
use Meilisearch \Bundle \MeilisearchBundle ;
9
10
use Symfony \Bundle \FrameworkBundle \FrameworkBundle ;
11
+ use Symfony \Bundle \FrameworkBundle \Kernel \MicroKernelTrait ;
10
12
use Symfony \Component \Config \Loader \LoaderInterface ;
11
- use Symfony \Component \HttpKernel \ Bundle \ BundleInterface ;
13
+ use Symfony \Component \DependencyInjection \ ContainerBuilder ;
12
14
use Symfony \Component \HttpKernel \Kernel as HttpKernel ;
13
15
14
- /**
15
- * Class Kernel.
16
- */
17
16
class Kernel extends HttpKernel
18
17
{
19
- /**
20
- * @return array<int, BundleInterface>
21
- */
22
- public function registerBundles (): array
18
+ use MicroKernelTrait;
19
+
20
+ public function registerBundles (): iterable
23
21
{
24
- return [
25
- new FrameworkBundle (),
26
- new DoctrineBundle (),
27
- new MeilisearchBundle (),
28
- ];
22
+ yield new FrameworkBundle ();
23
+ yield new DoctrineBundle ();
24
+ yield new MeilisearchBundle ();
29
25
}
30
26
31
- public function registerContainerConfiguration ( LoaderInterface $ loader ): void
27
+ protected function configureContainer ( ContainerBuilder $ container , LoaderInterface $ loader ): void
32
28
{
33
29
if (PHP_VERSION_ID >= 80000 ) {
34
30
$ loader ->load (__DIR__ .'/config/config.yaml ' );
@@ -37,5 +33,13 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
37
33
}
38
34
$ loader ->load (__DIR__ .'/../config/services.xml ' );
39
35
$ loader ->load (__DIR__ .'/config/meilisearch.yaml ' );
36
+
37
+ if (defined (ConnectionFactory::class.'::DEFAULT_SCHEME_MAP ' )) {
38
+ $ container ->prependExtensionConfig ('doctrine ' , [
39
+ 'orm ' => [
40
+ 'report_fields_where_declared ' => true ,
41
+ ],
42
+ ]);
43
+ }
40
44
}
41
45
}
0 commit comments