Commit a868919b authored by Igor Wiedler's avatar Igor Wiedler

Rename mount() argument from $app to $controllers

App is a legacy name, the usage of the method has changed
parent 7e5e1f88
...@@ -414,22 +414,22 @@ class Application extends \Pimple implements HttpKernelInterface, TerminableInte ...@@ -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 string $prefix The route prefix
* @param ControllerCollection|ControllerProviderInterface $app A ControllerCollection or a ControllerProviderInterface instance * @param ControllerCollection|ControllerProviderInterface $controllers A ControllerCollection or a ControllerProviderInterface instance
*/ */
public function mount($prefix, $app) public function mount($prefix, $controllers)
{ {
if ($app instanceof ControllerProviderInterface) { if ($controllers instanceof ControllerProviderInterface) {
$app = $app->connect($this); $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.'); 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