made some cosmetic changes

This commit is contained in:
Fabien Potencier 2011-12-21 18:34:44 +01:00
parent 0038d1bac4
commit e44b8ba521
4 changed files with 6 additions and 6 deletions

View File

@ -147,11 +147,11 @@ class HttpKernel extends BaseHttpKernel
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %s).', $request->getUri(), $response->getStatusCode()));
}
if ($response instanceof StreamedResponse) {
$response->sendContent();
} else {
if (!$response instanceof StreamedResponse) {
return $response->getContent();
}
$response->sendContent();
} catch (\Exception $e) {
if ($options['alt']) {
$alt = $options['alt'];

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\HttpFoundation;
/**
* StreamedResponse represents a streamed HTTP response.
*
* A StreamedResponse uses a callback for its the content.
* A StreamedResponse uses a callback for its content.
*
* The callback should use the standard PHP functions like echo
* to stream the response back to the client. The flush() method

View File

@ -49,7 +49,7 @@ interface EngineInterface
/**
* Streams a template.
*
* The implementation should outputs the content directly to the client.
* The implementation should output the content directly to the client.
*
* @param mixed $name A template name or a TemplateReferenceInterface instance
* @param array $parameters An array of parameters to pass to the template

View File

@ -84,6 +84,6 @@ class StreamedResponseTest extends \PHPUnit_Framework_TestCase
public function testGetContent()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$this->assertEquals(false, $response->getContent());
$this->assertFalse($response->getContent());
}
}