24
24
*/
25
25
class PropertyGeneratorTest extends TestCase
26
26
{
27
- public function testPropertyConstructor ()
27
+ public function testPropertyConstructor () : void
28
28
{
29
29
$ codeGenProperty = new PropertyGenerator ();
30
30
self ::assertInstanceOf (PropertyGenerator::class, $ codeGenProperty );
31
31
}
32
32
33
33
/**
34
- * @return array
34
+ * @return bool[][]|string[][]|int[][]|null[][]
35
35
*/
36
- public function dataSetTypeSetValueGenerate ()
36
+ public function dataSetTypeSetValueGenerate () : array
37
37
{
38
38
return [
39
39
['string ' , 'foo ' , "'foo'; " ],
@@ -56,7 +56,7 @@ public function dataSetTypeSetValueGenerate()
56
56
* @param mixed $value
57
57
* @param string $code
58
58
*/
59
- public function testSetTypeSetValueGenerate ($ type , $ value , $ code )
59
+ public function testSetTypeSetValueGenerate (string $ type , $ value , string $ code ) : void
60
60
{
61
61
$ defaultValue = new PropertyValueGenerator ();
62
62
$ defaultValue ->setType ($ type );
@@ -72,9 +72,9 @@ public function testSetTypeSetValueGenerate($type, $value, $code)
72
72
* @param mixed $value
73
73
* @param string $code
74
74
*/
75
- public function testSetBogusTypeSetValueGenerateUseAutoDetection ($ type , $ value , $ code )
75
+ public function testSetBogusTypeSetValueGenerateUseAutoDetection (string $ type , $ value , string $ code ) : void
76
76
{
77
- if ($ type == ' constant ' ) {
77
+ if (' constant ' === $ type ) {
78
78
return ; // constant can only be detected explicitly
79
79
}
80
80
@@ -85,13 +85,13 @@ public function testSetBogusTypeSetValueGenerateUseAutoDetection($type, $value,
85
85
self ::assertEquals ($ code , $ defaultValue ->generate ());
86
86
}
87
87
88
- public function testPropertyReturnsSimpleValue ()
88
+ public function testPropertyReturnsSimpleValue () : void
89
89
{
90
90
$ codeGenProperty = new PropertyGenerator ('someVal ' , 'some string value ' );
91
91
self ::assertEquals (' public $someVal = \'some string value \'; ' , $ codeGenProperty ->generate ());
92
92
}
93
93
94
- public function testPropertyMultilineValue ()
94
+ public function testPropertyMultilineValue () : void
95
95
{
96
96
$ targetValue = [
97
97
5 ,
@@ -121,7 +121,7 @@ public function testPropertyMultilineValue()
121
121
self ::assertEquals ($ expectedSource , $ targetSource );
122
122
}
123
123
124
- public function testPropertyCanProduceContstantModifier ()
124
+ public function testPropertyCanProduceContstantModifier () : void
125
125
{
126
126
$ codeGenProperty = new PropertyGenerator ('someVal ' , 'some string value ' , PropertyGenerator::FLAG_CONSTANT );
127
127
self ::assertEquals (' const someVal = \'some string value \'; ' , $ codeGenProperty ->generate ());
@@ -130,14 +130,14 @@ public function testPropertyCanProduceContstantModifier()
130
130
/**
131
131
* @group PR-704
132
132
*/
133
- public function testPropertyCanProduceContstantModifierWithSetter ()
133
+ public function testPropertyCanProduceContstantModifierWithSetter () : void
134
134
{
135
135
$ codeGenProperty = new PropertyGenerator ('someVal ' , 'some string value ' );
136
136
$ codeGenProperty ->setConst (true );
137
137
self ::assertEquals (' const someVal = \'some string value \'; ' , $ codeGenProperty ->generate ());
138
138
}
139
139
140
- public function testPropertyCanProduceStaticModifier ()
140
+ public function testPropertyCanProduceStaticModifier () : void
141
141
{
142
142
$ codeGenProperty = new PropertyGenerator ('someVal ' , 'some string value ' , PropertyGenerator::FLAG_STATIC );
143
143
self ::assertEquals (' public static $someVal = \'some string value \'; ' , $ codeGenProperty ->generate ());
@@ -146,7 +146,7 @@ public function testPropertyCanProduceStaticModifier()
146
146
/**
147
147
* @group ZF-6444
148
148
*/
149
- public function testPropertyWillLoadFromReflection ()
149
+ public function testPropertyWillLoadFromReflection () : void
150
150
{
151
151
$ reflectionClass = new ClassReflection (TestAsset \TestClassWithManyProperties::class);
152
152
@@ -173,7 +173,7 @@ public function testPropertyWillLoadFromReflection()
173
173
/**
174
174
* @group ZF-6444
175
175
*/
176
- public function testPropertyWillEmitStaticModifier ()
176
+ public function testPropertyWillEmitStaticModifier () : void
177
177
{
178
178
$ codeGenProperty = new PropertyGenerator (
179
179
'someVal ' ,
@@ -186,7 +186,7 @@ public function testPropertyWillEmitStaticModifier()
186
186
/**
187
187
* @group ZF-7205
188
188
*/
189
- public function testPropertyCanHaveDocBlock ()
189
+ public function testPropertyCanHaveDocBlock () : void
190
190
{
191
191
$ codeGenProperty = new PropertyGenerator (
192
192
'someVal ' ,
@@ -205,7 +205,7 @@ public function testPropertyCanHaveDocBlock()
205
205
self ::assertEquals ($ expected , $ codeGenProperty ->generate ());
206
206
}
207
207
208
- public function testOtherTypesThrowExceptionOnGenerate ()
208
+ public function testOtherTypesThrowExceptionOnGenerate () : void
209
209
{
210
210
$ codeGenProperty = new PropertyGenerator ('someVal ' , new \stdClass ());
211
211
@@ -215,7 +215,7 @@ public function testOtherTypesThrowExceptionOnGenerate()
215
215
$ codeGenProperty ->generate ();
216
216
}
217
217
218
- public function testCreateFromArray ()
218
+ public function testCreateFromArray () : void
219
219
{
220
220
$ propertyGenerator = PropertyGenerator::fromArray ([
221
221
'name ' => 'SampleProperty ' ,
@@ -241,9 +241,9 @@ public function testCreateFromArray()
241
241
}
242
242
243
243
/**
244
- * @3491
244
+ * @group 3491
245
245
*/
246
- public function testPropertyDocBlockWillLoadFromReflection ()
246
+ public function testPropertyDocBlockWillLoadFromReflection () : void
247
247
{
248
248
$ reflectionClass = new ClassReflection (TestAsset \TestClassWithManyProperties::class);
249
249
@@ -268,7 +268,7 @@ public function testPropertyDocBlockWillLoadFromReflection()
268
268
* @param string $type
269
269
* @param mixed $value
270
270
*/
271
- public function testSetDefaultValue ($ type , $ value )
271
+ public function testSetDefaultValue (string $ type , $ value ) : void
272
272
{
273
273
$ property = new PropertyGenerator ();
274
274
$ property ->setDefaultValue ($ value , $ type );
0 commit comments