Skip to content

Commit

Permalink
uses nette/routing 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed May 13, 2024
1 parent c506e4c commit 0aecfbe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Application/Routers/RouteList.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ public function addRoute(
#[Language('TEXT')]
string $mask,
array|string|\Closure $metadata = [],
int|bool $oneWay = 0,
bool $oneWay = false,
): static
{
$this->add(new Route($mask, $metadata), (int) $oneWay);
$this->add(new Route($mask, $metadata), $oneWay);
return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Bridges/ApplicationTracy/RoutingPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private function analyse(Routing\RouteList $router, ?Nette\Http\IRequest $httpRe
continue;
}

$matched = $flags[$i] & $router::ONE_WAY ? 'oneway' : 'no';
$matched = empty($flags[$i]['oneWay']) ? 'no' : 'oneway';
$params = $e = null;
try {
if (
Expand Down
2 changes: 1 addition & 1 deletion tests/Routers/RouteList.addRoute.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require __DIR__ . '/Route.php';

$list = new RouteList;
$list->addRoute('foo', ['presenter' => 'foo'], RouteList::ONE_WAY);
$list->addRoute('bar', ['presenter' => 'bar'], RouteList::ONE_WAY);
$list->addRoute('bar', ['presenter' => 'bar'], oneWay: true);
$list->addRoute('hello', ['presenter' => 'hello']);


Expand Down

0 comments on commit 0aecfbe

Please sign in to comment.