Skip to content

Commit

Permalink
feat: bring back order id
Browse files Browse the repository at this point in the history
  • Loading branch information
TorstenDittmann committed Aug 30, 2023
1 parent 7934125 commit 808fda7
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,39 @@ class Route extends Hook
*/
protected array $pathParams = [];

/**
* Internal counter.
*
* @var int
*/
protected static int $counter = 0;

/**
* Route order ID.
*
* @var int
*/
protected int $order;

public function __construct(string $method, string $path)
{
$this->path($path);
$this->method = $method;
$this->order = ++self::$counter;
$this->action = function (): void {
};
}

/**
* Get Route Order ID
*
* @return int
*/
public function getOrder(): int
{
return $this->order;
}

/**
* Add path
*
Expand Down Expand Up @@ -140,4 +165,6 @@ public function getPathValues(Request $request): array

return $pathValues;
}


}

0 comments on commit 808fda7

Please sign in to comment.