Commit 517d596b authored by Fabien Potencier's avatar Fabien Potencier

merged branch igorw/mount-argument-name (PR #555)

This PR was merged into the master branch.

Commits
-------

a868919b Rename mount() argument from $app to $controllers

Discussion
----------

Rename mount() argument from $app to $controllers

App is a legacy name, the usage of the method has changed.
parents b8ccb960 a868919b
......@@ -414,22 +414,22 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte
}
/**
* Mounts an application under the given route prefix.
* Mounts controllers under the given route prefix.
*
* @param string $prefix The route prefix
* @param ControllerCollection|ControllerProviderInterface $app A ControllerCollection or a ControllerProviderInterface instance
* @param string $prefix The route prefix
* @param ControllerCollection|ControllerProviderInterface $controllers A ControllerCollection or a ControllerProviderInterface instance
*/
public function mount($prefix, $app)
public function mount($prefix, $controllers)
{
if ($app instanceof ControllerProviderInterface) {
$app = $app->connect($this);
if ($controllers instanceof ControllerProviderInterface) {
$controllers = $controllers->connect($this);
}
if (!$app instanceof ControllerCollection) {
if (!$controllers instanceof ControllerCollection) {
throw new \LogicException('The "mount" method takes either a ControllerCollection or a ControllerProviderInterface instance.');
}
$this['routes']->addCollection($app->flush($prefix), $prefix);
$this['routes']->addCollection($controllers->flush($prefix), $prefix);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment