Skip to content

Commit

Permalink
docs: improve PHPDoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Feb 2, 2024
1 parent c98f943 commit 3000722
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions system/API/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ trait ResponseTrait

/**
* How to format the response data.
* Either 'json' or 'xml'. If blank will be
* determined through content negotiation.
* Either 'json' or 'xml'. If null is set, it will be determined through
* content negotiation.
*
* @var string
* @var string|null
* @phpstan-var 'json'|'xml'|null
*/
protected $format = 'json';

Expand Down Expand Up @@ -294,7 +295,7 @@ protected function failServerError(string $description = 'Internal Server Error'
// --------------------------------------------------------------------

/**
* Handles formatting a response. Currently makes some heavy assumptions
* Handles formatting a response. Currently, makes some heavy assumptions
* and needs updating! :)
*
* @param array|string|null $data
Expand Down Expand Up @@ -350,6 +351,9 @@ protected function format($data = null)
/**
* Sets the format the response should be in.
*
* @param string|null $format Response format
* @phpstan-param 'json'|'xml' $format
*
* @return $this
*/
protected function setResponseFormat(?string $format = null)
Expand Down
2 changes: 1 addition & 1 deletion system/RESTful/ResourceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function delete($id = null)
/**
* Set/change the expected response representation for returned objects
*
* @param string $format json/xml
* @param string $format Response format
* @phpstan-param 'json'|'xml' $format
*
* @return void
Expand Down

0 comments on commit 3000722

Please sign in to comment.