4
4
5
5
namespace Sulu \Messenger \Tests \Traits ;
6
6
7
- use ReflectionClass ;
8
7
use ReflectionException ;
9
- use ReflectionProperty ;
10
8
11
9
trait PrivatePropertyTrait
12
10
{
@@ -15,7 +13,7 @@ trait PrivatePropertyTrait
15
13
*/
16
14
protected static function getPrivateProperty (object $ object , string $ propertyName )
17
15
{
18
- $ reflection = new ReflectionClass ($ object );
16
+ $ reflection = new \ ReflectionClass ($ object );
19
17
$ propertyReflection = $ reflection ->getProperty ($ propertyName );
20
18
$ propertyReflection ->setAccessible (true );
21
19
@@ -24,7 +22,7 @@ protected static function getPrivateProperty(object $object, string $propertyNam
24
22
25
23
protected static function setPrivateProperty (object $ object , string $ propertyName , mixed $ value ): void
26
24
{
27
- $ reflection = new ReflectionClass ($ object );
25
+ $ reflection = new \ ReflectionClass ($ object );
28
26
try {
29
27
$ propertyReflection = $ reflection ->getProperty ($ propertyName );
30
28
self ::setValue ($ propertyReflection , $ object , $ value );
@@ -37,7 +35,7 @@ protected static function setPrivateProperty(object $object, string $propertyNam
37
35
}
38
36
}
39
37
40
- private static function setValue (ReflectionProperty $ propertyReflection , object $ object , mixed $ value ): void
38
+ private static function setValue (\ ReflectionProperty $ propertyReflection , object $ object , mixed $ value ): void
41
39
{
42
40
$ propertyReflection ->setAccessible (true );
43
41
0 commit comments