From 31cefc642b0ea7f17916171301845606e77d5906 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 25 Apr 2013 07:52:12 +0200 Subject: [PATCH] made some small tweaks --- UPGRADE-2.3.md | 8 ---- src/Symfony/Bundle/FrameworkBundle/Client.php | 6 ++- src/Symfony/Component/BrowserKit/CHANGELOG.md | 4 -- src/Symfony/Component/BrowserKit/Client.php | 38 ++++++++++--------- src/Symfony/Component/HttpKernel/Client.php | 8 ++-- 5 files changed, 30 insertions(+), 34 deletions(-) diff --git a/UPGRADE-2.3.md b/UPGRADE-2.3.md index 82fc6fa155..445e460a05 100644 --- a/UPGRADE-2.3.md +++ b/UPGRADE-2.3.md @@ -184,11 +184,3 @@ DomCrawler return $crawler->text(); }); ``` - -BrowserKit ----------- - - * The `Symfony\Component\BrowserKit\Client::getResponse()/getRequest()` - methods now **always** return the request/response instance from the code - that handles the request. To get the BrowserKit request/response instances, - use the new `getInternalResponse()/getInternalRequest()` methods. diff --git a/src/Symfony/Bundle/FrameworkBundle/Client.php b/src/Symfony/Bundle/FrameworkBundle/Client.php index 52efc80619..1819649769 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Client.php +++ b/src/Symfony/Bundle/FrameworkBundle/Client.php @@ -85,7 +85,7 @@ class Client extends BaseClient } /** - * Makes a request. + * {@inheritdoc} * * @param Request $request A Request instance * @@ -113,6 +113,10 @@ class Client extends BaseClient /** * {@inheritdoc} + * + * @param Request $request A Request instance + * + * @return Response A Response instance */ protected function doRequestInProcess($request) { diff --git a/src/Symfony/Component/BrowserKit/CHANGELOG.md b/src/Symfony/Component/BrowserKit/CHANGELOG.md index 92885eadcd..f67099bdbe 100644 --- a/src/Symfony/Component/BrowserKit/CHANGELOG.md +++ b/src/Symfony/Component/BrowserKit/CHANGELOG.md @@ -6,10 +6,6 @@ CHANGELOG * added `Client::getInternalRequest()` and `Client::getInternalResponse()` to have access to the BrowserKit internal request and response objects - * [BC BREAK] The `Symfony\Component\HttpKernel\Client::getRequest()` method now - returns the request instance created by the client - * [BC BREAK] The `Symfony\Component\HttpKernel\Client::request()` method now - always returns the response instance created by the client 2.1.0 ----- diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php index 0e63f75cf5..39945740b0 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -158,7 +158,7 @@ abstract class Client /** * Returns the current Crawler instance. * - * @return Crawler A Crawler instance + * @return Crawler|null A Crawler instance * * @api */ @@ -168,9 +168,9 @@ abstract class Client } /** - * Returns the current Response instance. + * Returns the current BrowserKit Response instance. * - * @return Response A Response instance + * @return Response|null A BrowserKit Response instance * * @api */ @@ -180,12 +180,14 @@ abstract class Client } /** - * Returns the origin response instance. + * Returns the current origin response instance. * * The origin response is the response instance that is returned * by the code that handles requests. * - * @return object A response instance + * @return object|null A response instance + * + * @see doRequest * * @api */ @@ -195,9 +197,9 @@ abstract class Client } /** - * Returns the current Request instance. + * Returns the current BrowserKit Request instance. * - * @return Request A Request instance + * @return Request|null A BrowserKit Request instance * * @api */ @@ -207,14 +209,16 @@ abstract class Client } /** - * Returns the origin Request instance. + * Returns the current origin Request instance. * * The origin request is the request instance that is sent * to the code that handles requests. * - * @api + * @return object|null A Request instance * - * @return object A Request instance + * @see doRequest + * + * @api */ public function getRequest() { @@ -343,7 +347,7 @@ abstract class Client /** * Returns the script to execute when the request must be insulated. * - * @param Request $request A Request instance + * @param object $request An origin request instance * * @throws \LogicException When this abstract class is not implemented */ @@ -355,11 +359,11 @@ abstract class Client } /** - * Filters the request. + * Filters the BrowserKit request to the origin one. * - * @param Request $request The request to filter + * @param Request $request The BrowserKit Request to filter * - * @return Request + * @return object An origin request instance */ protected function filterRequest(Request $request) { @@ -367,11 +371,11 @@ abstract class Client } /** - * Filters the Response. + * Filters the origin response to the BrowserKit one. * - * @param Response $response The Response to filter + * @param object $response The origin response to filter * - * @return Response + * @return Response An BrowserKit Response instance */ protected function filterResponse($response) { diff --git a/src/Symfony/Component/HttpKernel/Client.php b/src/Symfony/Component/HttpKernel/Client.php index 217623bc31..bb427b35af 100644 --- a/src/Symfony/Component/HttpKernel/Client.php +++ b/src/Symfony/Component/HttpKernel/Client.php @@ -53,7 +53,7 @@ class Client extends BaseClient /** * {@inheritdoc} * - * @return Request A Request instance + * @return Request|null A Request instance */ public function getRequest() { @@ -63,7 +63,7 @@ class Client extends BaseClient /** * {@inheritdoc} * - * @return Response A Response instance + * @return Response|null A Response instance */ public function getResponse() { @@ -121,7 +121,7 @@ EOF; /** * Converts the BrowserKit request to a HttpKernel request. * - * @param DomRequest $request A Request instance + * @param DomRequest $request A DomRequest instance * * @return Request A Request instance */ @@ -188,7 +188,7 @@ EOF; * * @param Response $response A Response instance * - * @return Response A Response instance + * @return DomResponse A DomResponse instance */ protected function filterResponse($response) {