Skip to content

Commit 73fe7fa

Browse files
committed
docs: improve PHPDoc comments
1 parent d4362c4 commit 73fe7fa

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

system/API/ResponseTrait.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ trait ResponseTrait
6464

6565
/**
6666
* How to format the response data.
67-
* Either 'json' or 'xml'. If blank will be
68-
* determined through content negotiation.
67+
* Either 'json' or 'xml'. If null is set, it will be determined through
68+
* content negotiation.
6969
*
70-
* @var string
70+
* @var string|null
71+
* @phpstan-var 'json'|'xml'|null
7172
*/
7273
protected $format = 'json';
7374

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

296297
/**
297-
* Handles formatting a response. Currently makes some heavy assumptions
298+
* Handles formatting a response. Currently, makes some heavy assumptions
298299
* and needs updating! :)
299300
*
300301
* @param array|string|null $data
@@ -350,6 +351,9 @@ protected function format($data = null)
350351
/**
351352
* Sets the format the response should be in.
352353
*
354+
* @param string|null $format Response format
355+
* @phpstan-param 'json'|'xml' $format
356+
*
353357
* @return $this
354358
*/
355359
protected function setResponseFormat(?string $format = null)

system/RESTful/ResourceController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function delete($id = null)
106106
/**
107107
* Set/change the expected response representation for returned objects
108108
*
109-
* @param string $format json/xml
109+
* @param string $format Response format
110110
* @phpstan-param 'json'|'xml' $format
111111
*
112112
* @return void

0 commit comments

Comments
 (0)