Navigation Menu

Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
Improve exception messages for mount()
Browse files Browse the repository at this point in the history
  • Loading branch information
Damien Walsh authored and fabpot committed Jun 6, 2014
1 parent b0aa888 commit 7d6298d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Silex/Application.php
Expand Up @@ -466,11 +466,17 @@ public function sendFile($file, $status = 200, array $headers = array(), $conten
* @param ControllerCollection|ControllerProviderInterface $controllers A ControllerCollection or a ControllerProviderInterface instance
*
* @return Application
*
* @throws \LogicException
*/
public function mount($prefix, $controllers)
{
if ($controllers instanceof ControllerProviderInterface) {
$controllers = $controllers->connect($this);

if (!$controllers instanceof ControllerCollection) {
throw new \LogicException('The "connect" method of the ControllerProviderInterface must return a ControllerCollection.');
}
}

if (!$controllers instanceof ControllerCollection) {
Expand Down

0 comments on commit 7d6298d

Please sign in to comment.