20250302#2
This commit is contained in:
@@ -11,16 +11,12 @@ class Router implements RouterInterface {
|
|||||||
private array $rules = [];
|
private array $rules = [];
|
||||||
private string $startPoint = "/";
|
private string $startPoint = "/";
|
||||||
|
|
||||||
/**
|
/** @inheritDoc */
|
||||||
* @param string $mountPoint
|
|
||||||
*/
|
|
||||||
public function setStartPoint(string $mountPoint): void {
|
public function setStartPoint(string $mountPoint): void {
|
||||||
$this->startPoint = $mountPoint;
|
$this->startPoint = $mountPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @inheritDoc */
|
||||||
* @param array $rules
|
|
||||||
*/
|
|
||||||
public function withRules(array $rules): void
|
public function withRules(array $rules): void
|
||||||
{
|
{
|
||||||
$this->rules = [];
|
$this->rules = [];
|
||||||
@@ -45,10 +41,7 @@ class Router implements RouterInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @inheritDoc */
|
||||||
* @param array $rules
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function withSet(array $rules): void
|
public function withSet(array $rules): void
|
||||||
{
|
{
|
||||||
$this->rules = [];
|
$this->rules = [];
|
||||||
@@ -60,10 +53,7 @@ class Router implements RouterInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @inheritDoc */
|
||||||
* @param RequestInterface $request
|
|
||||||
* @return array|null
|
|
||||||
*/
|
|
||||||
public function match(RequestInterface $request): ?array {
|
public function match(RequestInterface $request): ?array {
|
||||||
|
|
||||||
foreach ($this->rules as $rule) {
|
foreach ($this->rules as $rule) {
|
||||||
@@ -117,10 +107,7 @@ class Router implements RouterInterface {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** @inheritDoc */
|
||||||
* @param RequestInterface $request
|
|
||||||
* @return array|null
|
|
||||||
*/
|
|
||||||
public function matchByArgv(RequestInterface $request): ?array {
|
public function matchByArgv(RequestInterface $request): ?array {
|
||||||
|
|
||||||
foreach ($this->rules as $rule) {
|
foreach ($this->rules as $rule) {
|
||||||
|
|||||||
Reference in New Issue
Block a user