Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / http-foundation / StreamedResponse.php
index 8be624436c1ba6e2b02da0b6cdf5faf5221383a3..928531309ad0a5bcf7beaa6da9dc4639b320d327 100644 (file)
@@ -37,7 +37,7 @@ class StreamedResponse extends Response
      * @param int           $status   The response status code
      * @param array         $headers  An array of response headers
      */
-    public function __construct($callback = null, $status = 200, $headers = array())
+    public function __construct(callable $callback = null, $status = 200, $headers = array())
     {
         parent::__construct(null, $status, $headers);
 
@@ -66,14 +66,9 @@ class StreamedResponse extends Response
      * Sets the PHP callback associated with this Response.
      *
      * @param callable $callback A valid PHP callback
-     *
-     * @throws \LogicException
      */
-    public function setCallback($callback)
+    public function setCallback(callable $callback)
     {
-        if (!is_callable($callback)) {
-            throw new \LogicException('The Response callback must be a valid PHP callable.');
-        }
         $this->callback = $callback;
     }