20250302#2

This commit is contained in:
User
2025-03-02 21:19:08 +03:00
parent 297217ee1d
commit 31833a8dde

View File

@@ -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) {