|
|
@ -4,6 +4,7 @@ namespace IQBall\Api;
|
|
|
|
|
|
|
|
|
|
|
|
use IQBall\Core\Control;
|
|
|
|
use IQBall\Core\Control;
|
|
|
|
use IQBall\Core\ControlSchemaErrorResponseFactory;
|
|
|
|
use IQBall\Core\ControlSchemaErrorResponseFactory;
|
|
|
|
|
|
|
|
use IQBall\Core\Http\HttpCodes;
|
|
|
|
use IQBall\Core\Http\HttpRequest;
|
|
|
|
use IQBall\Core\Http\HttpRequest;
|
|
|
|
use IQBall\Core\Http\HttpResponse;
|
|
|
|
use IQBall\Core\Http\HttpResponse;
|
|
|
|
use IQBall\Core\Http\JsonHttpResponse;
|
|
|
|
use IQBall\Core\Http\JsonHttpResponse;
|
|
|
@ -13,7 +14,7 @@ class APIControl {
|
|
|
|
private static function errorFactory(): ControlSchemaErrorResponseFactory {
|
|
|
|
private static function errorFactory(): ControlSchemaErrorResponseFactory {
|
|
|
|
return new class () implements ControlSchemaErrorResponseFactory {
|
|
|
|
return new class () implements ControlSchemaErrorResponseFactory {
|
|
|
|
public function apply(array $failures): HttpResponse {
|
|
|
|
public function apply(array $failures): HttpResponse {
|
|
|
|
return new JsonHttpResponse($failures);
|
|
|
|
return new JsonHttpResponse($failures, HttpCodes::BAD_REQUEST);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|