Skip to content

Commit

Permalink
Annotate return value of validateOperationParams as list
Browse files Browse the repository at this point in the history
The list built with `$errors[] = …` exclusively, which means it
cannot have gaps.

The helps libraries using this method, as they can type the
result passing through as `list<…>` as well.
  • Loading branch information
mfn authored Oct 8, 2024
1 parent 5ca3882 commit 32676e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/class-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ function parseRequestParams(string $method, array $bodyParams, array $queryParam
* Checks validity of OperationParams extracted from HTTP request and returns an array of errors
* if params are invalid (or empty array when params are valid).
*
* @return array<int, RequestError>
* @return list<RequestError>
*
* @api
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function parseRequestParams(string $method, array $bodyParams, array $que
* Checks validity of OperationParams extracted from HTTP request and returns an array of errors
* if params are invalid (or empty array when params are valid).
*
* @return array<int, RequestError>
* @return list<RequestError>
*
* @api
*/
Expand Down

0 comments on commit 32676e2

Please sign in to comment.