From 7b6b7d07b7cf75718b3d70474251bfa3f9d60d34 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 19 Feb 2024 21:28:25 +0900 Subject: [PATCH 1/5] fix: comments in template --- .../Generators/Views/controller.tpl.php | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/system/Commands/Generators/Views/controller.tpl.php b/system/Commands/Generators/Views/controller.tpl.php index 2fe99e1b296b..8d9237a63405 100644 --- a/system/Commands/Generators/Views/controller.tpl.php +++ b/system/Commands/Generators/Views/controller.tpl.php @@ -9,7 +9,7 @@ class {class} extends {extends} { /** - * Return an array of resource objects, themselves in array format + * Return an array of resource objects, themselves in array format. * * @return ResponseInterface */ @@ -19,7 +19,7 @@ public function index() } /** - * Return the properties of a resource object + * Return the properties of a resource object. * * @return ResponseInterface */ @@ -29,7 +29,7 @@ public function show($id = null) } /** - * Return a new resource object, with default properties + * Return a new resource object, with default properties. * * @return ResponseInterface */ @@ -39,7 +39,7 @@ public function new() } /** - * Create a new resource object, from "posted" parameters + * Create a new resource object, from "posted" parameters. * * @return ResponseInterface */ @@ -49,7 +49,7 @@ public function create() } /** - * Return the editable properties of a resource object + * Return the editable properties of a resource object. * * @return ResponseInterface */ @@ -59,7 +59,7 @@ public function edit($id = null) } /** - * Add or update a model resource, from "posted" properties + * Add or update a model resource, from "posted" properties. * * @return ResponseInterface */ @@ -69,7 +69,7 @@ public function update($id = null) } /** - * Delete the designated resource object from the model + * Delete the designated resource object from the model. * * @return ResponseInterface */ @@ -79,7 +79,7 @@ public function delete($id = null) } /** - * Present a view of resource objects + * Present a view of resource objects. * * @return ResponseInterface */ @@ -89,7 +89,7 @@ public function index() } /** - * Present a view to present a specific resource object + * Present a view to present a specific resource object. * * @param string $id * @@ -101,7 +101,7 @@ public function show($id = null) } /** - * Present a view to present a new single resource object + * Present a view to present a new single resource object. * * @return mixed */ @@ -122,7 +122,7 @@ public function create() } /** - * Present a view to edit the properties of a specific resource object + * Present a view to edit the properties of a specific resource object. * * @param mixed $id * @@ -147,7 +147,7 @@ public function update($id = null) } /** - * Present a view to confirm the deletion of a specific resource object + * Present a view to confirm the deletion of a specific resource object. * * @param mixed $id * @@ -159,7 +159,7 @@ public function remove($id = null) } /** - * Process the deletion of a specific resource object + * Process the deletion of a specific resource object. * * @param mixed $id * From 40b9def8133ab63f47ad73c83d93abc72c0ef3e5 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 19 Feb 2024 21:29:42 +0900 Subject: [PATCH 2/5] fix: add missing @param in template --- system/Commands/Generators/Views/controller.tpl.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system/Commands/Generators/Views/controller.tpl.php b/system/Commands/Generators/Views/controller.tpl.php index 8d9237a63405..38ff73998b42 100644 --- a/system/Commands/Generators/Views/controller.tpl.php +++ b/system/Commands/Generators/Views/controller.tpl.php @@ -21,6 +21,8 @@ public function index() /** * Return the properties of a resource object. * + * @param string|null $id + * * @return ResponseInterface */ public function show($id = null) @@ -51,6 +53,8 @@ public function create() /** * Return the editable properties of a resource object. * + * @param string|null $id + * * @return ResponseInterface */ public function edit($id = null) @@ -61,6 +65,8 @@ public function edit($id = null) /** * Add or update a model resource, from "posted" properties. * + * @param string|null $id + * * @return ResponseInterface */ public function update($id = null) @@ -71,6 +77,8 @@ public function update($id = null) /** * Delete the designated resource object from the model. * + * @param string|null $id + * * @return ResponseInterface */ public function delete($id = null) From a988a38bb167e792fb48b639e5b2b4c5f9703cc7 Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 19 Feb 2024 21:31:04 +0900 Subject: [PATCH 3/5] fix: @param in template --- system/Commands/Generators/Views/controller.tpl.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/system/Commands/Generators/Views/controller.tpl.php b/system/Commands/Generators/Views/controller.tpl.php index 38ff73998b42..9ea8bb4e57b6 100644 --- a/system/Commands/Generators/Views/controller.tpl.php +++ b/system/Commands/Generators/Views/controller.tpl.php @@ -99,7 +99,7 @@ public function index() /** * Present a view to present a specific resource object. * - * @param string $id + * @param string|null $id * * @return ResponseInterface */ @@ -132,7 +132,7 @@ public function create() /** * Present a view to edit the properties of a specific resource object. * - * @param mixed $id + * @param string|null $id * * @return mixed */ @@ -145,7 +145,7 @@ public function edit($id = null) * Process the updating, full or partial, of a specific resource object. * This should be a POST. * - * @param mixed $id + * @param string|null $id * * @return mixed */ @@ -157,7 +157,7 @@ public function update($id = null) /** * Present a view to confirm the deletion of a specific resource object. * - * @param mixed $id + * @param string|null $id * * @return mixed */ @@ -169,7 +169,7 @@ public function remove($id = null) /** * Process the deletion of a specific resource object. * - * @param mixed $id + * @param string|null $id * * @return mixed */ From 5ae47a3283a2fda826061b2638d93687ae706bba Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 19 Feb 2024 21:31:30 +0900 Subject: [PATCH 4/5] fix: @return in template --- system/Commands/Generators/Views/controller.tpl.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/Commands/Generators/Views/controller.tpl.php b/system/Commands/Generators/Views/controller.tpl.php index 9ea8bb4e57b6..7ed97a008604 100644 --- a/system/Commands/Generators/Views/controller.tpl.php +++ b/system/Commands/Generators/Views/controller.tpl.php @@ -111,7 +111,7 @@ public function show($id = null) /** * Present a view to present a new single resource object. * - * @return mixed + * @return ResponseInterface */ public function new() { @@ -122,7 +122,7 @@ public function new() * Process the creation/insertion of a new resource object. * This should be a POST. * - * @return mixed + * @return ResponseInterface */ public function create() { @@ -134,7 +134,7 @@ public function create() * * @param string|null $id * - * @return mixed + * @return ResponseInterface */ public function edit($id = null) { @@ -147,7 +147,7 @@ public function edit($id = null) * * @param string|null $id * - * @return mixed + * @return ResponseInterface */ public function update($id = null) { @@ -159,7 +159,7 @@ public function update($id = null) * * @param string|null $id * - * @return mixed + * @return ResponseInterface */ public function remove($id = null) { @@ -171,7 +171,7 @@ public function remove($id = null) * * @param string|null $id * - * @return mixed + * @return ResponseInterface */ public function delete($id = null) { From 4b8a38d43885d1cd63e8c17ee4ccb91701f1b546 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 23 Feb 2024 21:03:13 +0900 Subject: [PATCH 5/5] fix: add type int for $id Now if we add type int to controller params, it works. So we must allow type-casting on controller parameters in the future. --- .../Generators/Views/controller.tpl.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/system/Commands/Generators/Views/controller.tpl.php b/system/Commands/Generators/Views/controller.tpl.php index 7ed97a008604..514de05b9351 100644 --- a/system/Commands/Generators/Views/controller.tpl.php +++ b/system/Commands/Generators/Views/controller.tpl.php @@ -21,7 +21,7 @@ public function index() /** * Return the properties of a resource object. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */ @@ -53,7 +53,7 @@ public function create() /** * Return the editable properties of a resource object. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */ @@ -65,7 +65,7 @@ public function edit($id = null) /** * Add or update a model resource, from "posted" properties. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */ @@ -77,7 +77,7 @@ public function update($id = null) /** * Delete the designated resource object from the model. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */ @@ -99,7 +99,7 @@ public function index() /** * Present a view to present a specific resource object. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */ @@ -132,7 +132,7 @@ public function create() /** * Present a view to edit the properties of a specific resource object. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */ @@ -145,7 +145,7 @@ public function edit($id = null) * Process the updating, full or partial, of a specific resource object. * This should be a POST. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */ @@ -157,7 +157,7 @@ public function update($id = null) /** * Present a view to confirm the deletion of a specific resource object. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */ @@ -169,7 +169,7 @@ public function remove($id = null) /** * Process the deletion of a specific resource object. * - * @param string|null $id + * @param int|string|null $id * * @return ResponseInterface */