upgrade to laravel 7 and set branch to v2

This commit is contained in:
2020-12-25 11:22:15 +00:00
parent 516105c492
commit 0ddd298350
4638 changed files with 132501 additions and 190226 deletions

View File

@@ -11,8 +11,6 @@
namespace Symfony\Component\ErrorHandler\Exception;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Symfony\Component\Debug\Exception\FlattenException as LegacyFlattenException;
use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
@@ -24,7 +22,7 @@ use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class FlattenException extends LegacyFlattenException
class FlattenException
{
private $message;
private $code;
@@ -39,11 +37,17 @@ class FlattenException extends LegacyFlattenException
private $line;
private $asString;
/**
* @return static
*/
public static function create(\Exception $exception, $statusCode = null, array $headers = []): self
{
return static::createFromThrowable($exception, $statusCode, $headers);
}
/**
* @return static
*/
public static function createFromThrowable(\Throwable $exception, int $statusCode = null, array $headers = []): self
{
$e = new static();
@@ -71,7 +75,7 @@ class FlattenException extends LegacyFlattenException
$e->setStatusCode($statusCode);
$e->setHeaders($headers);
$e->setTraceFromThrowable($exception);
$e->setClass($exception instanceof FatalThrowableError ? $exception->getOriginalClassName() : get_debug_type($exception));
$e->setClass(get_debug_type($exception));
$e->setFile($exception->getFile());
$e->setLine($exception->getLine());
@@ -224,10 +228,7 @@ class FlattenException extends LegacyFlattenException
return $this;
}
/**
* @return self|null
*/
public function getPrevious()
public function getPrevious(): ?self
{
return $this->previous;
}
@@ -235,7 +236,7 @@ class FlattenException extends LegacyFlattenException
/**
* @return $this
*/
final public function setPrevious(LegacyFlattenException $previous): self
public function setPrevious(self $previous): self
{
$this->previous = $previous;
@@ -261,16 +262,6 @@ class FlattenException extends LegacyFlattenException
return $this->trace;
}
/**
* @deprecated since 4.1, use {@see setTraceFromThrowable()} instead.
*/
public function setTraceFromException(\Exception $exception)
{
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use "setTraceFromThrowable()" instead.', __METHOD__), \E_USER_DEPRECATED);
$this->setTraceFromThrowable($exception);
}
/**
* @return $this
*/