optimize sprintf calls
This commit is contained in:
@@ -64,7 +64,7 @@ class ElixFormsApiClient
|
|||||||
throw new \InvalidArgumentException('exportGroup deve essere una stringa non vuota.');
|
throw new \InvalidArgumentException('exportGroup deve essere una stringa non vuota.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$url = sprintf(
|
$url = \sprintf(
|
||||||
'%s/eF/services/api/request/%s/view/_DEFAULT/exportTags/get/v1?moduleTag=%s&exportGroup=%s',
|
'%s/eF/services/api/request/%s/view/_DEFAULT/exportTags/get/v1?moduleTag=%s&exportGroup=%s',
|
||||||
$this->baseUrl,
|
$this->baseUrl,
|
||||||
rawurlencode((string) $requestId),
|
rawurlencode((string) $requestId),
|
||||||
@@ -96,7 +96,7 @@ class ElixFormsApiClient
|
|||||||
|
|
||||||
$status = $response['status'] ?? 500;
|
$status = $response['status'] ?? 500;
|
||||||
if ($status !== 200) {
|
if ($status !== 200) {
|
||||||
throw new ElixFormsException(sprintf(
|
throw new ElixFormsException(\sprintf(
|
||||||
'Errore durante %s. HTTP Status: %d',
|
'Errore durante %s. HTTP Status: %d',
|
||||||
$operation,
|
$operation,
|
||||||
$status
|
$status
|
||||||
@@ -111,7 +111,7 @@ class ElixFormsApiClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!is_array($payload) || $jsonError !== JSON_ERROR_NONE) {
|
if (!is_array($payload) || $jsonError !== JSON_ERROR_NONE) {
|
||||||
throw new ElixFormsException(sprintf(
|
throw new ElixFormsException(\sprintf(
|
||||||
'Risposta non valida da %s: atteso JSON.',
|
'Risposta non valida da %s: atteso JSON.',
|
||||||
$operation
|
$operation
|
||||||
));
|
));
|
||||||
@@ -120,7 +120,7 @@ class ElixFormsApiClient
|
|||||||
$globalStatus = $payload['value']['globalStatus'] ?? null;
|
$globalStatus = $payload['value']['globalStatus'] ?? null;
|
||||||
if ($globalStatus === 'ERROR') {
|
if ($globalStatus === 'ERROR') {
|
||||||
$description = $payload['value']['description'] ?? 'errore non specificato';
|
$description = $payload['value']['description'] ?? 'errore non specificato';
|
||||||
throw new ElixFormsException(sprintf(
|
throw new ElixFormsException(\sprintf(
|
||||||
'%s ha restituito un errore: %s',
|
'%s ha restituito un errore: %s',
|
||||||
$operation,
|
$operation,
|
||||||
$description
|
$description
|
||||||
|
|||||||
Reference in New Issue
Block a user