-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from dawehner/chain_router_interface
Add a chain router interface
- Loading branch information
Showing
3 changed files
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ | |
* @author Henrik Bjornskov <[email protected]> | ||
* @author Magnus Nordlander <[email protected]> | ||
*/ | ||
class ChainRouter implements RouterInterface, RequestMatcherInterface, WarmableInterface | ||
class ChainRouter implements ChainRouterInterface, WarmableInterface | ||
{ | ||
/** | ||
* @var \Symfony\Component\Routing\RequestContext | ||
|
@@ -76,10 +76,7 @@ public function getContext() | |
} | ||
|
||
/** | ||
* Add a Router to the index | ||
* | ||
* @param RouterInterface $router The router instance | ||
* @param integer $priority The priority | ||
* {@inheritdoc} | ||
*/ | ||
public function add(RouterInterface $router, $priority = 0) | ||
{ | ||
|
@@ -92,9 +89,7 @@ public function add(RouterInterface $router, $priority = 0) | |
} | ||
|
||
/** | ||
* Sorts the routers and flattens them. | ||
* | ||
* @return RouterInterface[] | ||
* {@inheritdoc} | ||
*/ | ||
public function all() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony CMF package. | ||
* | ||
* (c) 2011-2014 Symfony CMF | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Cmf\Component\Routing; | ||
|
||
use Symfony\Component\Routing\RouterInterface; | ||
use Symfony\Component\Routing\Matcher\RequestMatcherInterface; | ||
|
||
/** | ||
* ChainRouterInterface | ||
* | ||
* Allows access to a lot of different routers. | ||
* | ||
* @author Henrik Bjornskov <[email protected]> | ||
* @author Magnus Nordlander <[email protected]> | ||
*/ | ||
interface ChainRouterInterface extends RouterInterface, RequestMatcherInterface | ||
{ | ||
/** | ||
* Add a Router to the index | ||
* | ||
* @param RouterInterface $router The router instance | ||
* @param integer $priority The priority | ||
*/ | ||
public function add(RouterInterface $router, $priority = 0); | ||
|
||
/** | ||
* Sorts the routers and flattens them. | ||
* | ||
* @return RouterInterface[] | ||
*/ | ||
public function all(); | ||
} |