Navigation Menu

Skip to content

Commit

Permalink
made some small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Apr 25, 2013
1 parent 84ca34b commit 31cefc6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 34 deletions.
8 changes: 0 additions & 8 deletions UPGRADE-2.3.md
Expand Up @@ -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.
6 changes: 5 additions & 1 deletion src/Symfony/Bundle/FrameworkBundle/Client.php
Expand Up @@ -85,7 +85,7 @@ public function enableProfiler()
}

/**
* Makes a request.
* {@inheritdoc}
*
* @param Request $request A Request instance
*
Expand Down Expand Up @@ -113,6 +113,10 @@ protected function doRequest($request)

/**
* {@inheritdoc}
*
* @param Request $request A Request instance
*
* @return Response A Response instance
*/
protected function doRequestInProcess($request)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Symfony/Component/BrowserKit/CHANGELOG.md
Expand Up @@ -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
-----
Expand Down
38 changes: 21 additions & 17 deletions src/Symfony/Component/BrowserKit/Client.php
Expand Up @@ -158,7 +158,7 @@ public function getCookieJar()
/**
* Returns the current Crawler instance.
*
* @return Crawler A Crawler instance
* @return Crawler|null A Crawler instance
*
* @api
*/
Expand All @@ -168,9 +168,9 @@ public function getCrawler()
}

/**
* Returns the current Response instance.
* Returns the current BrowserKit Response instance.
*
* @return Response A Response instance
* @return Response|null A BrowserKit Response instance
*
* @api
*/
Expand All @@ -180,12 +180,14 @@ public function getInternalResponse()
}

/**
* 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
*/
Expand All @@ -195,9 +197,9 @@ public function getResponse()
}

/**
* Returns the current Request instance.
* Returns the current BrowserKit Request instance.
*
* @return Request A Request instance
* @return Request|null A BrowserKit Request instance
*
* @api
*/
Expand All @@ -207,14 +209,16 @@ public function getInternalRequest()
}

/**
* 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
*
* @see doRequest
*
* @return object A Request instance
* @api
*/
public function getRequest()
{
Expand Down Expand Up @@ -343,7 +347,7 @@ abstract protected function doRequest($request);
/**
* 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
*/
Expand All @@ -355,23 +359,23 @@ protected function getScript($request)
}

/**
* 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)
{
return $request;
}

/**
* 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)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpKernel/Client.php
Expand Up @@ -53,7 +53,7 @@ public function __construct(HttpKernelInterface $kernel, array $server = array()
/**
* {@inheritdoc}
*
* @return Request A Request instance
* @return Request|null A Request instance
*/
public function getRequest()
{
Expand All @@ -63,7 +63,7 @@ public function getRequest()
/**
* {@inheritdoc}
*
* @return Response A Response instance
* @return Response|null A Response instance
*/
public function getResponse()
{
Expand Down Expand Up @@ -121,7 +121,7 @@ protected function getScript($request)
/**
* 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
*/
Expand Down Expand Up @@ -188,7 +188,7 @@ protected function filterFiles(array $files)
*
* @param Response $response A Response instance
*
* @return Response A Response instance
* @return DomResponse A DomResponse instance
*/
protected function filterResponse($response)
{
Expand Down

0 comments on commit 31cefc6

Please sign in to comment.