Smal misc fixes...

This commit is contained in:
Matias De lellis
2020-09-19 13:25:07 -03:00
parent 587fc10c76
commit 4f260c9af0
2 changed files with 7 additions and 6 deletions

View File

@@ -37,7 +37,7 @@ class NoteApiController extends ApiController {
private $userId;
public function __construct($AppName,
IRequest $request,
IRequest $request,
NoteService $noteService,
$userId)
{
@@ -74,7 +74,7 @@ class NoteApiController extends ApiController {
*
* @param int $id
*/
public function show($id): JSONResponse {
public function show(int $id): JSONResponse {
$note = $this->noteService->get($this->userId, $id);
if (is_null($note)) {
return new JSONResponse([], Http::STATUS_NOT_FOUND);
@@ -97,7 +97,7 @@ class NoteApiController extends ApiController {
* @param string $content
* @param string $color
*/
public function create($title, $content, $color = "#F7EB96") {
public function create(string $title, string $content, string $color = null) {
$note = $this->noteService->create($this->userId, $title, $content, $color);
$etag = md5(json_encode($note));

View File

@@ -37,7 +37,7 @@ class NoteController extends Controller {
private $userId;
public function __construct($AppName,
IRequest $request,
IRequest $request,
NoteService $noteService,
$userId)
{
@@ -70,7 +70,7 @@ class NoteController extends Controller {
*
* @param int $id
*/
public function show($id): JSONResponse {
public function show(int $id): JSONResponse {
$note = $this->noteService->get($this->userId, $id);
if (is_null($note)) {
return new JSONResponse([], Http::STATUS_NOT_FOUND);
@@ -91,7 +91,7 @@ class NoteController extends Controller {
* @param string $content
* @param string $color
*/
public function create($title, $content, $color = NULL) {
public function create(string $title, string $content, string $color = null) {
$note = $this->noteService->create($this->userId, $title, $content, $color);
$etag = md5(json_encode($note));
@@ -137,4 +137,5 @@ class NoteController extends Controller {
$this->noteService->destroy($this->userId, $id);
return new JSONResponse([]);
}
}