@@ -143,16 +143,16 @@ class Symfony extends Framework implements DoctrineProvider, PartedModule
143143 use TimeAssertionsTrait;
144144 use TwigAssertionsTrait;
145145
146- /**
147- * @var Kernel
148- */
149- public $ kernel ;
146+ public Kernel $ kernel ;
150147
151148 /**
152149 * @var SymfonyConnector
153150 */
154151 public $ client ;
155152
153+ /**
154+ * @var array
155+ */
156156 public $ config = [
157157 'app_path ' => 'app ' ,
158158 'kernel_class ' => 'App\Kernel ' ,
@@ -172,10 +172,7 @@ public function _parts(): array
172172 return ['services ' ];
173173 }
174174
175- /**
176- * @var string|null
177- */
178- protected $ kernelClass ;
175+ protected ?string $ kernelClass = null ;
179176
180177 /**
181178 * Services that should be persistent permanently for all tests
@@ -229,6 +226,7 @@ public function _after(TestInterface $test): void
229226 foreach (array_keys ($ this ->permanentServices ) as $ serviceName ) {
230227 $ this ->permanentServices [$ serviceName ] = $ this ->grabService ($ serviceName );
231228 }
229+
232230 parent ::_after ($ test );
233231 }
234232
@@ -250,6 +248,7 @@ public function _getEntityManager()
250248 if ($ this ->kernel === null ) {
251249 $ this ->fail ('Symfony module is not loaded ' );
252250 }
251+
253252 $ emService = $ this ->config ['em_service ' ];
254253 if (!isset ($ this ->permanentServices [$ emService ])) {
255254 // Try to persist configured entity manager
@@ -258,13 +257,16 @@ public function _getEntityManager()
258257 if ($ container ->has ('doctrine ' )) {
259258 $ this ->persistPermanentService ('doctrine ' );
260259 }
260+
261261 if ($ container ->has ('doctrine.orm.default_entity_manager ' )) {
262262 $ this ->persistPermanentService ('doctrine.orm.default_entity_manager ' );
263263 }
264+
264265 if ($ container ->has ('doctrine.dbal.default_connection ' )) {
265266 $ this ->persistPermanentService ('doctrine.dbal.default_connection ' );
266267 }
267268 }
269+
268270 return $ this ->permanentServices [$ emService ];
269271 }
270272
@@ -277,9 +279,11 @@ public function _getContainer(): ContainerInterface
277279 if (!$ container instanceof ContainerInterface) {
278280 $ this ->fail ('Could not get Symfony container ' );
279281 }
282+
280283 if ($ container ->has ('test.service_container ' )) {
281284 $ container = $ container ->get ('test.service_container ' );
282285 }
286+
283287 return $ container ;
284288 }
285289
@@ -348,6 +352,7 @@ protected function getProfile(): ?Profile
348352 if (!$ profiler = $ this ->getService ('profiler ' )) {
349353 return null ;
350354 }
355+
351356 try {
352357 $ response = $ this ->getClient ()->getResponse ();
353358 return $ profiler ->loadProfileFromResponse ($ response );
@@ -356,6 +361,7 @@ protected function getProfile(): ?Profile
356361 } catch (Exception $ e ) {
357362 $ this ->fail ($ e ->getMessage ());
358363 }
364+
359365 return null ;
360366 }
361367
@@ -379,6 +385,7 @@ protected function grabCollector(string $collector, string $function, ?string $m
379385 if ($ message ) {
380386 $ this ->fail ($ message );
381387 }
388+
382389 $ this ->fail (
383390 sprintf ("The '%s' collector is needed to use the '%s' function. " , $ collector , $ function )
384391 );
@@ -419,12 +426,14 @@ protected function debugResponse($url): void
419426 $ this ->debugSection ('User ' , 'Anonymous ' );
420427 }
421428 }
429+
422430 if ($ profile ->hasCollector ('mailer ' )) {
423431 /** @var MessageDataCollector $mailerCollector */
424432 $ mailerCollector = $ profile ->getCollector ('mailer ' );
425433 $ emails = count ($ mailerCollector ->getEvents ()->getMessages ());
426434 $ this ->debugSection ('Emails ' , $ emails . ' sent ' );
427435 }
436+
428437 if ($ profile ->hasCollector ('time ' )) {
429438 /** @var TimeDataCollector $timeCollector */
430439 $ timeCollector = $ profile ->getCollector ('time ' );
0 commit comments