Skip to content

Commit c9538ce

Browse files
committed
interface Nette\Application\IRouter is alias for Nette\Routing\Router
1 parent 757258f commit c9538ce

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

src/Application/Routers/CliRouter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
namespace Nette\Application\Routers;
1111

1212
use Nette;
13-
use Nette\Application;
1413

1514

1615
/**
1716
* The unidirectional router for CLI. (experimental)
1817
*/
19-
final class CliRouter implements Application\IRouter
18+
final class CliRouter implements Nette\Routing\Router
2019
{
2120
use Nette\SmartObject;
2221

src/Application/Routers/Route.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* The bidirectional route is responsible for mapping
1717
* HTTP request to an array for dispatch and vice-versa.
1818
*/
19-
class Route extends Nette\Routing\Route implements Nette\Application\IRouter
19+
class Route extends Nette\Routing\Route implements Nette\Routing\Router
2020
{
2121
private const
2222
PRESENTER_KEY = 'presenter',
@@ -202,3 +202,6 @@ public static function path2presenter(string $s): string
202202
return $s;
203203
}
204204
}
205+
206+
207+
interface_exists(Nette\Application\IRouter::class);

src/Application/Routers/RouteList.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
/**
1616
* The router broker.
1717
*/
18-
class RouteList extends Nette\Routing\RouteList implements Nette\Application\IRouter, \ArrayAccess, \Countable, \IteratorAggregate
18+
class RouteList extends Nette\Routing\RouteList implements Nette\Routing\Router, \ArrayAccess, \Countable, \IteratorAggregate
1919
{
2020
private const PRESENTER_KEY = 'presenter';
2121

@@ -154,3 +154,6 @@ public function getIterator(): \ArrayIterator
154154
return new \ArrayIterator($this->getRouters());
155155
}
156156
}
157+
158+
159+
interface_exists(Nette\Application\IRouter::class);

src/Application/Routers/SimpleRouter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/**
1717
* The bidirectional route for trivial routing via query parameters.
1818
*/
19-
final class SimpleRouter extends Nette\Routing\SimpleRouter implements Nette\Application\IRouter
19+
final class SimpleRouter extends Nette\Routing\SimpleRouter implements Nette\Routing\Router
2020
{
2121
private const
2222
PRESENTER_KEY = 'presenter',
@@ -68,3 +68,6 @@ public function getFlags(): int
6868
return $this->flags;
6969
}
7070
}
71+
72+
73+
interface_exists(Nette\Application\IRouter::class);

src/Bridges/ApplicationDI/RoutingExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function loadConfiguration()
4646
$builder = $this->getContainerBuilder();
4747

4848
$router = $builder->addDefinition($this->prefix('router'))
49-
->setType(Nette\Application\IRouter::class)
49+
->setType(Nette\Routing\Router::class)
5050
->setFactory(Nette\Application\Routers\RouteList::class);
5151

5252
foreach ($this->config->routes as $mask => $action) {

src/Application/IRouter.php renamed to src/compatibility-intf.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99

1010
namespace Nette\Application;
1111

12-
use Nette;
13-
14-
15-
/**
16-
* @deprecated use Nette\Routing\Router
17-
*/
18-
interface IRouter extends Nette\Routing\Router
19-
{
12+
if (false) {
13+
/** @deprecated use Nette\Routing\Router */
14+
interface IRouter
15+
{
16+
}
17+
} elseif (!interface_exists(IRouter::class)) {
18+
class_alias(\Nette\Routing\Router::class, IRouter::class);
2019
}

0 commit comments

Comments
 (0)