* [FIX] Wrong behavior when returning controller's method result

* [MOD] Code refactoring
This commit is contained in:
nuxsmin
2018-08-22 20:22:50 +02:00
parent 3c78910569
commit b2687c58a6
40 changed files with 653 additions and 653 deletions

View File

@@ -72,7 +72,7 @@ final class StatusController extends SimpleControllerBase
$pubVersion = $matches['major'] . $matches['minor'] . $matches['patch'] . '.' . $matches['build'];
if (Version::checkVersion(Version::getVersionStringNormalized(), $pubVersion)) {
$this->returnJsonResponseData([
return $this->returnJsonResponseData([
'version' => $requestData->tag_name,
'url' => $requestData->html_url,
'title' => $requestData->name,
@@ -81,21 +81,20 @@ final class StatusController extends SimpleControllerBase
]);
}
$this->returnJsonResponseData([]);
return;
return $this->returnJsonResponseData([]);
}
}
logger($requestData->message);
}
$this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('Versión no disponible'));
return $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('Versión no disponible'));
} catch (ClientException $e) {
processException($e);
$this->returnJsonResponseException($e);
return $this->returnJsonResponseException($e);
} catch (CheckException $e) {
$this->returnJsonResponseException($e);
return $this->returnJsonResponseException($e);
}
}
@@ -128,20 +127,19 @@ final class StatusController extends SimpleControllerBase
];
}
$this->returnJsonResponseData($notices);
return;
return $this->returnJsonResponseData($notices);
}
logger($requestData->message);
}
$this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('Notificaciones no disponibles'));
return $this->returnJsonResponse(JsonResponse::JSON_ERROR, __u('Notificaciones no disponibles'));
} catch (ClientException $e) {
processException($e);
$this->returnJsonResponseException($e);
return $this->returnJsonResponseException($e);
} catch (CheckException $e) {
$this->returnJsonResponseException($e);
return $this->returnJsonResponseException($e);
}
}
}