Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8717d44

Browse filesBrowse files
committed
moved a test in the constructor
1 parent e44b8ba commit 8717d44
Copy full SHA for 8717d44

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎src/Symfony/Component/HttpFoundation/StreamedResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/StreamedResponse.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public function __construct($callback, $status = 200, $headers = array())
4545
parent::__construct(null, $status, $headers);
4646

4747
$this->callback = $callback;
48+
if (!is_callable($this->callback)) {
49+
throw new \LogicException('The Response callback must be a valid PHP callable.');
50+
}
51+
4852
$this->streamed = false;
4953
}
5054

@@ -76,10 +80,6 @@ public function sendContent()
7680

7781
$this->streamed = true;
7882

79-
if (!is_callable($this->callback)) {
80-
throw new \LogicException('The Response callback is not a valid PHP callable.');
81-
}
82-
8383
call_user_func($this->callback);
8484
}
8585

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.