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)
7676 */
7777 private static function emptySequenceToArray ($ value ): ?array
7878 {
79- if ($ value instanceof Sequence && $ value ->count () === 0 ) {
79+ if (($ value instanceof Sequence && $ value ->count () === 0 ) ||
80+ (is_array ($ value ) && count ($ value ) === 0 )) {
8081 return [];
8182 }
8283
@@ -88,9 +89,7 @@ private static function emptySequenceToArray($value): ?array
8889 */
8990 private static function emptyDictionaryToStdClass ($ value ): ?stdClass
9091 {
91- if (($ value instanceof Map && $ value ->count () === 0 ) ||
92- (is_array ($ value ) && count ($ value ) === 0 )
93- ) {
92+ if ($ value instanceof Map && $ value ->count () === 0 ) {
9493 return new stdClass ();
9594 }
9695
Original file line number Diff line number Diff line change @@ -117,23 +117,23 @@ public function testFormatParameterInvalidIterable2(): void
117117 ]);
118118 }
119119
120- public function testAsParmeterEmptyVector (): void
120+ public function testAsParameterEmptyVector (): void
121121 {
122122 $ result = ParameterHelper::asParameter (new Vector ());
123123 self ::assertIsArray ($ result );
124124 self ::assertCount (0 , $ result );
125125 }
126126
127- public function testAsParmeterEmptyMap (): void
127+ public function testAsParameterEmptyMap (): void
128128 {
129129 $ result = ParameterHelper::asParameter (new Map ());
130130 self ::assertInstanceOf (stdClass::class, $ result );
131131 }
132132
133- public function testAsParmeterEmptyArray (): void
133+ public function testAsParameterEmptyArray (): void
134134 {
135135 $ result = ParameterHelper::asParameter ([]);
136- self ::assertInstanceOf (stdClass::class, $ result );
136+ self ::assertIsArray ( $ result );
137137 }
138138
139139 public function testStringable (): void
You can’t perform that action at this time.
0 commit comments