/** * @param string $json * * @throws DecodingException */ protected static function throwDecodingExceptionIfOccurred($json) { if (JSON_ERROR_NONE === json_last_error()) { return; } $decodingException = new DecodingException(sprintf('JSON decoding failed: %s', json_last_error_msg()), json_last_error()); $decodingException->setDecodingData($json); throw $decodingException; }
/** * @param string $data * * @throws DecodingException */ protected static function throwDecodingException($data) { $decodingException = new DecodingException('Base64 decoding failed'); $decodingException->setDecodingData($data); throw $decodingException; }