updated composer
This commit is contained in:
10
vendor/symfony/error-handler/BufferingLogger.php
vendored
10
vendor/symfony/error-handler/BufferingLogger.php
vendored
@@ -35,6 +35,16 @@ class BufferingLogger extends AbstractLogger
|
||||
return $logs;
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot serialize '.__CLASS__);
|
||||
}
|
||||
|
||||
public function __wakeup()
|
||||
{
|
||||
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
foreach ($this->logs as [$level, $message, $context]) {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace Symfony\Component\ErrorHandler;
|
||||
|
||||
use Composer\InstalledVersions;
|
||||
use Doctrine\Common\Persistence\Proxy as LegacyProxy;
|
||||
use Doctrine\Persistence\Proxy;
|
||||
use Mockery\MockInterface;
|
||||
@@ -67,10 +68,11 @@ class DebugClassLoader
|
||||
'string' => 'string',
|
||||
'self' => 'self',
|
||||
'parent' => 'parent',
|
||||
'mixed' => 'mixed',
|
||||
] + (\PHP_VERSION_ID >= 80000 ? [
|
||||
'static' => 'static',
|
||||
'$this' => 'static',
|
||||
] : [
|
||||
'mixed' => 'mixed',
|
||||
'static' => 'object',
|
||||
'$this' => 'object',
|
||||
]);
|
||||
@@ -231,8 +233,8 @@ class DebugClassLoader
|
||||
public static function enable(): void
|
||||
{
|
||||
// Ensures we don't hit https://bugs.php.net/42098
|
||||
class_exists('Symfony\Component\ErrorHandler\ErrorHandler');
|
||||
class_exists('Psr\Log\LogLevel');
|
||||
class_exists(\Symfony\Component\ErrorHandler\ErrorHandler::class);
|
||||
class_exists(\Psr\Log\LogLevel::class);
|
||||
|
||||
if (!\is_array($functions = spl_autoload_functions())) {
|
||||
return;
|
||||
@@ -490,6 +492,14 @@ class DebugClassLoader
|
||||
self::$method[$class] = self::$method[$use];
|
||||
}
|
||||
} elseif (!$refl->isInterface()) {
|
||||
if (!strncmp($vendor, str_replace('_', '\\', $use), $vendorLen)
|
||||
&& 0 === strpos($className, 'Symfony\\')
|
||||
&& (!class_exists(InstalledVersions::class)
|
||||
|| 'symfony/symfony' !== InstalledVersions::getRootPackage()['name'])
|
||||
) {
|
||||
// skip "same vendor" @method deprecations for Symfony\* classes unless symfony/symfony is being tested
|
||||
continue;
|
||||
}
|
||||
$hasCall = $refl->hasMethod('__call');
|
||||
$hasStaticCall = $refl->hasMethod('__callStatic');
|
||||
foreach (self::$method[$use] as $method) {
|
||||
@@ -533,7 +543,7 @@ class DebugClassLoader
|
||||
if (null !== (self::INTERNAL_TYPES[$use] ?? null)) {
|
||||
foreach (self::INTERNAL_TYPES[$use] as $method => $returnType) {
|
||||
if ('void' !== $returnType) {
|
||||
self::$returnTypes[$class] += [$method => [$returnType, $returnType, $class, '']];
|
||||
self::$returnTypes[$class] += [$method => [$returnType, $returnType, $use, '']];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -610,7 +620,7 @@ class DebugClassLoader
|
||||
$this->patchMethod($method, $returnType, $declaringFile, $normalizedType);
|
||||
}
|
||||
|
||||
if (strncmp($ns, $declaringClass, $len)) {
|
||||
if (false === strpos($doc, '* @deprecated') && strncmp($ns, $declaringClass, $len)) {
|
||||
if ($canAddReturnType && 'docblock' === $this->patchTypes['force'] && false === strpos($method->getFileName(), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) {
|
||||
$this->patchMethod($method, $returnType, $declaringFile, $normalizedType);
|
||||
} elseif ('' !== $declaringClass && $this->patchTypes['deprecations']) {
|
||||
|
||||
@@ -33,8 +33,7 @@ class FatalError extends \Error
|
||||
}
|
||||
}
|
||||
} elseif (null !== $traceOffset) {
|
||||
if (\function_exists('xdebug_get_function_stack')) {
|
||||
$trace = xdebug_get_function_stack();
|
||||
if (\function_exists('xdebug_get_function_stack') && $trace = @xdebug_get_function_stack()) {
|
||||
if (0 < $traceOffset) {
|
||||
array_splice($trace, -$traceOffset);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class UndefinedMethodErrorEnhancer implements ErrorEnhancerInterface
|
||||
|
||||
$message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $className);
|
||||
|
||||
if (!class_exists($className) || null === $methods = get_class_methods($className)) {
|
||||
if ('' === $methodName || !class_exists($className) || null === $methods = get_class_methods($className)) {
|
||||
// failed to get the class or its methods on which an unknown method was called (for example on an anonymous class)
|
||||
return new UndefinedMethodError($message, $error);
|
||||
}
|
||||
|
||||
27
vendor/symfony/error-handler/ErrorHandler.php
vendored
27
vendor/symfony/error-handler/ErrorHandler.php
vendored
@@ -187,7 +187,7 @@ class ErrorHandler
|
||||
$this->bootstrappingLogger = $bootstrappingLogger;
|
||||
$this->setDefaultLogger($bootstrappingLogger);
|
||||
}
|
||||
$traceReflector = new \ReflectionProperty('Exception', 'trace');
|
||||
$traceReflector = new \ReflectionProperty(\Exception::class, 'trace');
|
||||
$traceReflector->setAccessible(true);
|
||||
$this->configureException = \Closure::bind(static function ($e, $trace, $file = null, $line = null) use ($traceReflector) {
|
||||
$traceReflector->setValue($e, $trace);
|
||||
@@ -428,11 +428,7 @@ class ErrorHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
if (false !== strpos($message, "@anonymous\0")) {
|
||||
$logMessage = $this->parseAnonymousClass($message);
|
||||
} else {
|
||||
$logMessage = $this->levels[$type].': '.$message;
|
||||
}
|
||||
$logMessage = $this->levels[$type].': '.$message;
|
||||
|
||||
if (null !== self::$toStringException) {
|
||||
$errorAsException = self::$toStringException;
|
||||
@@ -461,6 +457,23 @@ class ErrorHandler
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (false !== strpos($message, '@anonymous')) {
|
||||
$backtrace = debug_backtrace(false, 5);
|
||||
|
||||
for ($i = 1; isset($backtrace[$i]); ++$i) {
|
||||
if (isset($backtrace[$i]['function'], $backtrace[$i]['args'][0])
|
||||
&& ('trigger_error' === $backtrace[$i]['function'] || 'user_error' === $backtrace[$i]['function'])
|
||||
) {
|
||||
if ($backtrace[$i]['args'][0] !== $message) {
|
||||
$message = $this->parseAnonymousClass($backtrace[$i]['args'][0]);
|
||||
$logMessage = $this->levels[$type].': '.$message;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$errorAsException = new \ErrorException($logMessage, 0, $type, $file, $line);
|
||||
|
||||
if ($throw || $this->tracedErrors & $type) {
|
||||
@@ -665,7 +678,7 @@ class ErrorHandler
|
||||
if ($error && $error['type'] &= \E_PARSE | \E_ERROR | \E_CORE_ERROR | \E_COMPILE_ERROR) {
|
||||
// Let's not throw anymore but keep logging
|
||||
$handler->throwAt(0, true);
|
||||
$trace = isset($error['backtrace']) ? $error['backtrace'] : null;
|
||||
$trace = $error['backtrace'] ?? null;
|
||||
|
||||
if (0 === strpos($error['message'], 'Allowed memory') || 0 === strpos($error['message'], 'Out of memory')) {
|
||||
$fatalError = new OutOfMemoryError($handler->levels[$error['type']].': '.$error['message'], 0, $error, 2, false, $trace);
|
||||
|
||||
@@ -352,7 +352,7 @@ class HtmlErrorRenderer implements ErrorRendererInterface
|
||||
extract($context, \EXTR_SKIP);
|
||||
ob_start();
|
||||
|
||||
include file_exists($name) ? $name : __DIR__.'/../Resources/'.$name;
|
||||
include is_file(\dirname(__DIR__).'/Resources/'.$name) ? \dirname(__DIR__).'/Resources/'.$name : $name;
|
||||
|
||||
return trim(ob_get_clean());
|
||||
}
|
||||
|
||||
@@ -24,17 +24,40 @@ use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
*/
|
||||
class FlattenException
|
||||
{
|
||||
/** @var string */
|
||||
private $message;
|
||||
|
||||
/** @var int|string */
|
||||
private $code;
|
||||
|
||||
/** @var self|null */
|
||||
private $previous;
|
||||
|
||||
/** @var array */
|
||||
private $trace;
|
||||
|
||||
/** @var string */
|
||||
private $traceAsString;
|
||||
|
||||
/** @var string */
|
||||
private $class;
|
||||
|
||||
/** @var int */
|
||||
private $statusCode;
|
||||
|
||||
/** @var string */
|
||||
private $statusText;
|
||||
|
||||
/** @var array */
|
||||
private $headers;
|
||||
|
||||
/** @var string */
|
||||
private $file;
|
||||
|
||||
/** @var int */
|
||||
private $line;
|
||||
|
||||
/** @var string|null */
|
||||
private $asString;
|
||||
|
||||
/**
|
||||
@@ -108,6 +131,8 @@ class FlattenException
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatusCode($code): self
|
||||
@@ -138,6 +163,8 @@ class FlattenException
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setClass($class): self
|
||||
@@ -153,6 +180,8 @@ class FlattenException
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $file
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setFile($file): self
|
||||
@@ -168,6 +197,8 @@ class FlattenException
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $line
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine($line): self
|
||||
@@ -195,6 +226,8 @@ class FlattenException
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setMessage($message): self
|
||||
@@ -219,6 +252,8 @@ class FlattenException
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|string $code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCode($code): self
|
||||
@@ -273,6 +308,10 @@ class FlattenException
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $trace
|
||||
* @param string|null $file
|
||||
* @param int|null $line
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setTrace($trace, $file, $line): self
|
||||
@@ -300,11 +339,11 @@ class FlattenException
|
||||
$this->trace[] = [
|
||||
'namespace' => $namespace,
|
||||
'short_class' => $class,
|
||||
'class' => isset($entry['class']) ? $entry['class'] : '',
|
||||
'type' => isset($entry['type']) ? $entry['type'] : '',
|
||||
'function' => isset($entry['function']) ? $entry['function'] : null,
|
||||
'file' => isset($entry['file']) ? $entry['file'] : null,
|
||||
'line' => isset($entry['line']) ? $entry['line'] : null,
|
||||
'class' => $entry['class'] ?? '',
|
||||
'type' => $entry['type'] ?? '',
|
||||
'function' => $entry['function'] ?? null,
|
||||
'file' => $entry['file'] ?? null,
|
||||
'line' => $entry['line'] ?? null,
|
||||
'args' => isset($entry['args']) ? $this->flattenArgs($entry['args']) : [],
|
||||
];
|
||||
}
|
||||
@@ -320,7 +359,6 @@ class FlattenException
|
||||
return ['array', '*SKIPPED over 10000 entries*'];
|
||||
}
|
||||
if ($value instanceof \__PHP_Incomplete_Class) {
|
||||
// is_object() returns false on PHP<=7.1
|
||||
$result[$key] = ['incomplete-object', $this->getClassNameFromIncomplete($value)];
|
||||
} elseif (\is_object($value)) {
|
||||
$result[$key] = ['object', \get_class($value)];
|
||||
|
||||
2
vendor/symfony/error-handler/LICENSE
vendored
2
vendor/symfony/error-handler/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2019-2020 Fabien Potencier
|
||||
Copyright (c) 2019-2021 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
);
|
||||
</script>
|
||||
|
||||
<?php if (class_exists('Symfony\Component\HttpKernel\Kernel')) { ?>
|
||||
<?php if (class_exists(\Symfony\Component\HttpKernel\Kernel::class)) { ?>
|
||||
<header>
|
||||
<div class="container">
|
||||
<h1 class="logo"><?= $this->include('assets/images/symfony-logo.svg'); ?> Symfony Exception</h1>
|
||||
|
||||
2
vendor/symfony/error-handler/composer.json
vendored
2
vendor/symfony/error-handler/composer.json
vendored
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "symfony/error-handler",
|
||||
"type": "library",
|
||||
"description": "Symfony ErrorHandler Component",
|
||||
"description": "Provides tools to manage errors and ease debugging PHP code",
|
||||
"keywords": [],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
|
||||
Reference in New Issue
Block a user