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

@@ -91,7 +91,7 @@ class ErrorHandler
private $tracedErrors = 0x77FB; // E_ALL - E_STRICT - E_PARSE
private $screamedErrors = 0x55; // E_ERROR + E_CORE_ERROR + E_COMPILE_ERROR + E_PARSE
private $loggedErrors = 0;
private $traceReflector;
private $configureException;
private $debug;
private $isRecursive = 0;
@@ -187,8 +187,14 @@ class ErrorHandler
$this->bootstrappingLogger = $bootstrappingLogger;
$this->setDefaultLogger($bootstrappingLogger);
}
$this->traceReflector = new \ReflectionProperty('Exception', 'trace');
$this->traceReflector->setAccessible(true);
$traceReflector = new \ReflectionProperty('Exception', 'trace');
$traceReflector->setAccessible(true);
$this->configureException = \Closure::bind(static function ($e, $trace, $file = null, $line = null) use ($traceReflector) {
$traceReflector->setValue($e, $trace);
$e->file = $file ?? $e->file;
$e->line = $line ?? $e->line;
}, null, new class() extends \Exception {
});
$this->debug = $debug;
}
@@ -460,9 +466,9 @@ class ErrorHandler
if ($throw || $this->tracedErrors & $type) {
$backtrace = $errorAsException->getTrace();
$lightTrace = $this->cleanTrace($backtrace, $type, $file, $line, $throw);
$this->traceReflector->setValue($errorAsException, $lightTrace);
($this->configureException)($errorAsException, $lightTrace, $file, $line);
} else {
$this->traceReflector->setValue($errorAsException, []);
($this->configureException)($errorAsException, []);
$backtrace = [];
}
}
@@ -725,7 +731,7 @@ class ErrorHandler
/**
* Cleans the trace by removing function arguments and the frames added by the error handler and DebugClassLoader.
*/
private function cleanTrace(array $backtrace, int $type, string $file, int $line, bool $throw): array
private function cleanTrace(array $backtrace, int $type, string &$file, int &$line, bool $throw): array
{
$lightTrace = $backtrace;
@@ -735,6 +741,19 @@ class ErrorHandler
break;
}
}
if (\E_USER_DEPRECATED === $type) {
for ($i = 0; isset($lightTrace[$i]); ++$i) {
if (!isset($lightTrace[$i]['file'], $lightTrace[$i]['line'], $lightTrace[$i]['function'])) {
continue;
}
if (!isset($lightTrace[$i]['class']) && 'trigger_deprecation' === $lightTrace[$i]['function']) {
$file = $lightTrace[$i]['file'];
$line = $lightTrace[$i]['line'];
$lightTrace = \array_slice($lightTrace, 1 + $i);
break;
}
}
}
if (class_exists(DebugClassLoader::class, false)) {
for ($i = \count($lightTrace) - 2; 0 < $i; --$i) {
if (DebugClassLoader::class === ($lightTrace[$i]['class'] ?? null)) {