Skip to content

Commit

Permalink
Allow File instance to be passed to BinaryFileResponse
Browse files Browse the repository at this point in the history
  • Loading branch information
anlutro committed Apr 28, 2014
1 parent 37a4876 commit fc04ad2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
Expand Up @@ -81,7 +81,9 @@ public static function create($file = null, $status = 200, $headers = array(), $
*/
public function setFile($file, $contentDisposition = null, $autoEtag = false, $autoLastModified = true)
{
$file = new File((string) $file);
if (!$file instanceof File) {
$file = new File((string) $file);
}

if (!$file->isReadable()) {
throw new FileException('File must be readable.');
Expand Down

0 comments on commit fc04ad2

Please sign in to comment.