@@ -23,8 +23,8 @@ class GetClassPropertiesTest extends AbstractMethodUnitTest
23
23
/**
24
24
* Test receiving an expected exception when a non class token is passed.
25
25
*
26
- * @param string $testMarker The comment which prefaces the target token in the test file.
27
- * @param array $tokenType The type of token to look for after the marker.
26
+ * @param string $testMarker The comment which prefaces the target token in the test file.
27
+ * @param int|string $tokenType The type of token to look for after the marker.
28
28
*
29
29
* @dataProvider dataNotAClassException
30
30
*
@@ -45,22 +45,22 @@ public function testNotAClassException($testMarker, $tokenType)
45
45
*
46
46
* @see testNotAClassException() For the array format.
47
47
*
48
- * @return array
48
+ * @return array<string, array<string, string|int>>
49
49
*/
50
50
public function dataNotAClassException ()
51
51
{
52
52
return [
53
53
'interface ' => [
54
- '/* testNotAClass */ ' ,
55
- \T_INTERFACE ,
54
+ 'testMarker ' => ' /* testNotAClass */ ' ,
55
+ ' tokenType ' => \T_INTERFACE ,
56
56
],
57
57
'anon-class ' => [
58
- '/* testAnonClass */ ' ,
59
- \T_ANON_CLASS ,
58
+ 'testMarker ' => ' /* testAnonClass */ ' ,
59
+ ' tokenType ' => \T_ANON_CLASS ,
60
60
],
61
61
'enum ' => [
62
- '/* testEnum */ ' ,
63
- \T_ENUM ,
62
+ 'testMarker ' => ' /* testEnum */ ' ,
63
+ ' tokenType ' => \T_ENUM ,
64
64
],
65
65
];
66
66
@@ -70,8 +70,8 @@ public function dataNotAClassException()
70
70
/**
71
71
* Test retrieving the properties for a class declaration.
72
72
*
73
- * @param string $testMarker The comment which prefaces the target token in the test file.
74
- * @param array $expected Expected function output.
73
+ * @param string $testMarker The comment which prefaces the target token in the test file.
74
+ * @param array<string, bool> $expected Expected function output.
75
75
*
76
76
* @dataProvider dataGetClassProperties
77
77
*
@@ -91,94 +91,94 @@ public function testGetClassProperties($testMarker, $expected)
91
91
*
92
92
* @see testGetClassProperties() For the array format.
93
93
*
94
- * @return array
94
+ * @return array<string, array<string, string|array<string, bool|int>>>
95
95
*/
96
96
public function dataGetClassProperties ()
97
97
{
98
98
return [
99
99
'no-properties ' => [
100
- '/* testClassWithoutProperties */ ' ,
101
- [
100
+ 'testMarker ' => ' /* testClassWithoutProperties */ ' ,
101
+ ' expected ' => [
102
102
'is_abstract ' => false ,
103
103
'is_final ' => false ,
104
104
'is_readonly ' => false ,
105
105
],
106
106
],
107
107
'abstract ' => [
108
- '/* testAbstractClass */ ' ,
109
- [
108
+ 'testMarker ' => ' /* testAbstractClass */ ' ,
109
+ ' expected ' => [
110
110
'is_abstract ' => true ,
111
111
'is_final ' => false ,
112
112
'is_readonly ' => false ,
113
113
],
114
114
],
115
115
'final ' => [
116
- '/* testFinalClass */ ' ,
117
- [
116
+ 'testMarker ' => ' /* testFinalClass */ ' ,
117
+ ' expected ' => [
118
118
'is_abstract ' => false ,
119
119
'is_final ' => true ,
120
120
'is_readonly ' => false ,
121
121
],
122
122
],
123
123
'readonly ' => [
124
- '/* testReadonlyClass */ ' ,
125
- [
124
+ 'testMarker ' => ' /* testReadonlyClass */ ' ,
125
+ ' expected ' => [
126
126
'is_abstract ' => false ,
127
127
'is_final ' => false ,
128
128
'is_readonly ' => true ,
129
129
],
130
130
],
131
131
'final-readonly ' => [
132
- '/* testFinalReadonlyClass */ ' ,
133
- [
132
+ 'testMarker ' => ' /* testFinalReadonlyClass */ ' ,
133
+ ' expected ' => [
134
134
'is_abstract ' => false ,
135
135
'is_final ' => true ,
136
136
'is_readonly ' => true ,
137
137
],
138
138
],
139
139
'readonly-final ' => [
140
- '/* testReadonlyFinalClass */ ' ,
141
- [
140
+ 'testMarker ' => ' /* testReadonlyFinalClass */ ' ,
141
+ ' expected ' => [
142
142
'is_abstract ' => false ,
143
143
'is_final ' => true ,
144
144
'is_readonly ' => true ,
145
145
],
146
146
],
147
147
'abstract-readonly ' => [
148
- '/* testAbstractReadonlyClass */ ' ,
149
- [
148
+ 'testMarker ' => ' /* testAbstractReadonlyClass */ ' ,
149
+ ' expected ' => [
150
150
'is_abstract ' => true ,
151
151
'is_final ' => false ,
152
152
'is_readonly ' => true ,
153
153
],
154
154
],
155
155
'readonly-abstract ' => [
156
- '/* testReadonlyAbstractClass */ ' ,
157
- [
156
+ 'testMarker ' => ' /* testReadonlyAbstractClass */ ' ,
157
+ ' expected ' => [
158
158
'is_abstract ' => true ,
159
159
'is_final ' => false ,
160
160
'is_readonly ' => true ,
161
161
],
162
162
],
163
163
'comments-and-new-lines ' => [
164
- '/* testWithCommentsAndNewLines */ ' ,
165
- [
164
+ 'testMarker ' => ' /* testWithCommentsAndNewLines */ ' ,
165
+ ' expected ' => [
166
166
'is_abstract ' => true ,
167
167
'is_final ' => false ,
168
168
'is_readonly ' => false ,
169
169
],
170
170
],
171
171
'no-properties-with-docblock ' => [
172
- '/* testWithDocblockWithoutProperties */ ' ,
173
- [
172
+ 'testMarker ' => ' /* testWithDocblockWithoutProperties */ ' ,
173
+ ' expected ' => [
174
174
'is_abstract ' => false ,
175
175
'is_final ' => false ,
176
176
'is_readonly ' => false ,
177
177
],
178
178
],
179
179
'abstract-final-parse-error ' => [
180
- '/* testParseErrorAbstractFinal */ ' ,
181
- [
180
+ 'testMarker ' => ' /* testParseErrorAbstractFinal */ ' ,
181
+ ' expected ' => [
182
182
'is_abstract ' => true ,
183
183
'is_final ' => true ,
184
184
'is_readonly ' => false ,
0 commit comments