Skip to content

Commit eaba61c

Browse files
committed
Merge pull request #109 from dawehner/chain_router_interface
Add a chain router interface
2 parents 3706f27 + 99afad7 commit eaba61c

File tree

3 files changed

+45
-8
lines changed

3 files changed

+45
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Changelog
22
=========
33

4+
* **2014-08-20**: Added an interface for the ChainRouter
45
* **2014-06-06**: Updated to PSR-4 autoloading
56

67
1.2.0

ChainRouter.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @author Henrik Bjornskov <[email protected]>
3232
* @author Magnus Nordlander <[email protected]>
3333
*/
34-
class ChainRouter implements RouterInterface, RequestMatcherInterface, WarmableInterface
34+
class ChainRouter implements ChainRouterInterface, WarmableInterface
3535
{
3636
/**
3737
* @var \Symfony\Component\Routing\RequestContext
@@ -76,10 +76,7 @@ public function getContext()
7676
}
7777

7878
/**
79-
* Add a Router to the index
80-
*
81-
* @param RouterInterface $router The router instance
82-
* @param integer $priority The priority
79+
* {@inheritdoc}
8380
*/
8481
public function add(RouterInterface $router, $priority = 0)
8582
{
@@ -92,9 +89,7 @@ public function add(RouterInterface $router, $priority = 0)
9289
}
9390

9491
/**
95-
* Sorts the routers and flattens them.
96-
*
97-
* @return RouterInterface[]
92+
* {@inheritdoc}
9893
*/
9994
public function all()
10095
{

ChainRouterInterface.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony CMF package.
5+
*
6+
* (c) 2011-2014 Symfony CMF
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Cmf\Component\Routing;
13+
14+
use Symfony\Component\Routing\RouterInterface;
15+
use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
16+
17+
/**
18+
* ChainRouterInterface
19+
*
20+
* Allows access to a lot of different routers.
21+
*
22+
* @author Henrik Bjornskov <[email protected]>
23+
* @author Magnus Nordlander <[email protected]>
24+
*/
25+
interface ChainRouterInterface extends RouterInterface, RequestMatcherInterface
26+
{
27+
/**
28+
* Add a Router to the index
29+
*
30+
* @param RouterInterface $router The router instance
31+
* @param integer $priority The priority
32+
*/
33+
public function add(RouterInterface $router, $priority = 0);
34+
35+
/**
36+
* Sorts the routers and flattens them.
37+
*
38+
* @return RouterInterface[]
39+
*/
40+
public function all();
41+
}

0 commit comments

Comments
 (0)