Skip to content

Commit 9ef1598

Browse files
committed
add missing property and return types in tests/ #11
1 parent 630f21a commit 9ef1598

11 files changed

+42
-42
lines changed

tests/AbstractFunctionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function testInheritance()
5555
* Data provider for invalid function names.
5656
* @return array
5757
*/
58-
public static function provideInvalidNames()
58+
public static function provideInvalidNames(): array
5959
{
6060
return [
6161
[''],
@@ -470,7 +470,7 @@ public function testJsonDeserialization()
470470
* Data provider for invalid JSON.
471471
* @return array
472472
*/
473-
public static function provideInvalidJson()
473+
public static function provideInvalidJson(): array
474474
{
475475
return [
476476
[

tests/Api/ApiElementTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testConstructorAndInheritedClasses()
4242
* Data provider for non-string parameters.
4343
* @return array
4444
*/
45-
public static function provideNonStrings()
45+
public static function provideNonStrings(): array
4646
{
4747
return [
4848
[0],
@@ -72,7 +72,7 @@ public function testNonStringTypes($type)
7272
* Data provider for invalid element types.
7373
* @return array
7474
*/
75-
public static function provideInvalidElementTypes()
75+
public static function provideInvalidElementTypes(): array
7676
{
7777
return [
7878
['STRING'],
@@ -105,7 +105,7 @@ public function testInvalidElementTypes($type)
105105
* Data provider for valid element types.
106106
* @return array
107107
*/
108-
public static function provideValidElementTypes()
108+
public static function provideValidElementTypes(): array
109109
{
110110
return [
111111
[IElement::TYPE_BOOLEAN],
@@ -133,7 +133,7 @@ public function testValidElementTypes($type)
133133
* Data provider for invalid element names.
134134
* @return array
135135
*/
136-
public static function provideInvalidElementNames()
136+
public static function provideInvalidElementNames(): array
137137
{
138138
$return = static::provideNonStrings();
139139
$return[] = [''];
@@ -156,7 +156,7 @@ public function testInvalidElementNames($name)
156156
* Data provider for some typecast data.
157157
* @return array
158158
*/
159-
public static function provideTypecastData()
159+
public static function provideTypecastData(): array
160160
{
161161
return [
162162
[Element::TYPE_BOOLEAN, '1', true],
@@ -244,7 +244,7 @@ public function testJsonDecode()
244244
* array.
245245
* @return array
246246
*/
247-
public static function provideInvalidJson()
247+
public static function provideInvalidJson(): array
248248
{
249249
$cfg = new stdClass();
250250
$cfg->name = 'MqUyFBxx';
@@ -278,7 +278,7 @@ public function testInvalidJson($json)
278278
* array.
279279
* @return array
280280
*/
281-
public static function provideInvalidJsonString()
281+
public static function provideInvalidJsonString(): array
282282
{
283283
return [
284284
[''],
@@ -306,7 +306,7 @@ public function testInvalidJsonString($json)
306306
* Data provider for incomplete JSON objects.
307307
* @return array
308308
*/
309-
public static function provideIncompleteJsonObjects()
309+
public static function provideIncompleteJsonObjects(): array
310310
{
311311
return [
312312
['{"name":"I2g8g23n"}'],
@@ -334,7 +334,7 @@ public function testIncompleteJsonObjects($json)
334334
* Data provider for non-array type values.
335335
* @return array
336336
*/
337-
public static function provideNonArray()
337+
public static function provideNonArray(): array
338338
{
339339
return [
340340
['dNtKMbKSJ8'],

tests/Api/ApiValueTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testNonStringDirections($direction)
5959
* Data provider for invalid direction strings.
6060
* @return array
6161
*/
62-
public static function provideInvalidValueDirections()
62+
public static function provideInvalidValueDirections(): array
6363
{
6464
return [
6565
[''],
@@ -88,7 +88,7 @@ public function testInvalidValueDirections($direction)
8888
* Data provider for non-boolean values.
8989
* @return array
9090
*/
91-
public static function provideNonBooleans()
91+
public static function provideNonBooleans(): array
9292
{
9393
return [
9494
['true'],
@@ -162,7 +162,7 @@ public function testInvalidJsonString($json)
162162
* Data provider for incomplete JSON objects.
163163
* @return array
164164
*/
165-
public static function provideIncompleteJsonObjects()
165+
public static function provideIncompleteJsonObjects(): array
166166
{
167167
$return = ApiElementTest::provideIncompleteJsonObjects();
168168
$return[] = ['{"type":"int","name":"TRD2cpKy"}'];

tests/Api/RemoteApiTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testInheritance()
4646
* @return array
4747
* @throws InvalidArgumentException
4848
*/
49-
public static function provideApiValue()
49+
public static function provideApiValue(): array
5050
{
5151
return [
5252
[
@@ -92,7 +92,7 @@ public function testAddingAndEncodingApiValue($value, $expected)
9292
* Data provider for invalid constructor parameters.
9393
* @return array
9494
*/
95-
public static function provideInvalidConstructorParams()
95+
public static function provideInvalidConstructorParams(): array
9696
{
9797
return [
9898
[''],
@@ -123,7 +123,7 @@ public function testInvalidConstructorParams($input)
123123
* Data provider for encoded remote APIs.
124124
* @return array
125125
*/
126-
public static function provideEncodedRemoteApi()
126+
public static function provideEncodedRemoteApi(): array
127127
{
128128
/**
129129
* Construct first variant as stdClass objects.
@@ -298,7 +298,7 @@ public function testEncodedRemoteApi($config)
298298
* Data provider for invalid JSON.
299299
* @return array
300300
*/
301-
public static function provideInvalidJson()
301+
public static function provideInvalidJson(): array
302302
{
303303
$table = new stdClass();
304304
$table->type = Table::TYPE_TABLE;

tests/Api/StructTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testConstructorAndInheritance()
6969
* Data provider for non-arrays.
7070
* @return array
7171
*/
72-
public static function provideNonArrays()
72+
public static function provideNonArrays(): array
7373
{
7474
return [
7575
['array'],
@@ -202,7 +202,7 @@ public function testInvalidJson($json)
202202
* Data provider for incomplete JSON objects.
203203
* @return array
204204
*/
205-
public static function provideIncompleteJsonObjects()
205+
public static function provideIncompleteJsonObjects(): array
206206
{
207207
$return = ApiValueTest::provideIncompleteJsonObjects();
208208
$return[] = ['{"type":"struct","name":"Mvewn5c7","direction":"output","optional":false}'];
@@ -225,7 +225,7 @@ public function testIncompleteJson($json)
225225
* Data provider for JSON objects with invalid type value.
226226
* @return array
227227
*/
228-
public static function provideJsonDecodeInvalidStruct()
228+
public static function provideJsonDecodeInvalidStruct(): array
229229
{
230230
return [
231231
['{"type":"bool","name":"WG0ujcyy","direction":"input","optional":true,'
@@ -255,7 +255,7 @@ public function testJsonDecodeInvalidStruct($json)
255255
* Data provider for JSON objects with invalid members.
256256
* @return array
257257
*/
258-
public static function provideJsonDecodeInvalidMembers()
258+
public static function provideJsonDecodeInvalidMembers(): array
259259
{
260260
return [
261261
['{"type":"struct","name":"fiNvZSEH","direction":"output",'

tests/Api/TableTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ public function testIncompleteJson($json)
218218
* Data provider for JSON objects with invalid type value.
219219
* @return array
220220
*/
221-
public static function provideJsonDecodeInvalidDirection()
221+
public static function provideJsonDecodeInvalidDirection(): array
222222
{
223223
return [
224224
['{"type":"table","name":"3iumcKfi","direction":"input","optional":true,'
@@ -244,7 +244,7 @@ public function testJsonDecodeInvalidDirection($json)
244244
* Data provider for JSON objects with invalid type value.
245245
* @return array
246246
*/
247-
public static function provideJsonDecodeInvalidType()
247+
public static function provideJsonDecodeInvalidType(): array
248248
{
249249
return [
250250
['{"type":"bool","name":"azc5s1Nb","direction":"table","optional":true,'
@@ -274,7 +274,7 @@ public function testJsonDecodeInvalidType($json)
274274
* Data provider for JSON objects with invalid members.
275275
* @return array
276276
*/
277-
public static function provideJsonDecodeInvalidMembers()
277+
public static function provideJsonDecodeInvalidMembers(): array
278278
{
279279
return [
280280
['{"type":"table","name":"96JeBc1U","direction":"table",'

tests/Config/AbstractConfigurationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function testGettingUnsetConfigurationKey()
101101
* Data provider for invalid values for set().
102102
* @return array
103103
*/
104-
public static function provideInvalidValueForSet()
104+
public static function provideInvalidValueForSet(): array
105105
{
106106
return [
107107
[1.38],
@@ -129,7 +129,7 @@ public function testInvalidValueForSet($value)
129129
* Data provider of valid configuration parameters for the constructor.
130130
* @return array
131131
*/
132-
public static function provideValidConfigurationForConstructor()
132+
public static function provideValidConfigurationForConstructor(): array
133133
{
134134
$conf = new stdClass();
135135
$conf->zadgcjmt = 'wntQeayy41';
@@ -165,7 +165,7 @@ public function testValidConfigurationForConstructor($config)
165165
* @return array
166166
* @throws Exception
167167
*/
168-
public static function provideInvalidConfigurationForConstructor()
168+
public static function provideInvalidConfigurationForConstructor(): array
169169
{
170170
return [
171171
[5126],
@@ -194,7 +194,7 @@ public function testInvalidConfigurationForConstructor($config)
194194
* Data provider of ConfigTypeA configuration for jsonDecode().
195195
* @return array
196196
*/
197-
public static function provideJsonDecodeConfigTypeA()
197+
public static function provideJsonDecodeConfigTypeA(): array
198198
{
199199
return [
200200
[[ConfigTypeA::JSON_ASHOST => 'ItulITyML1'], '{"' . ConfigTypeA::JSON_ASHOST . '":"ItulITyML1"}'],
@@ -225,7 +225,7 @@ public function testJsonDecodeConfigTypeA($array, $json)
225225
* Data provider of ConfigTypeB configuration for jsonDecode().
226226
* @return array
227227
*/
228-
public static function provideJsonDecodeConfigTypeB()
228+
public static function provideJsonDecodeConfigTypeB(): array
229229
{
230230
return [
231231
[[ConfigTypeB::JSON_MSHOST => '4htV2O3BMH'], '{"' . ConfigTypeB::JSON_MSHOST . '":"4htV2O3BMH"}'],
@@ -255,7 +255,7 @@ public function testJsonDecodeConfigTypeB($array, $json)
255255
* Data provider of non-specific configuration JSON strings.
256256
* @return array[]
257257
*/
258-
public static function provideNonSpecificJson()
258+
public static function provideNonSpecificJson(): array
259259
{
260260
return [
261261
['{}'],

tests/Config/ConfigCommonTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function testSetAndGet()
7777
* Data provider for invalid saprouter values.
7878
* @return array
7979
*/
80-
public static function provideInvalidSaprouterValues()
80+
public static function provideInvalidSaprouterValues(): array
8181
{
8282
return [
8383
[''],
@@ -107,7 +107,7 @@ public function testInvalidSaprouterValues($value)
107107
* Data provider for invalid trace values.
108108
* @return array
109109
*/
110-
public static function provideInvalidTraceValues()
110+
public static function provideInvalidTraceValues(): array
111111
{
112112
return [
113113
[''],
@@ -138,7 +138,7 @@ public function testInvalidTraceValues($value)
138138
* Data provider for invalid lang values.
139139
* @return array
140140
*/
141-
public static function provideInvalidLangValues()
141+
public static function provideInvalidLangValues(): array
142142
{
143143
return [
144144
[''],

tests/Util/JsonSerializableTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function testSuccessfulDataStorage()
9999
* Data provider for valid JSON objects.
100100
* @return array
101101
*/
102-
public static function provideValidJsonObjects()
102+
public static function provideValidJsonObjects(): array
103103
{
104104
$obj1 = '{"2at0q6hz":"3g8Z57oK","GNhrr5BB":9800}';
105105
return [
@@ -131,7 +131,7 @@ public function testValidJsonObjects($obj)
131131
* Data provider for invalid keys.
132132
* @return array
133133
*/
134-
public static function provideInvalidKeys()
134+
public static function provideInvalidKeys(): array
135135
{
136136
return [
137137
[''],
@@ -187,7 +187,7 @@ public function testSetInvalidData()
187187
* Data provider for invalid arrays.
188188
* @return array
189189
*/
190-
public static function provideInvalidArrays()
190+
public static function provideInvalidArrays(): array
191191
{
192192
return [
193193
['nB47gijE'],
@@ -241,7 +241,7 @@ public function testDecodingObjectFromJson()
241241
* Data provider for invalid JSON.
242242
* @return array
243243
*/
244-
public static function provideInvalidJson()
244+
public static function provideInvalidJson(): array
245245
{
246246
return [
247247
[''],
@@ -278,7 +278,7 @@ public function testInvalidJsonToArray($json)
278278
* Data provider of invalid JSON objects.
279279
* @return array
280280
*/
281-
public static function provideInvalidJsonObjects()
281+
public static function provideInvalidJsonObjects(): array
282282
{
283283
return [
284284
[66],

tests/helper/AbstractConfigurationInstance.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function has($key): bool
7272
* @return $this
7373
* @throws InvalidArgumentException
7474
*/
75-
public function setZadgcjmt($value)
75+
public function setZadgcjmt($value): AbstractConfigurationInstance
7676
{
7777
$this->set('zadgcjmt', $value);
7878
return $this;

0 commit comments

Comments
 (0)