Skip to content

Commit

Permalink
Disable json mapper strict null types
Browse files Browse the repository at this point in the history
  • Loading branch information
sas1024 committed Apr 6, 2021
1 parent c9489b2 commit eff7984
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/EazyJsonRpc/BaseJsonRpcClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ protected function processCalls( array $calls ): bool {
* @throws \JsonMapper_Exception
*/
private function convertResult( BaseJsonRpcCall $call, string $returnType ) {
$result = null;
$mapper = new JsonMapper();
$mapper->bEnforceMapType = false;
$result = null;
$mapper = new JsonMapper();
$mapper->bEnforceMapType = false;
$mapper->bStrictNullTypes = false;
switch ( true ) {
case substr( $returnType, -2 ) == '[]':
$result = $mapper->mapArray( $call->Result, [], rtrim( $returnType, '[]' ) );
Expand Down

0 comments on commit eff7984

Please sign in to comment.