Skip to content

Commit

Permalink
TASK: Adjust documentation of #[Flow\Route]
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Mar 27, 2024
1 parent 794ac4a commit f8f90df
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Neos.Flow/Classes/Annotations/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @Target({"METHOD"})
*/
#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
final class Route
final readonly class Route
{
/**
* Magic route values cannot be set as default nor be contained as segments like `{\@action}` or `{\@controller}` in the uriPattern.
Expand All @@ -36,16 +36,16 @@ final class Route
private const PRESERVED_DEFAULTS = ['@package', '@subpackage', '@controller', '@action'];

/**
* @param string $uriPattern The uri-pattern for the route without leading '/'.
* @param string $name (default null) The name ouf the route as it shows up in the route:list command
* @param array $httpMethods (default []) List of http verbs like 'GET', 'POST', 'PUT', 'DELETE', if not specified any will be matched
* @param array $defaults (default []) Values to set for this route.
* @param string $uriPattern The uri-pattern for the route without leading '/'. Might contain route values in the form of `path/{foo}`
* @param string $name The suffix of the route name as shown in `route:list` (defaults to the action name: "My.Package :: Site :: index")
* @param array $httpMethods List of uppercase http verbs like 'GET', 'POST', 'PUT', 'DELETE', if not specified any request method will be matched
* @param array $defaults Values to set for this route
*/
public function __construct(
public readonly string $uriPattern,
public readonly string $name = '',
public readonly array $httpMethods = [],
public readonly array $defaults = [],
public string $uriPattern,
public string $name = '',
public array $httpMethods = [],
public array $defaults = [],
) {
if ($uriPattern === '' || str_starts_with($uriPattern, '/')) {
throw new \DomainException(sprintf('Uri pattern must not be empty or begin with a slash: "%s"', $uriPattern), 1711529592);
Expand Down

0 comments on commit f8f90df

Please sign in to comment.