Documentation

UBLUploadResponse extends ANAFResponse
in package

Represents the response structure for @see \EdituraEDU\ANAF\ANAFAPIClient::UploadEFactura()

Table of Contents

Properties

$IndexIncarcare  : string|null
$LastError  : Throwable|null
$rawResponse  : string|null
$ResponseTimestamp  : int|null

Methods

CreateError()  : UBLUploadResponse
HasError()  : bool
IsSuccess()  : bool
Parse()  : void
CommonParseJSON()  : stdClass|array<string|int, mixed>|null
InternalCreateError()  : void
Utility method for implementers to create an error
convertToTimestamp()  : int
Convert date string to timestamp
isErrorResponse()  : bool
Used to check if API response is a specific type of error. Can be indicative of a bad request/invalid input data
isJson()  : bool
Used to check if API response is JSON Answers that are JSON are errors
parseJSON()  : void
Parse JSON error
parseXML()  : void
Parse response XML

Properties

Methods

IsSuccess()

public IsSuccess() : bool
Return values
bool

CommonParseJSON()

protected CommonParseJSON(string|null $response) : stdClass|array<string|int, mixed>|null
Parameters
$response : string|null
Return values
stdClass|array<string|int, mixed>|null

InternalCreateError()

Utility method for implementers to create an error

protected InternalCreateError(string $message[, int $code = ANAFException::UNKNOWN_ERROR ][, Throwable|null $previous = null ]) : void
Parameters
$message : string
$code : int = ANAFException::UNKNOWN_ERROR
$previous : Throwable|null = null

convertToTimestamp()

Convert date string to timestamp

private convertToTimestamp(string $dateStr, string $format) : int
Parameters
$dateStr : string
$format : string
Return values
int

isErrorResponse()

Used to check if API response is a specific type of error. Can be indicative of a bad request/invalid input data

private isErrorResponse(string $response) : bool
Parameters
$response : string
Return values
bool

isJson()

Used to check if API response is JSON Answers that are JSON are errors

private isJson(string $string) : bool
Parameters
$string : string
Return values
bool

parseJSON()

Parse JSON error

private parseJSON(string $jsonString) : void
Parameters
$jsonString : string

parseXML()

Parse response XML

private parseXML(string $xmlString) : void
Parameters
$xmlString : string

        
On this page

Search results