4
4
5
5
use stdClass ;
6
6
use Webmozart \Assert \Assert ;
7
+ use function PHPStan \Testing \assertType ;
7
8
8
9
class CollectionTest
9
10
{
10
11
11
12
public function allString (array $ a , $ b ): void
12
13
{
13
14
Assert::allString ($ a );
14
- \ PHPStan \ Testing \ assertType ('array<string> ' , $ a );
15
+ assertType ('array<string> ' , $ a );
15
16
16
17
Assert::allString ($ b );
17
- \ PHPStan \ Testing \ assertType ('iterable<string> ' , $ b );
18
+ assertType ('iterable<string> ' , $ b );
18
19
}
19
20
20
21
public function allStringNotEmpty (array $ a , iterable $ b , $ c ): void
21
22
{
22
23
Assert::allStringNotEmpty ($ a );
23
- \ PHPStan \ Testing \ assertType ('array<non-empty-string> ' , $ a );
24
+ assertType ('array<non-empty-string> ' , $ a );
24
25
25
26
Assert::allStringNotEmpty ($ b );
26
- \ PHPStan \ Testing \ assertType ('iterable<non-empty-string> ' , $ b );
27
+ assertType ('iterable<non-empty-string> ' , $ b );
27
28
28
29
Assert::allStringNotEmpty ($ c );
29
- \ PHPStan \ Testing \ assertType ('iterable<non-empty-string> ' , $ c );
30
+ assertType ('iterable<non-empty-string> ' , $ c );
30
31
}
31
32
32
33
public function allInteger (array $ a , iterable $ b , $ c ): void
33
34
{
34
35
Assert::allInteger ($ a );
35
- \ PHPStan \ Testing \ assertType ('array<int> ' , $ a );
36
+ assertType ('array<int> ' , $ a );
36
37
37
38
Assert::allInteger ($ b );
38
- \ PHPStan \ Testing \ assertType ('iterable<int> ' , $ b );
39
+ assertType ('iterable<int> ' , $ b );
39
40
40
41
Assert::allInteger ($ c );
41
- \ PHPStan \ Testing \ assertType ('iterable<int> ' , $ c );
42
+ assertType ('iterable<int> ' , $ c );
42
43
}
43
44
44
45
public function allInstanceOf (array $ a , array $ b , array $ c , $ d ): void
45
46
{
46
47
Assert::allIsInstanceOf ($ a , stdClass::class);
47
- \ PHPStan \ Testing \ assertType ('array<stdClass> ' , $ a );
48
+ assertType ('array<stdClass> ' , $ a );
48
49
49
50
Assert::allIsInstanceOf ($ b , new stdClass ());
50
- \ PHPStan \ Testing \ assertType ('array<stdClass> ' , $ b );
51
+ assertType ('array<stdClass> ' , $ b );
51
52
52
53
Assert::allIsInstanceOf ($ c , 17 );
53
- \ PHPStan \ Testing \ assertType ('array ' , $ c );
54
+ assertType ('array ' , $ c );
54
55
55
56
Assert::allIsInstanceOf ($ d , new stdClass ());
56
- \ PHPStan \ Testing \ assertType ('iterable<stdClass> ' , $ d );
57
+ assertType ('iterable<stdClass> ' , $ d );
57
58
}
58
59
59
60
/**
@@ -64,13 +65,13 @@ public function allInstanceOf(array $a, array $b, array $c, $d): void
64
65
public function allNotInstanceOf (array $ a , array $ b , array $ c ): void
65
66
{
66
67
Assert::allNotInstanceOf ($ a , CollectionBar::class);
67
- \ PHPStan \ Testing \ assertType ('array<PHPStan\Type\WebMozartAssert\CollectionFoo> ' , $ a );
68
+ assertType ('array<PHPStan\Type\WebMozartAssert\CollectionFoo> ' , $ a );
68
69
69
70
Assert::allNotInstanceOf ($ b , new stdClass ());
70
- \ PHPStan \ Testing \ assertType ('array<PHPStan\Type\WebMozartAssert\CollectionFoo> ' , $ b );
71
+ assertType ('array<PHPStan\Type\WebMozartAssert\CollectionFoo> ' , $ b );
71
72
72
73
Assert::allNotInstanceOf ($ c , 17 );
73
- \ PHPStan \ Testing \ assertType ('array<PHPStan\Type\WebMozartAssert\CollectionFoo> ' , $ c );
74
+ assertType ('array<PHPStan\Type\WebMozartAssert\CollectionFoo> ' , $ c );
74
75
}
75
76
76
77
/**
@@ -79,7 +80,7 @@ public function allNotInstanceOf(array $a, array $b, array $c): void
79
80
public function allNotNull (array $ a ): void
80
81
{
81
82
Assert::allNotNull ($ a );
82
- \ PHPStan \ Testing \ assertType ('array<int> ' , $ a );
83
+ assertType ('array<int> ' , $ a );
83
84
}
84
85
85
86
/**
@@ -88,19 +89,19 @@ public function allNotNull(array $a): void
88
89
public function allNotSame (array $ a ): void
89
90
{
90
91
Assert::allNotSame ($ a , -1 );
91
- \ PHPStan \ Testing \ assertType ('array{1, -2|2, -3|3} ' , $ a );
92
+ assertType ('array{1, -2|2, -3|3} ' , $ a );
92
93
}
93
94
94
95
public function allSubclassOf (array $ a , iterable $ b , $ c ): void
95
96
{
96
97
Assert::allSubclassOf ($ a , self ::class);
97
- \ PHPStan \ Testing \ assertType ('array<class-string<PHPStan\Type\WebMozartAssert\CollectionTest>|PHPStan\Type\WebMozartAssert\CollectionTest> ' , $ a );
98
+ assertType ('array<class-string<PHPStan\Type\WebMozartAssert\CollectionTest>|PHPStan\Type\WebMozartAssert\CollectionTest> ' , $ a );
98
99
99
100
Assert::allSubclassOf ($ b , self ::class);
100
- \ PHPStan \ Testing \ assertType ('iterable<class-string<PHPStan\Type\WebMozartAssert\CollectionTest>|PHPStan\Type\WebMozartAssert\CollectionTest> ' , $ b );
101
+ assertType ('iterable<class-string<PHPStan\Type\WebMozartAssert\CollectionTest>|PHPStan\Type\WebMozartAssert\CollectionTest> ' , $ b );
101
102
102
103
Assert::allSubclassOf ($ c , self ::class);
103
- \ PHPStan \ Testing \ assertType ('iterable<class-string<PHPStan\Type\WebMozartAssert\CollectionTest>|PHPStan\Type\WebMozartAssert\CollectionTest> ' , $ c );
104
+ assertType ('iterable<class-string<PHPStan\Type\WebMozartAssert\CollectionTest>|PHPStan\Type\WebMozartAssert\CollectionTest> ' , $ c );
104
105
}
105
106
106
107
/**
@@ -111,13 +112,13 @@ public function allSubclassOf(array $a, iterable $b, $c): void
111
112
public function allKeyExists (array $ a , array $ b , array $ c , $ d ): void
112
113
{
113
114
Assert::allKeyExists ($ a , 'id ' );
114
- \ PHPStan \ Testing \ assertType ('array<array{id: int}> ' , $ a );
115
+ assertType ('array<array{id: int}> ' , $ a );
115
116
116
117
Assert::allKeyExists ($ b , 'id ' );
117
- \ PHPStan \ Testing \ assertType ('array<int, array<string, mixed>&hasOffset( \'id \')> ' , $ b );
118
+ assertType ('array<int, array<string, mixed>&hasOffset( \'id \')> ' , $ b );
118
119
119
120
Assert::allKeyExists ($ c , 'id ' );
120
- \ PHPStan \ Testing \ assertType ('array<array&hasOffset( \'id \')> ' , $ c );
121
+ assertType ('array<array&hasOffset( \'id \')> ' , $ c );
121
122
}
122
123
123
124
/**
@@ -126,7 +127,7 @@ public function allKeyExists(array $a, array $b, array $c, $d): void
126
127
public function allCount (array $ a ): void
127
128
{
128
129
Assert::allCount ($ a , 2 );
129
- \ PHPStan \ Testing \ assertType ('array<non-empty-array> ' , $ a );
130
+ assertType ('array<non-empty-array> ' , $ a );
130
131
}
131
132
132
133
}
0 commit comments