private function checkType($oldType, $newType, NodePath $nodePath) : string
    {
        if (!is_null($oldType) && ($newType !== $oldType) && ($newType !== 'null') && ($oldType !== 'null')) {
            throw new JsonParserException(
                "Data in '$nodePath' contains incompatible data types '$oldType' and '$newType'."
            );
        }
        return $newType;
    }
private function checkType($oldType, $newType, NodePath $nodePath) : string
    {
        if (!is_null($oldType) && ($newType !== $oldType) && ($newType !== 'null') && ($oldType !== 'null')) {
            throw new JsonParserException(
                "Data in '$nodePath' contains incompatible data types '$oldType' and '$newType'."
            );
        }
        return $newType;
    }
private function checkType ( $ oldType , $ newType , NodePath $ nodePath ) : string { if ( ! is_null ( $ oldType ) && ( $ newType !== $ oldType ) && ( $ newType !== 'null' ) && ( $ oldType !== 'null' ) ) { throw new JsonParserException ( "Data in '$nodePath' contains incompatible data types '$oldType' and '$newType'." ) ; } return $ newType ; }
Check that two types same or compatible.
@param $oldType
@param $newType
@param NodePath $nodePath
@return string
@throws JsonParserException
Check that two types same or compatible .