2727use Symfony \Component \DependencyInjection \Loader \XmlFileLoader ;
2828use Symfony \Component \DependencyInjection \ParameterBag \ParameterBag ;
2929use Symfony \Component \DependencyInjection \Reference ;
30+
3031use function assert ;
3132use function method_exists ;
3233use function sys_get_temp_dir ;
3334
3435class DoctrineMigrationsExtensionTest extends TestCase
3536{
36- public function testXmlConfigs () : void
37+ public function testXmlConfigs (): void
3738 {
3839 $ container = $ this ->getContainerBuilder ();
3940
@@ -53,7 +54,7 @@ public function testXmlConfigs() : void
5354 $ this ->assertConfigs ($ config );
5455 }
5556
56- public function testFullConfig () : void
57+ public function testFullConfig (): void
5758 {
5859 $ config = [
5960 'storage ' => [
@@ -90,7 +91,7 @@ public function testFullConfig() : void
9091 $ this ->assertConfigs ($ config );
9192 }
9293
93- public function testNoConfigsAreNeeded () : void
94+ public function testNoConfigsAreNeeded (): void
9495 {
9596 $ container = $ this ->getContainer ([]);
9697
@@ -104,7 +105,7 @@ public function testNoConfigsAreNeeded() : void
104105 self ::assertSame ([], $ config ->getMigrationDirectories ());
105106 }
106107
107- public function testBundleRelativePathResolution () : void
108+ public function testBundleRelativePathResolution (): void
108109 {
109110 $ container = $ this ->getContainer ([
110111 'migrations_paths ' => [
@@ -128,7 +129,7 @@ public function testBundleRelativePathResolution() : void
128129 ], $ config ->getMigrationDirectories ());
129130 }
130131
131- private function assertConfigs (?object $ config ) : void
132+ private function assertConfigs (?object $ config ): void
132133 {
133134 self ::assertInstanceOf (Configuration::class, $ config );
134135 self ::assertSame ([
@@ -152,7 +153,7 @@ private function assertConfigs(?object $config) : void
152153 self ::assertSame ('doctrine_migration_executed_at_column_test ' , $ storage ->getExecutedAtColumnName ());
153154 }
154155
155- public function testCustomSorter () : void
156+ public function testCustomSorter (): void
156157 {
157158 $ config = [
158159 'migrations_paths ' => ['DoctrineMigrationsTest ' => 'a ' ],
@@ -163,8 +164,8 @@ public function testCustomSorter() : void
163164 $ conn = $ this ->createMock (Connection::class);
164165 $ container ->set ('doctrine.dbal.default_connection ' , $ conn );
165166
166- $ sorter = new class () implements Comparator{
167- public function compare (Version $ a , Version $ b ) : int
167+ $ sorter = new class () implements Comparator{
168+ public function compare (Version $ a , Version $ b ): int
168169 {
169170 return 1 ;
170171 }
@@ -178,7 +179,7 @@ public function compare(Version $a, Version $b) : int
178179 self ::assertSame ($ sorter , $ di ->getVersionComparator ());
179180 }
180181
181- public function testServicesAreLazy () : void
182+ public function testServicesAreLazy (): void
182183 {
183184 $ config = [
184185 'services ' => [Comparator::class => 'my_sorter ' ],
@@ -188,8 +189,8 @@ public function testServicesAreLazy() : void
188189 $ conn = $ this ->createMock (Connection::class);
189190 $ container ->set ('doctrine.dbal.default_connection ' , $ conn );
190191
191- $ sorterFactory = new class () {
192- public function __invoke () : void
192+ $ sorterFactory = new class () {
193+ public function __invoke (): void
193194 {
194195 throw new Exception ('This method should not be invoked. ' );
195196 }
@@ -206,7 +207,7 @@ public function __invoke() : void
206207 self ::assertInstanceOf (DependencyFactory::class, $ di );
207208 }
208209
209- public function testServiceFactory () : void
210+ public function testServiceFactory (): void
210211 {
211212 $ mockComparator = $ this ->createMock (Comparator::class);
212213 $ config = [
@@ -218,7 +219,7 @@ public function testServiceFactory() : void
218219 $ conn = $ this ->createMock (Connection::class);
219220 $ container ->set ('doctrine.dbal.default_connection ' , $ conn );
220221
221- $ sorterFactory = new class ($ mockComparator ) {
222+ $ sorterFactory = new class ($ mockComparator ) {
222223 /** @var Comparator */
223224 private $ comparator ;
224225
@@ -227,7 +228,7 @@ public function __construct(Comparator $comparator)
227228 $ this ->comparator = $ comparator ;
228229 }
229230
230- public function __invoke (DependencyFactory $ di ) : Comparator
231+ public function __invoke (DependencyFactory $ di ): Comparator
231232 {
232233 return $ this ->comparator ;
233234 }
@@ -241,7 +242,7 @@ public function __invoke(DependencyFactory $di) : Comparator
241242 self ::assertSame ($ mockComparator , $ di ->getVersionComparator ());
242243 }
243244
244- public function testCustomConnection () : void
245+ public function testCustomConnection (): void
245246 {
246247 $ config = [
247248 'migrations_paths ' => ['DoctrineMigrationsTest ' => 'a ' ],
@@ -259,8 +260,7 @@ public function testCustomConnection() : void
259260 self ::assertSame ($ conn , $ di ->getConnection ());
260261 }
261262
262-
263- public function testPrefersEntityManagerOverConnection () : void
263+ public function testPrefersEntityManagerOverConnection (): void
264264 {
265265 $ config = [
266266 'migrations_paths ' => ['DoctrineMigrationsTest ' => 'a ' ],
@@ -278,7 +278,7 @@ public function testPrefersEntityManagerOverConnection() : void
278278 self ::assertSame ($ em , $ di ->getEntityManager ());
279279 }
280280
281- public function testCustomEntityManager () : void
281+ public function testCustomEntityManager (): void
282282 {
283283 $ config = [
284284 'em ' => 'custom ' ,
@@ -302,7 +302,7 @@ public function testCustomEntityManager() : void
302302 self ::assertSame ($ em , $ di ->getConnection ()->getEm ());
303303 }
304304
305- public function testCustomMetadataStorage () : void
305+ public function testCustomMetadataStorage (): void
306306 {
307307 $ config = [
308308 'migrations_paths ' => ['DoctrineMigrationsTest ' => 'a ' ],
@@ -324,7 +324,7 @@ public function testCustomMetadataStorage() : void
324324 self ::assertSame ($ mockStorage , $ di ->getMetadataStorage ());
325325 }
326326
327- public function testInvalidService () : void
327+ public function testInvalidService (): void
328328 {
329329 $ this ->expectException (InvalidConfigurationException::class);
330330 $ this ->expectExceptionMessage ('Invalid configuration for path "doctrine_migrations.services": Valid services for the DoctrineMigrationsBundle must be in the "Doctrine\Migrations" namespace. ' );
@@ -341,7 +341,7 @@ public function testInvalidService() : void
341341 $ container ->compile ();
342342 }
343343
344- public function testCanNotSpecifyBothEmAndConnection () : void
344+ public function testCanNotSpecifyBothEmAndConnection (): void
345345 {
346346 $ this ->expectExceptionMessage ('You cannot specify both "connection" and "em" in the DoctrineMigrationsBundle configurations ' );
347347 $ this ->expectException (InvalidArgumentException::class);
@@ -360,7 +360,7 @@ public function testCanNotSpecifyBothEmAndConnection() : void
360360 /**
361361 * @param mixed[] $config
362362 */
363- private function getContainer (array $ config ) : ContainerBuilder
363+ private function getContainer (array $ config ): ContainerBuilder
364364 {
365365 $ container = $ this ->getContainerBuilder ();
366366
@@ -377,9 +377,10 @@ private function getContainer(array $config) : ContainerBuilder
377377 return $ container ;
378378 }
379379
380- private function getContainerBuilder () : ContainerBuilder
380+ private function getContainerBuilder (): ContainerBuilder
381381 {
382382 $ bundle = new TestBundle ();
383+
383384 return new ContainerBuilder (new ParameterBag ([
384385 'kernel.debug ' => false ,
385386 'kernel.bundles ' => [$ bundle ->getName () => TestBundle::class],
0 commit comments