8
8
use PHPStan \Analyser \Scope ;
9
9
use PHPStan \Reflection \MethodReflection ;
10
10
use PHPStan \Type \ArrayType ;
11
- use PHPStan \Type \CommonUnionType ;
12
11
use PHPStan \Type \FalseBooleanType ;
13
12
use PHPStan \Type \IterableIterableType ;
14
13
use PHPStan \Type \MixedType ;
15
14
use PHPStan \Type \ObjectType ;
16
15
use PHPStan \Type \TrueBooleanType ;
16
+ use PHPStan \Type \UnionType ;
17
17
18
18
final class FormContainerValuesDynamicReturnTypeExtensionTest extends \PHPUnit \Framework \TestCase
19
19
{
@@ -31,7 +31,7 @@ public function testParameterAsArray()
31
31
$ methodReflection = $ this ->createMock (MethodReflection::class);
32
32
$ methodReflection
33
33
->method ('getReturnType ' )
34
- ->willReturn (new CommonUnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
34
+ ->willReturn (new UnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
35
35
36
36
$ scope = $ this ->createMock (Scope::class);
37
37
$ scope ->method ('getType ' )->willReturn (new TrueBooleanType ());
@@ -57,7 +57,7 @@ public function testParameterAsArrayHash()
57
57
$ methodReflection = $ this ->createMock (MethodReflection::class);
58
58
$ methodReflection
59
59
->method ('getReturnType ' )
60
- ->willReturn (new CommonUnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
60
+ ->willReturn (new UnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
61
61
62
62
$ scope = $ this ->createMock (Scope::class);
63
63
$ scope ->method ('getType ' )->willReturn (new FalseBooleanType ());
@@ -76,15 +76,15 @@ public function testParameterAsArrayHash()
76
76
$ resultType = $ this ->extension ->getTypeFromMethodCall ($ methodReflection , $ methodCall , $ scope );
77
77
78
78
$ this ->assertInstanceOf (ObjectType::class, $ resultType );
79
- $ this ->assertSame (\Nette \Utils \ArrayHash::class, $ resultType ->getClass ());
79
+ $ this ->assertSame (\Nette \Utils \ArrayHash::class, $ resultType ->describe ());
80
80
}
81
81
82
82
public function testDefaultParameterIsArrayHash ()
83
83
{
84
84
$ methodReflection = $ this ->createMock (MethodReflection::class);
85
85
$ methodReflection
86
86
->method ('getReturnType ' )
87
- ->willReturn (new CommonUnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
87
+ ->willReturn (new UnionType ([new ArrayType (new MixedType ()), new IterableIterableType (new ObjectType (\Nette \Utils \ArrayHash::class))]));
88
88
89
89
$ scope = $ this ->createMock (Scope::class);
90
90
$ scope ->method ('getType ' )->willReturn (new FalseBooleanType ());
@@ -96,7 +96,7 @@ public function testDefaultParameterIsArrayHash()
96
96
$ resultType = $ this ->extension ->getTypeFromMethodCall ($ methodReflection , $ methodCall , $ scope );
97
97
98
98
$ this ->assertInstanceOf (ObjectType::class, $ resultType );
99
- $ this ->assertSame (\Nette \Utils \ArrayHash::class, $ resultType ->getClass ());
99
+ $ this ->assertSame (\Nette \Utils \ArrayHash::class, $ resultType ->describe ());
100
100
}
101
101
102
102
}
0 commit comments