Skip to content

docs: fix types in PHPDocs in RESTful controllers #6311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions system/RESTful/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace CodeIgniter\RESTful;

use CodeIgniter\API\ResponseTrait;
use CodeIgniter\HTTP\Response;

/**
* An extendable controller to provide a RESTful API for a resource.
Expand All @@ -23,7 +24,7 @@ class ResourceController extends BaseResource
/**
* Return an array of resource objects, themselves in array format
*
* @return mixed
* @return Response|string|void
*/
public function index()
{
Expand All @@ -33,9 +34,9 @@ public function index()
/**
* Return the properties of a resource object
*
* @param mixed $id
* @param int|string|null $id
*
* @return mixed
* @return Response|string|void
*/
public function show($id = null)
{
Expand All @@ -45,7 +46,7 @@ public function show($id = null)
/**
* Return a new resource object, with default properties
*
* @return mixed
* @return Response|string|void
*/
public function new()
{
Expand All @@ -55,7 +56,7 @@ public function new()
/**
* Create a new resource object, from "posted" parameters
*
* @return mixed
* @return Response|string|void
*/
public function create()
{
Expand All @@ -65,9 +66,9 @@ public function create()
/**
* Return the editable properties of a resource object
*
* @param mixed $id
* @param int|string|null $id
*
* @return mixed
* @return Response|string|void
*/
public function edit($id = null)
{
Expand All @@ -77,9 +78,9 @@ public function edit($id = null)
/**
* Add or update a model resource, from "posted" properties
*
* @param mixed $id
* @param string|null|int$id
*
* @return mixed
* @return Response|string|void
*/
public function update($id = null)
{
Expand All @@ -89,9 +90,9 @@ public function update($id = null)
/**
* Delete the designated resource object from the model
*
* @param mixed $id
* @param int|string|null $id
*
* @return mixed
* @return Response|string|void
*/
public function delete($id = null)
{
Expand All @@ -100,6 +101,8 @@ public function delete($id = null)

/**
* Set/change the expected response representation for returned objects
*
* @return void
*/
public function setFormat(string $format = 'json')
{
Expand Down
28 changes: 15 additions & 13 deletions system/RESTful/ResourcePresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace CodeIgniter\RESTful;

use CodeIgniter\HTTP\Response;

/**
* An extendable controller to help provide a UI for a resource.
*/
Expand All @@ -19,7 +21,7 @@ class ResourcePresenter extends BaseResource
/**
* Present a view of resource objects
*
* @return mixed
* @return Response|string|void
*/
public function index()
{
Expand All @@ -29,9 +31,9 @@ public function index()
/**
* Present a view to present a specific resource object
*
* @param mixed $id
* @param int|string|null $id
*
* @return mixed
* @return Response|string|void
*/
public function show($id = null)
{
Expand All @@ -41,7 +43,7 @@ public function show($id = null)
/**
* Present a view to present a new single resource object
*
* @return mixed
* @return Response|string|void
*/
public function new()
{
Expand All @@ -52,7 +54,7 @@ public function new()
* Process the creation/insertion of a new resource object.
* This should be a POST.
*
* @return mixed
* @return Response|string|void
*/
public function create()
{
Expand All @@ -62,9 +64,9 @@ public function create()
/**
* Present a view to edit the properties of a specific resource object
*
* @param mixed $id
* @param int|string|null $id
*
* @return mixed
* @return Response|string|void
*/
public function edit($id = null)
{
Expand All @@ -75,9 +77,9 @@ 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 int|string|null $id
*
* @return mixed
* @return Response|string|void
*/
public function update($id = null)
{
Expand All @@ -87,9 +89,9 @@ public function update($id = null)
/**
* Present a view to confirm the deletion of a specific resource object
*
* @param mixed $id
* @param int|string|null $id
*
* @return mixed
* @return Response|string|void
*/
public function remove($id = null)
{
Expand All @@ -99,9 +101,9 @@ public function remove($id = null)
/**
* Process the deletion of a specific resource object
*
* @param mixed $id
* @param int|string|null $id
*
* @return mixed
* @return Response|string|void
*/
public function delete($id = null)
{
Expand Down