Skip to content

Commit

Permalink
return mixed type
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasVotruba committed Feb 4, 2022
1 parent 4b465db commit 96ca0b7
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/Type/Php/JsonThrowOnErrorDynamicReturnTypeExtension.php
Expand Up @@ -140,23 +140,10 @@ private function narrowTypeForJsonDecode(FuncCall $funcCall, Scope $scope): Type

// fallback type
if ($isForceArray) {
return new UnionType([
new ArrayType(new MixedType(), new MixedType()),
new StringType(),
new FloatType(),
new IntegerType(),
new BooleanType(),
]);
return new MixedType(true, new ObjectType(stdClass::class));
}

// scalar types with stdClass
return new UnionType([
new ObjectType(stdClass::class),
new StringType(),
new FloatType(),
new IntegerType(),
new BooleanType(),
]);
return new MixedType(true);
}

/**
Expand Down

0 comments on commit 96ca0b7

Please sign in to comment.