11<?php
22
3+ declare (strict_types=1 );
4+
35namespace Codeception \Lib \Connector ;
46
57use InvalidArgumentException ;
@@ -42,11 +44,11 @@ class Symfony extends HttpKernelBrowser
4244 * @param array $services An injected services
4345 * @param bool $rebootable
4446 */
45- public function __construct (Kernel $ kernel , array $ services = [], $ rebootable = true )
47+ public function __construct (Kernel $ kernel , array $ services = [], bool $ rebootable = true )
4648 {
4749 parent ::__construct ($ kernel );
4850 $ this ->followRedirects (true );
49- $ this ->rebootable = ( boolean ) $ rebootable ;
51+ $ this ->rebootable = $ rebootable ;
5052 $ this ->persistentServices = $ services ;
5153 $ this ->container = $ this ->kernel ->getContainer ();
5254 $ this ->rebootKernel ();
@@ -56,7 +58,7 @@ public function __construct(Kernel $kernel, array $services = [], $rebootable =
5658 * @param Request $request
5759 * @return Response
5860 */
59- protected function doRequest ($ request )
61+ protected function doRequest ($ request ): Response
6062 {
6163 if ($ this ->rebootable ) {
6264 if ($ this ->hasPerformedRequest ) {
@@ -78,7 +80,7 @@ protected function doRequest($request)
7880 public function rebootKernel ()
7981 {
8082 if ($ this ->container ) {
81- foreach ($ this ->persistentServices as $ serviceName => $ service ) {
83+ foreach (array_keys ( $ this ->persistentServices ) as $ serviceName ) {
8284 if ($ this ->container ->has ($ serviceName )) {
8385 $ this ->persistentServices [$ serviceName ] = $ this ->container ->get ($ serviceName );
8486 }
@@ -87,6 +89,7 @@ public function rebootKernel()
8789
8890 $ this ->kernel ->shutdown ();
8991 $ this ->kernel ->boot ();
92+
9093 $ this ->container = $ this ->kernel ->getContainer ();
9194
9295 foreach ($ this ->persistentServices as $ serviceName => $ service ) {
0 commit comments