Make 'errors' top property in response array

This commit is contained in:
Vladimir Razuvaev 2017-07-04 16:29:30 +07:00
parent 1c41fb27ed
commit 88b85c9761

View File

@ -54,13 +54,13 @@ class ExecutionResult implements \JsonSerializable
{ {
$result = []; $result = [];
if (null !== $this->data) {
$result['data'] = $this->data;
}
if (!empty($this->errors)) { if (!empty($this->errors)) {
$result['errors'] = array_map($this->errorFormatter, $this->errors); $result['errors'] = array_map($this->errorFormatter, $this->errors);
} }
if (null !== $this->data) {
$result['data'] = $this->data;
}
if (!empty($this->extensions)) { if (!empty($this->extensions)) {
$result['extensions'] = (array) $this->extensions; $result['extensions'] = (array) $this->extensions;