1
1
<?php
2
2
3
+ declare (strict_types=1 );
4
+
3
5
namespace Codeception \Lib \Connector ;
4
6
5
7
use InvalidArgumentException ;
@@ -42,11 +44,11 @@ class Symfony extends HttpKernelBrowser
42
44
* @param array $services An injected services
43
45
* @param bool $rebootable
44
46
*/
45
- public function __construct (Kernel $ kernel , array $ services = [], $ rebootable = true )
47
+ public function __construct (Kernel $ kernel , array $ services = [], bool $ rebootable = true )
46
48
{
47
49
parent ::__construct ($ kernel );
48
50
$ this ->followRedirects (true );
49
- $ this ->rebootable = ( boolean ) $ rebootable ;
51
+ $ this ->rebootable = $ rebootable ;
50
52
$ this ->persistentServices = $ services ;
51
53
$ this ->container = $ this ->kernel ->getContainer ();
52
54
$ this ->rebootKernel ();
@@ -56,7 +58,7 @@ public function __construct(Kernel $kernel, array $services = [], $rebootable =
56
58
* @param Request $request
57
59
* @return Response
58
60
*/
59
- protected function doRequest ($ request )
61
+ protected function doRequest ($ request ): Response
60
62
{
61
63
if ($ this ->rebootable ) {
62
64
if ($ this ->hasPerformedRequest ) {
@@ -78,7 +80,7 @@ protected function doRequest($request)
78
80
public function rebootKernel ()
79
81
{
80
82
if ($ this ->container ) {
81
- foreach ($ this ->persistentServices as $ serviceName => $ service ) {
83
+ foreach (array_keys ( $ this ->persistentServices ) as $ serviceName ) {
82
84
if ($ this ->container ->has ($ serviceName )) {
83
85
$ this ->persistentServices [$ serviceName ] = $ this ->container ->get ($ serviceName );
84
86
}
@@ -87,6 +89,7 @@ public function rebootKernel()
87
89
88
90
$ this ->kernel ->shutdown ();
89
91
$ this ->kernel ->boot ();
92
+
90
93
$ this ->container = $ this ->kernel ->getContainer ();
91
94
92
95
foreach ($ this ->persistentServices as $ serviceName => $ service ) {
0 commit comments