Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -11,25 +11,25 @@
namespace Symfony\Component\HttpKernel\DataCollector;
use Symfony\Component\Debug\Exception\FlattenException;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* ExceptionDataCollector.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @final
*/
class ExceptionDataCollector extends DataCollector
{
/**
* {@inheritdoc}
*/
public function collect(Request $request, Response $response, \Exception $exception = null)
public function collect(Request $request, Response $response, \Throwable $exception = null)
{
if (null !== $exception) {
$this->data = [
'exception' => FlattenException::create($exception),
'exception' => FlattenException::createFromThrowable($exception),
];
}
}
@@ -42,62 +42,35 @@ class ExceptionDataCollector extends DataCollector
$this->data = [];
}
/**
* Checks if the exception is not null.
*
* @return bool true if the exception is not null, false otherwise
*/
public function hasException()
public function hasException(): bool
{
return isset($this->data['exception']);
}
/**
* Gets the exception.
*
* @return \Exception The exception
* @return \Exception|FlattenException
*/
public function getException()
{
return $this->data['exception'];
}
/**
* Gets the exception message.
*
* @return string The exception message
*/
public function getMessage()
public function getMessage(): string
{
return $this->data['exception']->getMessage();
}
/**
* Gets the exception code.
*
* @return int The exception code
*/
public function getCode()
public function getCode(): int
{
return $this->data['exception']->getCode();
}
/**
* Gets the status code.
*
* @return int The status code
*/
public function getStatusCode()
public function getStatusCode(): int
{
return $this->data['exception']->getStatusCode();
}
/**
* Gets the exception trace.
*
* @return array The exception trace
*/
public function getTrace()
public function getTrace(): array
{
return $this->data['exception']->getTrace();
}
@@ -105,7 +78,7 @@ class ExceptionDataCollector extends DataCollector
/**
* {@inheritdoc}
*/
public function getName()
public function getName(): string
{
return 'exception';
}