made some cosmetic changes
This commit is contained in:
parent
0038d1bac4
commit
e44b8ba521
@ -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'];
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user