Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
made some cosmetic changes
  • Loading branch information
fabpot committed Dec 21, 2011
commit e44b8ba521e60f4b0c8218a65415c001090520da
6 changes: 3 additions & 3 deletions src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ public function render($controller, array $options = array())
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'];
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/StreamedResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* 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
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Templating/EngineInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function render($name, array $parameters = array());
/**
* 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ public function testSetContent()
public function testGetContent()
{
$response = new StreamedResponse(function () { echo 'foo'; });
$this->assertEquals(false, $response->getContent());
$this->assertFalse($response->getContent());
}
}