Commit 8c4cfc59 authored by Fabien Potencier's avatar Fabien Potencier

fixed phpdoc and renamed getRouteCollection() to getRoutes()

parent 5aa6a974
...@@ -58,7 +58,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -58,7 +58,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Get the current request. * Gets the current request.
* *
* @return Symfony\Component\HttpFoundation\Request * @return Symfony\Component\HttpFoundation\Request
*/ */
...@@ -68,17 +68,17 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -68,17 +68,17 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Get the collection of routes. * Gets the collection of routes.
* *
* @return Symfony\Component\Routing\RouteCollection * @return Symfony\Component\Routing\RouteCollection
*/ */
public function getRouteCollection() public function getRoutes()
{ {
return $this->routes; return $this->routes;
} }
/** /**
* Map a pattern to a callable. * Maps a pattern to a callable.
* *
* You can optionally specify HTTP methods that should be matched. * You can optionally specify HTTP methods that should be matched.
* *
...@@ -105,7 +105,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -105,7 +105,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Map a GET request to a callable. * Maps a GET request to a callable.
* *
* @param string $pattern Matched route pattern * @param string $pattern Matched route pattern
* @param mixed $to Callback that returns the response when matched * @param mixed $to Callback that returns the response when matched
...@@ -118,7 +118,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -118,7 +118,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Map a POST request to a callable. * Maps a POST request to a callable.
* *
* @param string $pattern Matched route pattern * @param string $pattern Matched route pattern
* @param mixed $to Callback that returns the response when matched * @param mixed $to Callback that returns the response when matched
...@@ -131,7 +131,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -131,7 +131,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Map a PUT request to a callable. * Maps a PUT request to a callable.
* *
* @param string $pattern Matched route pattern * @param string $pattern Matched route pattern
* @param mixed $to Callback that returns the response when matched * @param mixed $to Callback that returns the response when matched
...@@ -144,7 +144,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -144,7 +144,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Map a DELETE request to a callable. * Maps a DELETE request to a callable.
* *
* @param string $pattern Matched route pattern * @param string $pattern Matched route pattern
* @param mixed $to Callback that returns the response when matched * @param mixed $to Callback that returns the response when matched
...@@ -157,7 +157,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -157,7 +157,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Register a before filter. * Registers a before filter.
* *
* Before filters are run before any route has been matched. * Before filters are run before any route has been matched.
* *
...@@ -175,7 +175,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -175,7 +175,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Register an after filter. * Registers an after filter.
* *
* After filters are run after the controller has been executed. * After filters are run after the controller has been executed.
* *
...@@ -193,7 +193,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -193,7 +193,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Register an error handler. * Registers an error handler.
* *
* Error handlers are simple callables which take a single Exception * Error handlers are simple callables which take a single Exception
* as an argument. If a controller throws an exception, an error handler * as an argument. If a controller throws an exception, an error handler
...@@ -226,7 +226,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -226,7 +226,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Flush the controller collection. * Flushes the controller collection.
*/ */
public function flush() public function flush()
{ {
...@@ -234,7 +234,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -234,7 +234,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Handle the request and deliver the response. * Handles the request and deliver the response.
* *
* @param Request $request Request to process * @param Request $request Request to process
*/ */
...@@ -248,7 +248,7 @@ class Application extends HttpKernel implements EventSubscriberInterface ...@@ -248,7 +248,7 @@ class Application extends HttpKernel implements EventSubscriberInterface
} }
/** /**
* Handler for onCoreRequest. * Handles onCoreRequest events.
*/ */
public function onCoreRequest(KernelEvent $event) public function onCoreRequest(KernelEvent $event)
{ {
......
...@@ -37,7 +37,7 @@ class Controller ...@@ -37,7 +37,7 @@ class Controller
} }
/** /**
* Get the controller's route. * Gets the controller's route.
*/ */
public function getRoute() public function getRoute()
{ {
...@@ -45,7 +45,7 @@ class Controller ...@@ -45,7 +45,7 @@ class Controller
} }
/** /**
* Get the controller's route name. * Gets the controller's route name.
*/ */
public function getRouteName() public function getRouteName()
{ {
...@@ -53,7 +53,7 @@ class Controller ...@@ -53,7 +53,7 @@ class Controller
} }
/** /**
* Set the controller's route. * Sets the controller's route.
* *
* @param string $routeName * @param string $routeName
*/ */
...@@ -67,7 +67,7 @@ class Controller ...@@ -67,7 +67,7 @@ class Controller
} }
/** /**
* Freeze the controller. * Freezes the controller.
* *
* Once the controller is frozen, you can no longer change the route name * Once the controller is frozen, you can no longer change the route name
*/ */
......
...@@ -33,7 +33,7 @@ class ControllerCollection ...@@ -33,7 +33,7 @@ class ControllerCollection
} }
/** /**
* Add a controller to the staging area. * Adds a controller to the staging area.
* *
* @param Controller $controller * @param Controller $controller
*/ */
...@@ -43,7 +43,7 @@ class ControllerCollection ...@@ -43,7 +43,7 @@ class ControllerCollection
} }
/** /**
* Persist and freeze staged controllers. * Persists and freezes staged controllers.
*/ */
public function flush() public function flush()
{ {
......
...@@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response; ...@@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response;
class StringResponseConverter class StringResponseConverter
{ {
/** /**
* Do the conversion * Does the conversion
* *
* @param $response The response string * @param $response The response string
* @return A response object * @return A response object
......
...@@ -35,7 +35,7 @@ abstract class WebTestCase extends BaseWebTestCase ...@@ -35,7 +35,7 @@ abstract class WebTestCase extends BaseWebTestCase
} }
/** /**
* Create the application (HttpKernel, most likely Framework). * Creates the application (HttpKernel, most likely Framework).
* *
* @return Symfony\Component\HttpKernel\HttpKernel * @return Symfony\Component\HttpKernel\HttpKernel
*/ */
......
...@@ -70,16 +70,16 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase ...@@ -70,16 +70,16 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($request, $application->getRequest()); $this->assertEquals($request, $application->getRequest());
} }
public function testGetRouteCollectionWithNoRoutes() public function testgetRoutesWithNoRoutes()
{ {
$application = new Application(); $application = new Application();
$routes = $application->getRouteCollection(); $routes = $application->getRoutes();
$this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes); $this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes);
$this->assertEquals(0, count($routes->all())); $this->assertEquals(0, count($routes->all()));
} }
public function testGetRouteCollectionWithRoutes() public function testgetRoutesWithRoutes()
{ {
$application = new Application(); $application = new Application();
...@@ -91,7 +91,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase ...@@ -91,7 +91,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
return 'bar'; return 'bar';
}); });
$routes = $application->getRouteCollection(); $routes = $application->getRoutes();
$this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes); $this->assertInstanceOf('Symfony\Component\Routing\RouteCollection', $routes);
$this->assertEquals(0, count($routes->all())); $this->assertEquals(0, count($routes->all()));
$application->flush(); $application->flush();
......
...@@ -35,7 +35,7 @@ class FunctionalTest extends \PHPUnit_Framework_TestCase ...@@ -35,7 +35,7 @@ class FunctionalTest extends \PHPUnit_Framework_TestCase
->setRouteName('foo_abc'); ->setRouteName('foo_abc');
$application->flush(); $application->flush();
$routes = $application->getRouteCollection(); $routes = $application->getRoutes();
$this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('homepage')); $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('homepage'));
$this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('foo_abc')); $this->assertInstanceOf('Symfony\Component\Routing\Route', $routes->get('foo_abc'));
} }
......
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