Skip to content

Commit 0220402

Browse files
committed
uses nette/routing 4.0
1 parent 822f116 commit 0220402

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/Application/Routers/RouteList.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ public function addRoute(
6565
#[Language('TEXT')]
6666
string $mask,
6767
array|string|\Closure $metadata = [],
68-
int|bool $oneWay = 0,
68+
bool $oneWay = false,
6969
): static
7070
{
71-
$this->add(new Route($mask, $metadata), (int) $oneWay);
71+
$this->add(new Route($mask, $metadata), $oneWay);
7272
return $this;
7373
}
7474

src/Bridges/ApplicationTracy/RoutingPanel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private function analyse(Routing\RouteList $router, ?Nette\Http\IRequest $httpRe
8585
continue;
8686
}
8787

88-
$matched = $flags[$i] & $router::ONE_WAY ? 'oneway' : 'no';
88+
$matched = empty($flags[$i]['oneWay']) ? 'no' : 'oneway';
8989
$params = $e = null;
9090
try {
9191
if (

tests/Routers/RouteList.addRoute.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require __DIR__ . '/Route.php';
1212

1313
$list = new RouteList;
1414
$list->addRoute('foo', ['presenter' => 'foo'], RouteList::ONE_WAY);
15-
$list->addRoute('bar', ['presenter' => 'bar'], RouteList::ONE_WAY);
15+
$list->addRoute('bar', ['presenter' => 'bar'], oneWay: true);
1616
$list->addRoute('hello', ['presenter' => 'hello']);
1717

1818

0 commit comments

Comments
 (0)