Avoid magic numbers

This commit is contained in:
Pierre Rudloff 2020-07-05 11:22:55 +02:00
parent 32f0a5012c
commit b02e255cb4
3 changed files with 8 additions and 5 deletions

View file

@ -9,6 +9,7 @@ namespace Alltube\Controller;
use Alltube\Library\Exception\AlltubeLibraryException;
use Slim\Http\Request;
use Slim\Http\Response;
use Slim\Http\StatusCode;
/**
* Controller that returns JSON.
@ -38,7 +39,7 @@ class JsonController extends BaseController
return $response->withJson($this->video->getJson());
} else {
return $response->withJson(['error' => 'You need to provide the url parameter'])
->withStatus(400);
->withStatus(StatusCode::HTTP_BAD_REQUEST);
}
}
}