upgrade to laravel 7 and set branch to v2
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace Illuminate\Http;
|
||||
|
||||
use Exception;
|
||||
use Symfony\Component\HttpFoundation\HeaderBag;
|
||||
use Illuminate\Http\Exceptions\HttpResponseException;
|
||||
use Symfony\Component\HttpFoundation\HeaderBag;
|
||||
use Throwable;
|
||||
|
||||
trait ResponseTrait
|
||||
{
|
||||
@@ -18,7 +18,7 @@ trait ResponseTrait
|
||||
/**
|
||||
* The exception that triggered the error response (if applicable).
|
||||
*
|
||||
* @var \Exception|null
|
||||
* @var \Throwable|null
|
||||
*/
|
||||
public $exception;
|
||||
|
||||
@@ -59,7 +59,7 @@ trait ResponseTrait
|
||||
*
|
||||
* @param string $key
|
||||
* @param array|string $values
|
||||
* @param bool $replace
|
||||
* @param bool $replace
|
||||
* @return $this
|
||||
*/
|
||||
public function header($key, $values, $replace = true)
|
||||
@@ -96,7 +96,7 @@ trait ResponseTrait
|
||||
*/
|
||||
public function cookie($cookie)
|
||||
{
|
||||
return call_user_func_array([$this, 'withCookie'], func_get_args());
|
||||
return $this->withCookie(...func_get_args());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,7 +108,7 @@ trait ResponseTrait
|
||||
public function withCookie($cookie)
|
||||
{
|
||||
if (is_string($cookie) && function_exists('cookie')) {
|
||||
$cookie = call_user_func_array('cookie', func_get_args());
|
||||
$cookie = cookie(...func_get_args());
|
||||
}
|
||||
|
||||
$this->headers->setCookie($cookie);
|
||||
@@ -129,10 +129,10 @@ trait ResponseTrait
|
||||
/**
|
||||
* Set the exception to attach to the response.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @param \Throwable $e
|
||||
* @return $this
|
||||
*/
|
||||
public function withException(Exception $e)
|
||||
public function withException(Throwable $e)
|
||||
{
|
||||
$this->exception = $e;
|
||||
|
||||
@@ -142,6 +142,8 @@ trait ResponseTrait
|
||||
/**
|
||||
* Throws the response in a HttpResponseException instance.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \Illuminate\Http\Exceptions\HttpResponseException
|
||||
*/
|
||||
public function throwResponse()
|
||||
|
||||
Reference in New Issue
Block a user