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 Apr 28, 2023
1 parent 08a6e52 commit d89516e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

namespace PHPSTORM_META;

expectedArguments(\Nette\Application\Routers\Route::__construct(), 2, \Nette\Routing\Router::ONE_WAY);
expectedArguments(\Nette\Application\Routers\SimpleRouter::__construct(), 1, \Nette\Routing\Router::ONE_WAY);

registerArgumentsSet('nette_http_codes_3xx',
\Nette\Http\IResponse::S300_MultipleChoices,
\Nette\Http\IResponse::S301_MovedPermanently,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"php": ">=8.0 <8.3",
"nette/component-model": "^4.0",
"nette/http": "^4.0",
"nette/routing": "^3.0.2",
"nette/routing": "^4.0",
"nette/utils": "^4.0"
},
"suggest": {
Expand Down
4 changes: 2 additions & 2 deletions src/Application/Routers/RouteList.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public function addRoute(
#[Language('TEXT')]
string $mask,
array|string|\Closure $metadata = [],
int $flags = 0,
bool $oneWay = false,
): static
{
$this->add(new Route($mask, $metadata), $flags);
$this->add(new Route($mask, $metadata), $oneWay);
return $this;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Bridges/ApplicationTracy/RoutingPanel.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private function analyse(
string $module = '',
?string $path = null,
int $level = -1,
int $flag = 0,
array $flag = [],
): void
{
if ($router instanceof Routing\RouteList) {
Expand Down Expand Up @@ -121,7 +121,7 @@ private function analyse(
return;
}

$matched = $flag & Routing\RouteList::ONE_WAY ? 'oneway' : 'no';
$matched = empty($flag['oneWay']) ? 'no' : 'oneway';
$params = $e = null;
try {
$params = $httpRequest
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 d89516e

Please sign in to comment.