Skip to content

Commit

Permalink
docs: add PHPDoc types
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jan 16, 2023
1 parent cc14fdd commit ffce097
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions system/Router/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ public function getRoutes(?string $verb = null): array

/**
* Returns one or all routes options
*
* @return array<string, int|string> [key => value]
*/
public function getRoutesOptions(?string $from = null, ?string $verb = null): array
{
Expand Down Expand Up @@ -1149,6 +1151,11 @@ public function getFilterForRoute(string $search, ?string $verb = null): string
* 'role:admin,manager'
*
* has a filter of "role", with parameters of ['admin', 'manager'].
*
* @param string $search routeKey
*
* @return array<int, string> filter_name or filter_name:arguments like 'role:admin,manager'
* @phpstan-return list<string>
*/
public function getFiltersForRoute(string $search, ?string $verb = null): array
{
Expand Down Expand Up @@ -1520,6 +1527,15 @@ public function resetRoutes()

/**
* Load routes options based on verb
*
* @return array<string, array<string, array|int|string>> [routeKey(or from) => [key => value]]
* @phpstan-return array<
* string,
* array{
* filter?: string|list<string>, namespace?: string, hostname?: string,
* subdomain?: string, offset?: int, priority?: int
* }
* >
*/
protected function loadRoutesOptions(?string $verb = null): array
{
Expand Down

0 comments on commit ffce097

Please sign in to comment.