5
5
namespace Codeception \Lib \Connector ;
6
6
7
7
use InvalidArgumentException ;
8
+ use ReflectionClass ;
9
+ use ReflectionMethod ;
10
+ use ReflectionProperty ;
8
11
use Symfony \Bundle \FrameworkBundle \Test \TestContainer ;
9
12
use Symfony \Component \DependencyInjection \ContainerInterface ;
10
13
use Symfony \Component \HttpFoundation \Request ;
@@ -28,9 +31,9 @@ class Symfony extends HttpKernelBrowser
28
31
/**
29
32
* Constructor.
30
33
*
31
- * @param Kernel $kernel A booted HttpKernel instance
32
- * @param array $services An injected services
33
- * @param bool $rebootable
34
+ * @param Kernel $kernel A booted HttpKernel instance
35
+ * @param array $services An injected services
36
+ * @param bool $rebootable
34
37
*/
35
38
public function __construct (Kernel $ kernel , array $ services = [], bool $ rebootable = true )
36
39
{
@@ -133,17 +136,17 @@ private function persistDoctrineConnections(): void
133
136
}
134
137
135
138
if ($ this ->container instanceof TestContainer) {
136
- $ reflectedTestContainer = new \ ReflectionMethod ($ this ->container , 'getPublicContainer ' );
139
+ $ reflectedTestContainer = new ReflectionMethod ($ this ->container , 'getPublicContainer ' );
137
140
$ reflectedTestContainer ->setAccessible (true );
138
141
$ publicContainer = $ reflectedTestContainer ->invoke ($ this ->container );
139
142
} else {
140
143
$ publicContainer = $ this ->container ;
141
144
}
142
145
143
- $ reflectedContainer = new \ ReflectionClass ($ publicContainer );
146
+ $ reflectedContainer = new ReflectionClass ($ publicContainer );
144
147
$ reflectionTarget = $ reflectedContainer ->hasProperty ('parameters ' ) ? $ publicContainer : $ publicContainer ->getParameterBag ();
145
148
146
- $ reflectedParameters = new \ ReflectionProperty ($ reflectionTarget , 'parameters ' );
149
+ $ reflectedParameters = new ReflectionProperty ($ reflectionTarget , 'parameters ' );
147
150
$ reflectedParameters ->setAccessible (true );
148
151
$ parameters = $ reflectedParameters ->getValue ($ reflectionTarget );
149
152
unset($ parameters ['doctrine.connections ' ]);
0 commit comments