* @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);
* 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;
}