src/Context/ApiContext.php
protected function jsonDecode($value, $errorMessage = null) {
        $decoded = json_decode($value, true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new InvalidArgumentException(
                $errorMessage ?: 'The supplied parameter is not a valid JSON object.'
            );
        }

        return $decoded;
    }
protected function jsonDecode($value, $errorMessage = null) {
        $decoded = json_decode($value, true);

        if (json_last_error() !== JSON_ERROR_NONE) {
            throw new InvalidArgumentException(
                $errorMessage ?: 'The supplied parameter is not a valid JSON object.'
            );
        }

        return $decoded;
    }
protected function jsonDecode ( $ value , $ errorMessage = null ) { $ decoded = json_decode ( $ value , true ) ; if ( json_last_error ( ) !== JSON_ERROR_NONE ) { throw new InvalidArgumentException ( $ errorMessage ? : 'The supplied parameter is not a valid JSON object.' ) ; } return $ decoded ; }
Convert some variable to a JSON-array

@param string $value The value to decode
@param string $errorMessage Optional error message
@throws InvalidArgumentException
@return array
Convert some variable to a JSON - array