File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,8 @@ private static function filterInvalidType($value)
76
76
*/
77
77
private static function emptySequenceToArray ($ value ): ?array
78
78
{
79
- if ($ value instanceof Sequence && $ value ->count () === 0 ) {
79
+ if (($ value instanceof Sequence && $ value ->count () === 0 ) ||
80
+ (is_array ($ value ) && count ($ value ) === 0 )) {
80
81
return [];
81
82
}
82
83
@@ -88,9 +89,7 @@ private static function emptySequenceToArray($value): ?array
88
89
*/
89
90
private static function emptyDictionaryToStdClass ($ value ): ?stdClass
90
91
{
91
- if (($ value instanceof Map && $ value ->count () === 0 ) ||
92
- (is_array ($ value ) && count ($ value ) === 0 )
93
- ) {
92
+ if ($ value instanceof Map && $ value ->count () === 0 ) {
94
93
return new stdClass ();
95
94
}
96
95
Original file line number Diff line number Diff line change @@ -117,23 +117,23 @@ public function testFormatParameterInvalidIterable2(): void
117
117
]);
118
118
}
119
119
120
- public function testAsParmeterEmptyVector (): void
120
+ public function testAsParameterEmptyVector (): void
121
121
{
122
122
$ result = ParameterHelper::asParameter (new Vector ());
123
123
self ::assertIsArray ($ result );
124
124
self ::assertCount (0 , $ result );
125
125
}
126
126
127
- public function testAsParmeterEmptyMap (): void
127
+ public function testAsParameterEmptyMap (): void
128
128
{
129
129
$ result = ParameterHelper::asParameter (new Map ());
130
130
self ::assertInstanceOf (stdClass::class, $ result );
131
131
}
132
132
133
- public function testAsParmeterEmptyArray (): void
133
+ public function testAsParameterEmptyArray (): void
134
134
{
135
135
$ result = ParameterHelper::asParameter ([]);
136
- self ::assertInstanceOf (stdClass::class, $ result );
136
+ self ::assertIsArray ( $ result );
137
137
}
138
138
139
139
public function testStringable (): void
You can’t perform that action at this time.
0 commit comments