Ajout des vendor
71
vendor/symfony/error-handler/BufferingLogger.php
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler;
|
||||
|
||||
use Psr\Log\AbstractLogger;
|
||||
|
||||
/**
|
||||
* A buffering logger that stacks logs for later.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class BufferingLogger extends AbstractLogger
|
||||
{
|
||||
private $logs = [];
|
||||
|
||||
public function log($level, $message, array $context = []): void
|
||||
{
|
||||
$this->logs[] = [$level, $message, $context];
|
||||
}
|
||||
|
||||
public function cleanLogs(): array
|
||||
{
|
||||
$logs = $this->logs;
|
||||
$this->logs = [];
|
||||
|
||||
return $logs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
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]) {
|
||||
if (false !== strpos($message, '{')) {
|
||||
foreach ($context as $key => $val) {
|
||||
if (null === $val || is_scalar($val) || (\is_object($val) && \is_callable([$val, '__toString']))) {
|
||||
$message = str_replace("{{$key}}", $val, $message);
|
||||
} elseif ($val instanceof \DateTimeInterface) {
|
||||
$message = str_replace("{{$key}}", $val->format(\DateTime::RFC3339), $message);
|
||||
} elseif (\is_object($val)) {
|
||||
$message = str_replace("{{$key}}", '[object '.\get_class($val).']', $message);
|
||||
} else {
|
||||
$message = str_replace("{{$key}}", '['.\gettype($val).']', $message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
error_log(sprintf('%s [%s] %s', date(\DateTime::RFC3339), $level, $message));
|
||||
}
|
||||
}
|
||||
}
|
24
vendor/symfony/error-handler/CHANGELOG.md
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
5.4
|
||||
---
|
||||
|
||||
* Make `DebugClassLoader` trigger deprecation notices on missing return types
|
||||
* Add `SYMFONY_PATCH_TYPE_DECLARATIONS='force=2'` mode to `DebugClassLoader` to turn annotations into native return types
|
||||
|
||||
5.2.0
|
||||
-----
|
||||
|
||||
* added the ability to set `HtmlErrorRenderer::$template` to a custom template to render when not in debug mode.
|
||||
|
||||
5.1.0
|
||||
-----
|
||||
|
||||
* The `HtmlErrorRenderer` and `SerializerErrorRenderer` add `X-Debug-Exception` and `X-Debug-Exception-File` headers in debug mode.
|
||||
|
||||
4.4.0
|
||||
-----
|
||||
|
||||
* added the component
|
||||
* added `ErrorHandler::call()` method utility to turn any PHP error into `\ErrorException`
|
41
vendor/symfony/error-handler/Debug.php
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler;
|
||||
|
||||
/**
|
||||
* Registers all the debug tools.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class Debug
|
||||
{
|
||||
public static function enable(): ErrorHandler
|
||||
{
|
||||
error_reporting(-1);
|
||||
|
||||
if (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true)) {
|
||||
ini_set('display_errors', 0);
|
||||
} elseif (!filter_var(ini_get('log_errors'), \FILTER_VALIDATE_BOOLEAN) || ini_get('error_log')) {
|
||||
// CLI - display errors only if they're not already logged to STDERR
|
||||
ini_set('display_errors', 1);
|
||||
}
|
||||
|
||||
@ini_set('zend.assertions', 1);
|
||||
ini_set('assert.active', 1);
|
||||
ini_set('assert.warning', 0);
|
||||
ini_set('assert.exception', 1);
|
||||
|
||||
DebugClassLoader::enable();
|
||||
|
||||
return ErrorHandler::register(new ErrorHandler(new BufferingLogger(), true));
|
||||
}
|
||||
}
|
1210
vendor/symfony/error-handler/DebugClassLoader.php
vendored
Normal file
@ -0,0 +1,1210 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler;
|
||||
|
||||
use Composer\InstalledVersions;
|
||||
use Doctrine\Common\Persistence\Proxy as LegacyProxy;
|
||||
use Doctrine\Persistence\Proxy;
|
||||
use Mockery\MockInterface;
|
||||
use Phake\IMock;
|
||||
use PHPUnit\Framework\MockObject\Matcher\StatelessInvocation;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Prophecy\Prophecy\ProphecySubjectInterface;
|
||||
use ProxyManager\Proxy\ProxyInterface;
|
||||
use Symfony\Component\ErrorHandler\Internal\TentativeTypes;
|
||||
|
||||
/**
|
||||
* Autoloader checking if the class is really defined in the file found.
|
||||
*
|
||||
* The ClassLoader will wrap all registered autoloaders
|
||||
* and will throw an exception if a file is found but does
|
||||
* not declare the class.
|
||||
*
|
||||
* It can also patch classes to turn docblocks into actual return types.
|
||||
* This behavior is controlled by the SYMFONY_PATCH_TYPE_DECLARATIONS env var,
|
||||
* which is a url-encoded array with the follow parameters:
|
||||
* - "force": any value enables deprecation notices - can be any of:
|
||||
* - "phpdoc" to patch only docblock annotations
|
||||
* - "2" to add all possible return types
|
||||
* - "1" to add return types but only to tests/final/internal/private methods
|
||||
* - "php": the target version of PHP - e.g. "7.1" doesn't generate "object" types
|
||||
* - "deprecations": "1" to trigger a deprecation notice when a child class misses a
|
||||
* return type while the parent declares an "@return" annotation
|
||||
*
|
||||
* Note that patching doesn't care about any coding style so you'd better to run
|
||||
* php-cs-fixer after, with rules "phpdoc_trim_consecutive_blank_line_separation"
|
||||
* and "no_superfluous_phpdoc_tags" enabled typically.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Christophe Coevoet <stof@notk.org>
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
* @author Guilhem Niot <guilhem.niot@gmail.com>
|
||||
*/
|
||||
class DebugClassLoader
|
||||
{
|
||||
private const SPECIAL_RETURN_TYPES = [
|
||||
'void' => 'void',
|
||||
'null' => 'null',
|
||||
'resource' => 'resource',
|
||||
'boolean' => 'bool',
|
||||
'true' => 'bool',
|
||||
'false' => 'false',
|
||||
'integer' => 'int',
|
||||
'array' => 'array',
|
||||
'bool' => 'bool',
|
||||
'callable' => 'callable',
|
||||
'float' => 'float',
|
||||
'int' => 'int',
|
||||
'iterable' => 'iterable',
|
||||
'object' => 'object',
|
||||
'string' => 'string',
|
||||
'self' => 'self',
|
||||
'parent' => 'parent',
|
||||
'mixed' => 'mixed',
|
||||
'static' => 'static',
|
||||
'$this' => 'static',
|
||||
'list' => 'array',
|
||||
];
|
||||
|
||||
private const BUILTIN_RETURN_TYPES = [
|
||||
'void' => true,
|
||||
'array' => true,
|
||||
'false' => true,
|
||||
'bool' => true,
|
||||
'callable' => true,
|
||||
'float' => true,
|
||||
'int' => true,
|
||||
'iterable' => true,
|
||||
'object' => true,
|
||||
'string' => true,
|
||||
'self' => true,
|
||||
'parent' => true,
|
||||
'mixed' => true,
|
||||
'static' => true,
|
||||
];
|
||||
|
||||
private const MAGIC_METHODS = [
|
||||
'__isset' => 'bool',
|
||||
'__sleep' => 'array',
|
||||
'__toString' => 'string',
|
||||
'__debugInfo' => 'array',
|
||||
'__serialize' => 'array',
|
||||
];
|
||||
|
||||
private $classLoader;
|
||||
private $isFinder;
|
||||
private $loaded = [];
|
||||
private $patchTypes;
|
||||
|
||||
private static $caseCheck;
|
||||
private static $checkedClasses = [];
|
||||
private static $final = [];
|
||||
private static $finalMethods = [];
|
||||
private static $deprecated = [];
|
||||
private static $internal = [];
|
||||
private static $internalMethods = [];
|
||||
private static $annotatedParameters = [];
|
||||
private static $darwinCache = ['/' => ['/', []]];
|
||||
private static $method = [];
|
||||
private static $returnTypes = [];
|
||||
private static $methodTraits = [];
|
||||
private static $fileOffsets = [];
|
||||
|
||||
public function __construct(callable $classLoader)
|
||||
{
|
||||
$this->classLoader = $classLoader;
|
||||
$this->isFinder = \is_array($classLoader) && method_exists($classLoader[0], 'findFile');
|
||||
parse_str(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?: '', $this->patchTypes);
|
||||
$this->patchTypes += [
|
||||
'force' => null,
|
||||
'php' => \PHP_MAJOR_VERSION.'.'.\PHP_MINOR_VERSION,
|
||||
'deprecations' => \PHP_VERSION_ID >= 70400,
|
||||
];
|
||||
|
||||
if ('phpdoc' === $this->patchTypes['force']) {
|
||||
$this->patchTypes['force'] = 'docblock';
|
||||
}
|
||||
|
||||
if (!isset(self::$caseCheck)) {
|
||||
$file = is_file(__FILE__) ? __FILE__ : rtrim(realpath('.'), \DIRECTORY_SEPARATOR);
|
||||
$i = strrpos($file, \DIRECTORY_SEPARATOR);
|
||||
$dir = substr($file, 0, 1 + $i);
|
||||
$file = substr($file, 1 + $i);
|
||||
$test = strtoupper($file) === $file ? strtolower($file) : strtoupper($file);
|
||||
$test = realpath($dir.$test);
|
||||
|
||||
if (false === $test || false === $i) {
|
||||
// filesystem is case sensitive
|
||||
self::$caseCheck = 0;
|
||||
} elseif (substr($test, -\strlen($file)) === $file) {
|
||||
// filesystem is case insensitive and realpath() normalizes the case of characters
|
||||
self::$caseCheck = 1;
|
||||
} elseif ('Darwin' === \PHP_OS_FAMILY) {
|
||||
// on MacOSX, HFS+ is case insensitive but realpath() doesn't normalize the case of characters
|
||||
self::$caseCheck = 2;
|
||||
} else {
|
||||
// filesystem case checks failed, fallback to disabling them
|
||||
self::$caseCheck = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getClassLoader(): callable
|
||||
{
|
||||
return $this->classLoader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wraps all autoloaders.
|
||||
*/
|
||||
public static function enable(): void
|
||||
{
|
||||
// Ensures we don't hit https://bugs.php.net/42098
|
||||
class_exists(\Symfony\Component\ErrorHandler\ErrorHandler::class);
|
||||
class_exists(\Psr\Log\LogLevel::class);
|
||||
|
||||
if (!\is_array($functions = spl_autoload_functions())) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($functions as $function) {
|
||||
spl_autoload_unregister($function);
|
||||
}
|
||||
|
||||
foreach ($functions as $function) {
|
||||
if (!\is_array($function) || !$function[0] instanceof self) {
|
||||
$function = [new static($function), 'loadClass'];
|
||||
}
|
||||
|
||||
spl_autoload_register($function);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the wrapping.
|
||||
*/
|
||||
public static function disable(): void
|
||||
{
|
||||
if (!\is_array($functions = spl_autoload_functions())) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($functions as $function) {
|
||||
spl_autoload_unregister($function);
|
||||
}
|
||||
|
||||
foreach ($functions as $function) {
|
||||
if (\is_array($function) && $function[0] instanceof self) {
|
||||
$function = $function[0]->getClassLoader();
|
||||
}
|
||||
|
||||
spl_autoload_register($function);
|
||||
}
|
||||
}
|
||||
|
||||
public static function checkClasses(): bool
|
||||
{
|
||||
if (!\is_array($functions = spl_autoload_functions())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$loader = null;
|
||||
|
||||
foreach ($functions as $function) {
|
||||
if (\is_array($function) && $function[0] instanceof self) {
|
||||
$loader = $function[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (null === $loader) {
|
||||
return false;
|
||||
}
|
||||
|
||||
static $offsets = [
|
||||
'get_declared_interfaces' => 0,
|
||||
'get_declared_traits' => 0,
|
||||
'get_declared_classes' => 0,
|
||||
];
|
||||
|
||||
foreach ($offsets as $getSymbols => $i) {
|
||||
$symbols = $getSymbols();
|
||||
|
||||
for (; $i < \count($symbols); ++$i) {
|
||||
if (!is_subclass_of($symbols[$i], MockObject::class)
|
||||
&& !is_subclass_of($symbols[$i], ProphecySubjectInterface::class)
|
||||
&& !is_subclass_of($symbols[$i], Proxy::class)
|
||||
&& !is_subclass_of($symbols[$i], ProxyInterface::class)
|
||||
&& !is_subclass_of($symbols[$i], LegacyProxy::class)
|
||||
&& !is_subclass_of($symbols[$i], MockInterface::class)
|
||||
&& !is_subclass_of($symbols[$i], IMock::class)
|
||||
) {
|
||||
$loader->checkClass($symbols[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
$offsets[$getSymbols] = $i;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function findFile(string $class): ?string
|
||||
{
|
||||
return $this->isFinder ? ($this->classLoader[0]->findFile($class) ?: null) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
*/
|
||||
public function loadClass(string $class): void
|
||||
{
|
||||
$e = error_reporting(error_reporting() | \E_PARSE | \E_ERROR | \E_CORE_ERROR | \E_COMPILE_ERROR);
|
||||
|
||||
try {
|
||||
if ($this->isFinder && !isset($this->loaded[$class])) {
|
||||
$this->loaded[$class] = true;
|
||||
if (!$file = $this->classLoader[0]->findFile($class) ?: '') {
|
||||
// no-op
|
||||
} elseif (\function_exists('opcache_is_script_cached') && @opcache_is_script_cached($file)) {
|
||||
include $file;
|
||||
|
||||
return;
|
||||
} elseif (false === include $file) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
($this->classLoader)($class);
|
||||
$file = '';
|
||||
}
|
||||
} finally {
|
||||
error_reporting($e);
|
||||
}
|
||||
|
||||
$this->checkClass($class, $file);
|
||||
}
|
||||
|
||||
private function checkClass(string $class, string $file = null): void
|
||||
{
|
||||
$exists = null === $file || class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
|
||||
|
||||
if (null !== $file && $class && '\\' === $class[0]) {
|
||||
$class = substr($class, 1);
|
||||
}
|
||||
|
||||
if ($exists) {
|
||||
if (isset(self::$checkedClasses[$class])) {
|
||||
return;
|
||||
}
|
||||
self::$checkedClasses[$class] = true;
|
||||
|
||||
$refl = new \ReflectionClass($class);
|
||||
if (null === $file && $refl->isInternal()) {
|
||||
return;
|
||||
}
|
||||
$name = $refl->getName();
|
||||
|
||||
if ($name !== $class && 0 === strcasecmp($name, $class)) {
|
||||
throw new \RuntimeException(sprintf('Case mismatch between loaded and declared class names: "%s" vs "%s".', $class, $name));
|
||||
}
|
||||
|
||||
$deprecations = $this->checkAnnotations($refl, $name);
|
||||
|
||||
foreach ($deprecations as $message) {
|
||||
@trigger_error($message, \E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$file) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$exists) {
|
||||
if (false !== strpos($class, '/')) {
|
||||
throw new \RuntimeException(sprintf('Trying to autoload a class with an invalid name "%s". Be careful that the namespace separator is "\" in PHP, not "/".', $class));
|
||||
}
|
||||
|
||||
throw new \RuntimeException(sprintf('The autoloader expected class "%s" to be defined in file "%s". The file was found but the class was not in it, the class name or namespace probably has a typo.', $class, $file));
|
||||
}
|
||||
|
||||
if (self::$caseCheck && $message = $this->checkCase($refl, $file, $class)) {
|
||||
throw new \RuntimeException(sprintf('Case mismatch between class and real file names: "%s" vs "%s" in "%s".', $message[0], $message[1], $message[2]));
|
||||
}
|
||||
}
|
||||
|
||||
public function checkAnnotations(\ReflectionClass $refl, string $class): array
|
||||
{
|
||||
if (
|
||||
'Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV7' === $class
|
||||
|| 'Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerForV6' === $class
|
||||
) {
|
||||
return [];
|
||||
}
|
||||
$deprecations = [];
|
||||
|
||||
$className = false !== strpos($class, "@anonymous\0") ? (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous' : $class;
|
||||
|
||||
// Don't trigger deprecations for classes in the same vendor
|
||||
if ($class !== $className) {
|
||||
$vendor = preg_match('/^namespace ([^;\\\\\s]++)[;\\\\]/m', @file_get_contents($refl->getFileName()), $vendor) ? $vendor[1].'\\' : '';
|
||||
$vendorLen = \strlen($vendor);
|
||||
} elseif (2 > $vendorLen = 1 + (strpos($class, '\\') ?: strpos($class, '_'))) {
|
||||
$vendorLen = 0;
|
||||
$vendor = '';
|
||||
} else {
|
||||
$vendor = str_replace('_', '\\', substr($class, 0, $vendorLen));
|
||||
}
|
||||
|
||||
$parent = get_parent_class($class) ?: null;
|
||||
self::$returnTypes[$class] = [];
|
||||
$classIsTemplate = false;
|
||||
|
||||
// Detect annotations on the class
|
||||
if ($doc = $this->parsePhpDoc($refl)) {
|
||||
$classIsTemplate = isset($doc['template']);
|
||||
|
||||
foreach (['final', 'deprecated', 'internal'] as $annotation) {
|
||||
if (null !== $description = $doc[$annotation][0] ?? null) {
|
||||
self::${$annotation}[$class] = '' !== $description ? ' '.$description.(preg_match('/[.!]$/', $description) ? '' : '.') : '.';
|
||||
}
|
||||
}
|
||||
|
||||
if ($refl->isInterface() && isset($doc['method'])) {
|
||||
foreach ($doc['method'] as $name => [$static, $returnType, $signature, $description]) {
|
||||
self::$method[$class][] = [$class, $static, $returnType, $name.$signature, $description];
|
||||
|
||||
if ('' !== $returnType) {
|
||||
$this->setReturnType($returnType, $refl->name, $name, $refl->getFileName(), $parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$parentAndOwnInterfaces = $this->getOwnInterfaces($class, $parent);
|
||||
if ($parent) {
|
||||
$parentAndOwnInterfaces[$parent] = $parent;
|
||||
|
||||
if (!isset(self::$checkedClasses[$parent])) {
|
||||
$this->checkClass($parent);
|
||||
}
|
||||
|
||||
if (isset(self::$final[$parent])) {
|
||||
$deprecations[] = sprintf('The "%s" class is considered final%s It may change without further notice as of its next major version. You should not extend it from "%s".', $parent, self::$final[$parent], $className);
|
||||
}
|
||||
}
|
||||
|
||||
// Detect if the parent is annotated
|
||||
foreach ($parentAndOwnInterfaces + class_uses($class, false) as $use) {
|
||||
if (!isset(self::$checkedClasses[$use])) {
|
||||
$this->checkClass($use);
|
||||
}
|
||||
if (isset(self::$deprecated[$use]) && strncmp($vendor, str_replace('_', '\\', $use), $vendorLen) && !isset(self::$deprecated[$class])) {
|
||||
$type = class_exists($class, false) ? 'class' : (interface_exists($class, false) ? 'interface' : 'trait');
|
||||
$verb = class_exists($use, false) || interface_exists($class, false) ? 'extends' : (interface_exists($use, false) ? 'implements' : 'uses');
|
||||
|
||||
$deprecations[] = sprintf('The "%s" %s %s "%s" that is deprecated%s', $className, $type, $verb, $use, self::$deprecated[$use]);
|
||||
}
|
||||
if (isset(self::$internal[$use]) && strncmp($vendor, str_replace('_', '\\', $use), $vendorLen)) {
|
||||
$deprecations[] = sprintf('The "%s" %s is considered internal%s It may change without further notice. You should not use it from "%s".', $use, class_exists($use, false) ? 'class' : (interface_exists($use, false) ? 'interface' : 'trait'), self::$internal[$use], $className);
|
||||
}
|
||||
if (isset(self::$method[$use])) {
|
||||
if ($refl->isAbstract()) {
|
||||
if (isset(self::$method[$class])) {
|
||||
self::$method[$class] = array_merge(self::$method[$class], self::$method[$use]);
|
||||
} else {
|
||||
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 [$interface, $static, $returnType, $name, $description]) {
|
||||
if ($static ? $hasStaticCall : $hasCall) {
|
||||
continue;
|
||||
}
|
||||
$realName = substr($name, 0, strpos($name, '('));
|
||||
if (!$refl->hasMethod($realName) || !($methodRefl = $refl->getMethod($realName))->isPublic() || ($static && !$methodRefl->isStatic()) || (!$static && $methodRefl->isStatic())) {
|
||||
$deprecations[] = sprintf('Class "%s" should implement method "%s::%s%s"%s', $className, ($static ? 'static ' : '').$interface, $name, $returnType ? ': '.$returnType : '', null === $description ? '.' : ': '.$description);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (trait_exists($class)) {
|
||||
$file = $refl->getFileName();
|
||||
|
||||
foreach ($refl->getMethods() as $method) {
|
||||
if ($method->getFileName() === $file) {
|
||||
self::$methodTraits[$file][$method->getStartLine()] = $class;
|
||||
}
|
||||
}
|
||||
|
||||
return $deprecations;
|
||||
}
|
||||
|
||||
// Inherit @final, @internal, @param and @return annotations for methods
|
||||
self::$finalMethods[$class] = [];
|
||||
self::$internalMethods[$class] = [];
|
||||
self::$annotatedParameters[$class] = [];
|
||||
foreach ($parentAndOwnInterfaces as $use) {
|
||||
foreach (['finalMethods', 'internalMethods', 'annotatedParameters', 'returnTypes'] as $property) {
|
||||
if (isset(self::${$property}[$use])) {
|
||||
self::${$property}[$class] = self::${$property}[$class] ? self::${$property}[$use] + self::${$property}[$class] : self::${$property}[$use];
|
||||
}
|
||||
}
|
||||
|
||||
if (null !== (TentativeTypes::RETURN_TYPES[$use] ?? null)) {
|
||||
foreach (TentativeTypes::RETURN_TYPES[$use] as $method => $returnType) {
|
||||
$returnType = explode('|', $returnType);
|
||||
foreach ($returnType as $i => $t) {
|
||||
if ('?' !== $t && !isset(self::BUILTIN_RETURN_TYPES[$t])) {
|
||||
$returnType[$i] = '\\'.$t;
|
||||
}
|
||||
}
|
||||
$returnType = implode('|', $returnType);
|
||||
|
||||
self::$returnTypes[$class] += [$method => [$returnType, 0 === strpos($returnType, '?') ? substr($returnType, 1).'|null' : $returnType, $use, '']];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($refl->getMethods() as $method) {
|
||||
if ($method->class !== $class) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (null === $ns = self::$methodTraits[$method->getFileName()][$method->getStartLine()] ?? null) {
|
||||
$ns = $vendor;
|
||||
$len = $vendorLen;
|
||||
} elseif (2 > $len = 1 + (strpos($ns, '\\') ?: strpos($ns, '_'))) {
|
||||
$len = 0;
|
||||
$ns = '';
|
||||
} else {
|
||||
$ns = str_replace('_', '\\', substr($ns, 0, $len));
|
||||
}
|
||||
|
||||
if ($parent && isset(self::$finalMethods[$parent][$method->name])) {
|
||||
[$declaringClass, $message] = self::$finalMethods[$parent][$method->name];
|
||||
$deprecations[] = sprintf('The "%s::%s()" method is considered final%s It may change without further notice as of its next major version. You should not extend it from "%s".', $declaringClass, $method->name, $message, $className);
|
||||
}
|
||||
|
||||
if (isset(self::$internalMethods[$class][$method->name])) {
|
||||
[$declaringClass, $message] = self::$internalMethods[$class][$method->name];
|
||||
if (strncmp($ns, $declaringClass, $len)) {
|
||||
$deprecations[] = sprintf('The "%s::%s()" method is considered internal%s It may change without further notice. You should not extend it from "%s".', $declaringClass, $method->name, $message, $className);
|
||||
}
|
||||
}
|
||||
|
||||
// To read method annotations
|
||||
$doc = $this->parsePhpDoc($method);
|
||||
|
||||
if (($classIsTemplate || isset($doc['template'])) && $method->hasReturnType()) {
|
||||
unset($doc['return']);
|
||||
}
|
||||
|
||||
if (isset(self::$annotatedParameters[$class][$method->name])) {
|
||||
$definedParameters = [];
|
||||
foreach ($method->getParameters() as $parameter) {
|
||||
$definedParameters[$parameter->name] = true;
|
||||
}
|
||||
|
||||
foreach (self::$annotatedParameters[$class][$method->name] as $parameterName => $deprecation) {
|
||||
if (!isset($definedParameters[$parameterName]) && !isset($doc['param'][$parameterName])) {
|
||||
$deprecations[] = sprintf($deprecation, $className);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$forcePatchTypes = $this->patchTypes['force'];
|
||||
|
||||
if ($canAddReturnType = null !== $forcePatchTypes && false === strpos($method->getFileName(), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) {
|
||||
if ('void' !== (self::MAGIC_METHODS[$method->name] ?? 'void')) {
|
||||
$this->patchTypes['force'] = $forcePatchTypes ?: 'docblock';
|
||||
}
|
||||
|
||||
$canAddReturnType = 2 === (int) $forcePatchTypes
|
||||
|| false !== stripos($method->getFileName(), \DIRECTORY_SEPARATOR.'Tests'.\DIRECTORY_SEPARATOR)
|
||||
|| $refl->isFinal()
|
||||
|| $method->isFinal()
|
||||
|| $method->isPrivate()
|
||||
|| ('.' === (self::$internal[$class] ?? null) && !$refl->isAbstract())
|
||||
|| '.' === (self::$final[$class] ?? null)
|
||||
|| '' === ($doc['final'][0] ?? null)
|
||||
|| '' === ($doc['internal'][0] ?? null)
|
||||
;
|
||||
}
|
||||
|
||||
if (null !== ($returnType = self::$returnTypes[$class][$method->name] ?? null) && 'docblock' === $this->patchTypes['force'] && !$method->hasReturnType() && isset(TentativeTypes::RETURN_TYPES[$returnType[2]][$method->name])) {
|
||||
$this->patchReturnTypeWillChange($method);
|
||||
}
|
||||
|
||||
if (null !== ($returnType ?? $returnType = self::MAGIC_METHODS[$method->name] ?? null) && !$method->hasReturnType() && !isset($doc['return'])) {
|
||||
[$normalizedType, $returnType, $declaringClass, $declaringFile] = \is_string($returnType) ? [$returnType, $returnType, '', ''] : $returnType;
|
||||
|
||||
if ($canAddReturnType && 'docblock' !== $this->patchTypes['force']) {
|
||||
$this->patchMethod($method, $returnType, $declaringFile, $normalizedType);
|
||||
}
|
||||
if (!isset($doc['deprecated']) && strncmp($ns, $declaringClass, $len)) {
|
||||
if ('docblock' === $this->patchTypes['force']) {
|
||||
$this->patchMethod($method, $returnType, $declaringFile, $normalizedType);
|
||||
} elseif ('' !== $declaringClass && $this->patchTypes['deprecations']) {
|
||||
$deprecations[] = sprintf('Method "%s::%s()" might add "%s" as a native return type declaration in the future. Do the same in %s "%s" now to avoid errors or add an explicit @return annotation to suppress this message.', $declaringClass, $method->name, $normalizedType, interface_exists($declaringClass) ? 'implementation' : 'child class', $className);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$doc) {
|
||||
$this->patchTypes['force'] = $forcePatchTypes;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isset($doc['return']) || 'void' !== (self::MAGIC_METHODS[$method->name] ?? 'void')) {
|
||||
$this->setReturnType($doc['return'] ?? self::MAGIC_METHODS[$method->name], $method->class, $method->name, $method->getFileName(), $parent, $method->getReturnType());
|
||||
|
||||
if (isset(self::$returnTypes[$class][$method->name][0]) && $canAddReturnType) {
|
||||
$this->fixReturnStatements($method, self::$returnTypes[$class][$method->name][0]);
|
||||
}
|
||||
|
||||
if ($method->isPrivate()) {
|
||||
unset(self::$returnTypes[$class][$method->name]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->patchTypes['force'] = $forcePatchTypes;
|
||||
|
||||
if ($method->isPrivate()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$finalOrInternal = false;
|
||||
|
||||
foreach (['final', 'internal'] as $annotation) {
|
||||
if (null !== $description = $doc[$annotation][0] ?? null) {
|
||||
self::${$annotation.'Methods'}[$class][$method->name] = [$class, '' !== $description ? ' '.$description.(preg_match('/[[:punct:]]$/', $description) ? '' : '.') : '.'];
|
||||
$finalOrInternal = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($finalOrInternal || $method->isConstructor() || !isset($doc['param']) || StatelessInvocation::class === $class) {
|
||||
continue;
|
||||
}
|
||||
if (!isset(self::$annotatedParameters[$class][$method->name])) {
|
||||
$definedParameters = [];
|
||||
foreach ($method->getParameters() as $parameter) {
|
||||
$definedParameters[$parameter->name] = true;
|
||||
}
|
||||
}
|
||||
foreach ($doc['param'] as $parameterName => $parameterType) {
|
||||
if (!isset($definedParameters[$parameterName])) {
|
||||
self::$annotatedParameters[$class][$method->name][$parameterName] = sprintf('The "%%s::%s()" method will require a new "%s$%s" argument in the next major version of its %s "%s", not defining it is deprecated.', $method->name, $parameterType ? $parameterType.' ' : '', $parameterName, interface_exists($className) ? 'interface' : 'parent class', $className);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $deprecations;
|
||||
}
|
||||
|
||||
public function checkCase(\ReflectionClass $refl, string $file, string $class): ?array
|
||||
{
|
||||
$real = explode('\\', $class.strrchr($file, '.'));
|
||||
$tail = explode(\DIRECTORY_SEPARATOR, str_replace('/', \DIRECTORY_SEPARATOR, $file));
|
||||
|
||||
$i = \count($tail) - 1;
|
||||
$j = \count($real) - 1;
|
||||
|
||||
while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
|
||||
--$i;
|
||||
--$j;
|
||||
}
|
||||
|
||||
array_splice($tail, 0, $i + 1);
|
||||
|
||||
if (!$tail) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$tail = \DIRECTORY_SEPARATOR.implode(\DIRECTORY_SEPARATOR, $tail);
|
||||
$tailLen = \strlen($tail);
|
||||
$real = $refl->getFileName();
|
||||
|
||||
if (2 === self::$caseCheck) {
|
||||
$real = $this->darwinRealpath($real);
|
||||
}
|
||||
|
||||
if (0 === substr_compare($real, $tail, -$tailLen, $tailLen, true)
|
||||
&& 0 !== substr_compare($real, $tail, -$tailLen, $tailLen, false)
|
||||
) {
|
||||
return [substr($tail, -$tailLen + 1), substr($real, -$tailLen + 1), substr($real, 0, -$tailLen + 1)];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* `realpath` on MacOSX doesn't normalize the case of characters.
|
||||
*/
|
||||
private function darwinRealpath(string $real): string
|
||||
{
|
||||
$i = 1 + strrpos($real, '/');
|
||||
$file = substr($real, $i);
|
||||
$real = substr($real, 0, $i);
|
||||
|
||||
if (isset(self::$darwinCache[$real])) {
|
||||
$kDir = $real;
|
||||
} else {
|
||||
$kDir = strtolower($real);
|
||||
|
||||
if (isset(self::$darwinCache[$kDir])) {
|
||||
$real = self::$darwinCache[$kDir][0];
|
||||
} else {
|
||||
$dir = getcwd();
|
||||
|
||||
if (!@chdir($real)) {
|
||||
return $real.$file;
|
||||
}
|
||||
|
||||
$real = getcwd().'/';
|
||||
chdir($dir);
|
||||
|
||||
$dir = $real;
|
||||
$k = $kDir;
|
||||
$i = \strlen($dir) - 1;
|
||||
while (!isset(self::$darwinCache[$k])) {
|
||||
self::$darwinCache[$k] = [$dir, []];
|
||||
self::$darwinCache[$dir] = &self::$darwinCache[$k];
|
||||
|
||||
while ('/' !== $dir[--$i]) {
|
||||
}
|
||||
$k = substr($k, 0, ++$i);
|
||||
$dir = substr($dir, 0, $i--);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dirFiles = self::$darwinCache[$kDir][1];
|
||||
|
||||
if (!isset($dirFiles[$file]) && ') : eval()\'d code' === substr($file, -17)) {
|
||||
// Get the file name from "file_name.php(123) : eval()'d code"
|
||||
$file = substr($file, 0, strrpos($file, '(', -17));
|
||||
}
|
||||
|
||||
if (isset($dirFiles[$file])) {
|
||||
return $real.$dirFiles[$file];
|
||||
}
|
||||
|
||||
$kFile = strtolower($file);
|
||||
|
||||
if (!isset($dirFiles[$kFile])) {
|
||||
foreach (scandir($real, 2) as $f) {
|
||||
if ('.' !== $f[0]) {
|
||||
$dirFiles[$f] = $f;
|
||||
if ($f === $file) {
|
||||
$kFile = $k = $file;
|
||||
} elseif ($f !== $k = strtolower($f)) {
|
||||
$dirFiles[$k] = $f;
|
||||
}
|
||||
}
|
||||
}
|
||||
self::$darwinCache[$kDir][1] = $dirFiles;
|
||||
}
|
||||
|
||||
return $real.$dirFiles[$kFile];
|
||||
}
|
||||
|
||||
/**
|
||||
* `class_implements` includes interfaces from the parents so we have to manually exclude them.
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
private function getOwnInterfaces(string $class, ?string $parent): array
|
||||
{
|
||||
$ownInterfaces = class_implements($class, false);
|
||||
|
||||
if ($parent) {
|
||||
foreach (class_implements($parent, false) as $interface) {
|
||||
unset($ownInterfaces[$interface]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($ownInterfaces as $interface) {
|
||||
foreach (class_implements($interface) as $interface) {
|
||||
unset($ownInterfaces[$interface]);
|
||||
}
|
||||
}
|
||||
|
||||
return $ownInterfaces;
|
||||
}
|
||||
|
||||
private function setReturnType(string $types, string $class, string $method, string $filename, ?string $parent, \ReflectionType $returnType = null): void
|
||||
{
|
||||
if ('__construct' === $method) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($nullable = 0 === strpos($types, 'null|')) {
|
||||
$types = substr($types, 5);
|
||||
} elseif ($nullable = '|null' === substr($types, -5)) {
|
||||
$types = substr($types, 0, -5);
|
||||
}
|
||||
$arrayType = ['array' => 'array'];
|
||||
$typesMap = [];
|
||||
$glue = false !== strpos($types, '&') ? '&' : '|';
|
||||
foreach (explode($glue, $types) as $t) {
|
||||
$t = self::SPECIAL_RETURN_TYPES[strtolower($t)] ?? $t;
|
||||
$typesMap[$this->normalizeType($t, $class, $parent, $returnType)][$t] = $t;
|
||||
}
|
||||
|
||||
if (isset($typesMap['array'])) {
|
||||
if (isset($typesMap['Traversable']) || isset($typesMap['\Traversable'])) {
|
||||
$typesMap['iterable'] = $arrayType !== $typesMap['array'] ? $typesMap['array'] : ['iterable'];
|
||||
unset($typesMap['array'], $typesMap['Traversable'], $typesMap['\Traversable']);
|
||||
} elseif ($arrayType !== $typesMap['array'] && isset(self::$returnTypes[$class][$method]) && !$returnType) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($typesMap['array']) && isset($typesMap['iterable'])) {
|
||||
if ($arrayType !== $typesMap['array']) {
|
||||
$typesMap['iterable'] = $typesMap['array'];
|
||||
}
|
||||
unset($typesMap['array']);
|
||||
}
|
||||
|
||||
$iterable = $object = true;
|
||||
foreach ($typesMap as $n => $t) {
|
||||
if ('null' !== $n) {
|
||||
$iterable = $iterable && (\in_array($n, ['array', 'iterable']) || false !== strpos($n, 'Iterator'));
|
||||
$object = $object && (\in_array($n, ['callable', 'object', '$this', 'static']) || !isset(self::SPECIAL_RETURN_TYPES[$n]));
|
||||
}
|
||||
}
|
||||
|
||||
$phpTypes = [];
|
||||
$docTypes = [];
|
||||
|
||||
foreach ($typesMap as $n => $t) {
|
||||
if ('null' === $n) {
|
||||
$nullable = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
$docTypes[] = $t;
|
||||
|
||||
if ('mixed' === $n || 'void' === $n) {
|
||||
$nullable = false;
|
||||
$phpTypes = ['' => $n];
|
||||
continue;
|
||||
}
|
||||
|
||||
if ('resource' === $n) {
|
||||
// there is no native type for "resource"
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isset($phpTypes[''])) {
|
||||
$phpTypes[] = $n;
|
||||
}
|
||||
}
|
||||
$docTypes = array_merge([], ...$docTypes);
|
||||
|
||||
if (!$phpTypes) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (1 < \count($phpTypes)) {
|
||||
if ($iterable && '8.0' > $this->patchTypes['php']) {
|
||||
$phpTypes = $docTypes = ['iterable'];
|
||||
} elseif ($object && 'object' === $this->patchTypes['force']) {
|
||||
$phpTypes = $docTypes = ['object'];
|
||||
} elseif ('8.0' > $this->patchTypes['php']) {
|
||||
// ignore multi-types return declarations
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$phpType = sprintf($nullable ? (1 < \count($phpTypes) ? '%s|null' : '?%s') : '%s', implode($glue, $phpTypes));
|
||||
$docType = sprintf($nullable ? '%s|null' : '%s', implode($glue, $docTypes));
|
||||
|
||||
self::$returnTypes[$class][$method] = [$phpType, $docType, $class, $filename];
|
||||
}
|
||||
|
||||
private function normalizeType(string $type, string $class, ?string $parent, ?\ReflectionType $returnType): string
|
||||
{
|
||||
if (isset(self::SPECIAL_RETURN_TYPES[$lcType = strtolower($type)])) {
|
||||
if ('parent' === $lcType = self::SPECIAL_RETURN_TYPES[$lcType]) {
|
||||
$lcType = null !== $parent ? '\\'.$parent : 'parent';
|
||||
} elseif ('self' === $lcType) {
|
||||
$lcType = '\\'.$class;
|
||||
}
|
||||
|
||||
return $lcType;
|
||||
}
|
||||
|
||||
// We could resolve "use" statements to return the FQDN
|
||||
// but this would be too expensive for a runtime checker
|
||||
|
||||
if ('[]' !== substr($type, -2)) {
|
||||
return $type;
|
||||
}
|
||||
|
||||
if ($returnType instanceof \ReflectionNamedType) {
|
||||
$type = $returnType->getName();
|
||||
|
||||
if ('mixed' !== $type) {
|
||||
return isset(self::SPECIAL_RETURN_TYPES[$type]) ? $type : '\\'.$type;
|
||||
}
|
||||
}
|
||||
|
||||
return 'array';
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to add #[ReturnTypeWillChange] where php triggers deprecations.
|
||||
*/
|
||||
private function patchReturnTypeWillChange(\ReflectionMethod $method)
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 80000 && \count($method->getAttributes(\ReturnTypeWillChange::class))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_file($file = $method->getFileName())) {
|
||||
return;
|
||||
}
|
||||
|
||||
$fileOffset = self::$fileOffsets[$file] ?? 0;
|
||||
|
||||
$code = file($file);
|
||||
|
||||
$startLine = $method->getStartLine() + $fileOffset - 2;
|
||||
|
||||
if (false !== stripos($code[$startLine], 'ReturnTypeWillChange')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$code[$startLine] .= " #[\\ReturnTypeWillChange]\n";
|
||||
self::$fileOffsets[$file] = 1 + $fileOffset;
|
||||
file_put_contents($file, $code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to add @return annotations to the Symfony code-base where it triggers self-deprecations.
|
||||
*/
|
||||
private function patchMethod(\ReflectionMethod $method, string $returnType, string $declaringFile, string $normalizedType)
|
||||
{
|
||||
static $patchedMethods = [];
|
||||
static $useStatements = [];
|
||||
|
||||
if (!is_file($file = $method->getFileName()) || isset($patchedMethods[$file][$startLine = $method->getStartLine()])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$patchedMethods[$file][$startLine] = true;
|
||||
$fileOffset = self::$fileOffsets[$file] ?? 0;
|
||||
$startLine += $fileOffset - 2;
|
||||
if ($nullable = '|null' === substr($returnType, -5)) {
|
||||
$returnType = substr($returnType, 0, -5);
|
||||
}
|
||||
$glue = false !== strpos($returnType, '&') ? '&' : '|';
|
||||
$returnType = explode($glue, $returnType);
|
||||
$code = file($file);
|
||||
|
||||
foreach ($returnType as $i => $type) {
|
||||
if (preg_match('/((?:\[\])+)$/', $type, $m)) {
|
||||
$type = substr($type, 0, -\strlen($m[1]));
|
||||
$format = '%s'.$m[1];
|
||||
} else {
|
||||
$format = null;
|
||||
}
|
||||
|
||||
if (isset(self::SPECIAL_RETURN_TYPES[$type]) || ('\\' === $type[0] && !$p = strrpos($type, '\\', 1))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
[$namespace, $useOffset, $useMap] = $useStatements[$file] ?? $useStatements[$file] = self::getUseStatements($file);
|
||||
|
||||
if ('\\' !== $type[0]) {
|
||||
[$declaringNamespace, , $declaringUseMap] = $useStatements[$declaringFile] ?? $useStatements[$declaringFile] = self::getUseStatements($declaringFile);
|
||||
|
||||
$p = strpos($type, '\\', 1);
|
||||
$alias = $p ? substr($type, 0, $p) : $type;
|
||||
|
||||
if (isset($declaringUseMap[$alias])) {
|
||||
$type = '\\'.$declaringUseMap[$alias].($p ? substr($type, $p) : '');
|
||||
} else {
|
||||
$type = '\\'.$declaringNamespace.$type;
|
||||
}
|
||||
|
||||
$p = strrpos($type, '\\', 1);
|
||||
}
|
||||
|
||||
$alias = substr($type, 1 + $p);
|
||||
$type = substr($type, 1);
|
||||
|
||||
if (!isset($useMap[$alias]) && (class_exists($c = $namespace.$alias) || interface_exists($c) || trait_exists($c))) {
|
||||
$useMap[$alias] = $c;
|
||||
}
|
||||
|
||||
if (!isset($useMap[$alias])) {
|
||||
$useStatements[$file][2][$alias] = $type;
|
||||
$code[$useOffset] = "use $type;\n".$code[$useOffset];
|
||||
++$fileOffset;
|
||||
} elseif ($useMap[$alias] !== $type) {
|
||||
$alias .= 'FIXME';
|
||||
$useStatements[$file][2][$alias] = $type;
|
||||
$code[$useOffset] = "use $type as $alias;\n".$code[$useOffset];
|
||||
++$fileOffset;
|
||||
}
|
||||
|
||||
$returnType[$i] = null !== $format ? sprintf($format, $alias) : $alias;
|
||||
}
|
||||
|
||||
if ('docblock' === $this->patchTypes['force'] || ('object' === $normalizedType && '7.1' === $this->patchTypes['php'])) {
|
||||
$returnType = implode($glue, $returnType).($nullable ? '|null' : '');
|
||||
|
||||
if (false !== strpos($code[$startLine], '#[')) {
|
||||
--$startLine;
|
||||
}
|
||||
|
||||
if ($method->getDocComment()) {
|
||||
$code[$startLine] = " * @return $returnType\n".$code[$startLine];
|
||||
} else {
|
||||
$code[$startLine] .= <<<EOTXT
|
||||
/**
|
||||
* @return $returnType
|
||||
*/
|
||||
|
||||
EOTXT;
|
||||
}
|
||||
|
||||
$fileOffset += substr_count($code[$startLine], "\n") - 1;
|
||||
}
|
||||
|
||||
self::$fileOffsets[$file] = $fileOffset;
|
||||
file_put_contents($file, $code);
|
||||
|
||||
$this->fixReturnStatements($method, $normalizedType);
|
||||
}
|
||||
|
||||
private static function getUseStatements(string $file): array
|
||||
{
|
||||
$namespace = '';
|
||||
$useMap = [];
|
||||
$useOffset = 0;
|
||||
|
||||
if (!is_file($file)) {
|
||||
return [$namespace, $useOffset, $useMap];
|
||||
}
|
||||
|
||||
$file = file($file);
|
||||
|
||||
for ($i = 0; $i < \count($file); ++$i) {
|
||||
if (preg_match('/^(class|interface|trait|abstract) /', $file[$i])) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (0 === strpos($file[$i], 'namespace ')) {
|
||||
$namespace = substr($file[$i], \strlen('namespace '), -2).'\\';
|
||||
$useOffset = $i + 2;
|
||||
}
|
||||
|
||||
if (0 === strpos($file[$i], 'use ')) {
|
||||
$useOffset = $i;
|
||||
|
||||
for (; 0 === strpos($file[$i], 'use '); ++$i) {
|
||||
$u = explode(' as ', substr($file[$i], 4, -2), 2);
|
||||
|
||||
if (1 === \count($u)) {
|
||||
$p = strrpos($u[0], '\\');
|
||||
$useMap[substr($u[0], false !== $p ? 1 + $p : 0)] = $u[0];
|
||||
} else {
|
||||
$useMap[$u[1]] = $u[0];
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return [$namespace, $useOffset, $useMap];
|
||||
}
|
||||
|
||||
private function fixReturnStatements(\ReflectionMethod $method, string $returnType)
|
||||
{
|
||||
if ('docblock' !== $this->patchTypes['force']) {
|
||||
if ('7.1' === $this->patchTypes['php'] && 'object' === ltrim($returnType, '?')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ('7.4' > $this->patchTypes['php'] && $method->hasReturnType()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ('8.0' > $this->patchTypes['php'] && (false !== strpos($returnType, '|') || \in_array($returnType, ['mixed', 'static'], true))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ('8.1' > $this->patchTypes['php'] && false !== strpos($returnType, '&')) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_file($file = $method->getFileName())) {
|
||||
return;
|
||||
}
|
||||
|
||||
$fixedCode = $code = file($file);
|
||||
$i = (self::$fileOffsets[$file] ?? 0) + $method->getStartLine();
|
||||
|
||||
if ('?' !== $returnType && 'docblock' !== $this->patchTypes['force']) {
|
||||
$fixedCode[$i - 1] = preg_replace('/\)(?::[^;\n]++)?(;?\n)/', "): $returnType\\1", $code[$i - 1]);
|
||||
}
|
||||
|
||||
$end = $method->isGenerator() ? $i : $method->getEndLine();
|
||||
for (; $i < $end; ++$i) {
|
||||
if ('void' === $returnType) {
|
||||
$fixedCode[$i] = str_replace(' return null;', ' return;', $code[$i]);
|
||||
} elseif ('mixed' === $returnType || '?' === $returnType[0]) {
|
||||
$fixedCode[$i] = str_replace(' return;', ' return null;', $code[$i]);
|
||||
} else {
|
||||
$fixedCode[$i] = str_replace(' return;', " return $returnType!?;", $code[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($fixedCode !== $code) {
|
||||
file_put_contents($file, $fixedCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \ReflectionClass|\ReflectionMethod|\ReflectionProperty $reflector
|
||||
*/
|
||||
private function parsePhpDoc(\Reflector $reflector): array
|
||||
{
|
||||
if (!$doc = $reflector->getDocComment()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$tagName = '';
|
||||
$tagContent = '';
|
||||
|
||||
$tags = [];
|
||||
|
||||
foreach (explode("\n", substr($doc, 3, -2)) as $line) {
|
||||
$line = ltrim($line);
|
||||
$line = ltrim($line, '*');
|
||||
|
||||
if ('' === $line = trim($line)) {
|
||||
if ('' !== $tagName) {
|
||||
$tags[$tagName][] = $tagContent;
|
||||
}
|
||||
$tagName = $tagContent = '';
|
||||
continue;
|
||||
}
|
||||
|
||||
if ('@' === $line[0]) {
|
||||
if ('' !== $tagName) {
|
||||
$tags[$tagName][] = $tagContent;
|
||||
$tagContent = '';
|
||||
}
|
||||
|
||||
if (preg_match('{^@([-a-zA-Z0-9_:]++)(\s|$)}', $line, $m)) {
|
||||
$tagName = $m[1];
|
||||
$tagContent = str_replace("\t", ' ', ltrim(substr($line, 2 + \strlen($tagName))));
|
||||
} else {
|
||||
$tagName = '';
|
||||
}
|
||||
} elseif ('' !== $tagName) {
|
||||
$tagContent .= ' '.str_replace("\t", ' ', $line);
|
||||
}
|
||||
}
|
||||
|
||||
if ('' !== $tagName) {
|
||||
$tags[$tagName][] = $tagContent;
|
||||
}
|
||||
|
||||
foreach ($tags['method'] ?? [] as $i => $method) {
|
||||
unset($tags['method'][$i]);
|
||||
|
||||
$parts = preg_split('{(\s++|\((?:[^()]*+|(?R))*\)(?: *: *[^ ]++)?|<(?:[^<>]*+|(?R))*>|\{(?:[^{}]*+|(?R))*\})}', $method, -1, \PREG_SPLIT_DELIM_CAPTURE);
|
||||
$returnType = '';
|
||||
$static = 'static' === $parts[0];
|
||||
|
||||
for ($i = $static ? 2 : 0; null !== $p = $parts[$i] ?? null; $i += 2) {
|
||||
if (\in_array($p, ['', '|', '&', 'callable'], true) || \in_array(substr($returnType, -1), ['|', '&'], true)) {
|
||||
$returnType .= trim($parts[$i - 1] ?? '').$p;
|
||||
continue;
|
||||
}
|
||||
|
||||
$signature = '(' === ($parts[$i + 1][0] ?? '(') ? $parts[$i + 1] ?? '()' : null;
|
||||
|
||||
if (null === $signature && '' === $returnType) {
|
||||
$returnType = $p;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($static && 2 === $i) {
|
||||
$static = false;
|
||||
$returnType = 'static';
|
||||
}
|
||||
|
||||
if (\in_array($description = trim(implode('', \array_slice($parts, 2 + $i))), ['', '.'], true)) {
|
||||
$description = null;
|
||||
} elseif (!preg_match('/[.!]$/', $description)) {
|
||||
$description .= '.';
|
||||
}
|
||||
|
||||
$tags['method'][$p] = [$static, $returnType, $signature ?? '()', $description];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($tags['param'] ?? [] as $i => $param) {
|
||||
unset($tags['param'][$i]);
|
||||
|
||||
if (\strlen($param) !== strcspn($param, '<{(')) {
|
||||
$param = preg_replace('{\(([^()]*+|(?R))*\)(?: *: *[^ ]++)?|<([^<>]*+|(?R))*>|\{([^{}]*+|(?R))*\}}', '', $param);
|
||||
}
|
||||
|
||||
if (false === $i = strpos($param, '$')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$type = 0 === $i ? '' : rtrim(substr($param, 0, $i), ' &');
|
||||
$param = substr($param, 1 + $i, (strpos($param, ' ', $i) ?: (1 + $i + \strlen($param))) - $i - 1);
|
||||
|
||||
$tags['param'][$param] = $type;
|
||||
}
|
||||
|
||||
foreach (['var', 'return'] as $k) {
|
||||
if (null === $v = $tags[$k][0] ?? null) {
|
||||
continue;
|
||||
}
|
||||
if (\strlen($v) !== strcspn($v, '<{(')) {
|
||||
$v = preg_replace('{\(([^()]*+|(?R))*\)(?: *: *[^ ]++)?|<([^<>]*+|(?R))*>|\{([^{}]*+|(?R))*\}}', '', $v);
|
||||
}
|
||||
|
||||
$tags[$k] = substr($v, 0, strpos($v, ' ') ?: \strlen($v)) ?: null;
|
||||
}
|
||||
|
||||
return $tags;
|
||||
}
|
||||
}
|
33
vendor/symfony/error-handler/Error/ClassNotFoundError.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Error;
|
||||
|
||||
class ClassNotFoundError extends \Error
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(string $message, \Throwable $previous)
|
||||
{
|
||||
parent::__construct($message, $previous->getCode(), $previous->getPrevious());
|
||||
|
||||
foreach ([
|
||||
'file' => $previous->getFile(),
|
||||
'line' => $previous->getLine(),
|
||||
'trace' => $previous->getTrace(),
|
||||
] as $property => $value) {
|
||||
$refl = new \ReflectionProperty(\Error::class, $property);
|
||||
$refl->setAccessible(true);
|
||||
$refl->setValue($this, $value);
|
||||
}
|
||||
}
|
||||
}
|
89
vendor/symfony/error-handler/Error/FatalError.php
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Error;
|
||||
|
||||
class FatalError extends \Error
|
||||
{
|
||||
private $error;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param array $error An array as returned by error_get_last()
|
||||
*/
|
||||
public function __construct(string $message, int $code, array $error, int $traceOffset = null, bool $traceArgs = true, array $trace = null)
|
||||
{
|
||||
parent::__construct($message, $code);
|
||||
|
||||
$this->error = $error;
|
||||
|
||||
if (null !== $trace) {
|
||||
if (!$traceArgs) {
|
||||
foreach ($trace as &$frame) {
|
||||
unset($frame['args'], $frame['this'], $frame);
|
||||
}
|
||||
}
|
||||
} elseif (null !== $traceOffset) {
|
||||
if (\function_exists('xdebug_get_function_stack') && $trace = @xdebug_get_function_stack()) {
|
||||
if (0 < $traceOffset) {
|
||||
array_splice($trace, -$traceOffset);
|
||||
}
|
||||
|
||||
foreach ($trace as &$frame) {
|
||||
if (!isset($frame['type'])) {
|
||||
// XDebug pre 2.1.1 doesn't currently set the call type key http://bugs.xdebug.org/view.php?id=695
|
||||
if (isset($frame['class'])) {
|
||||
$frame['type'] = '::';
|
||||
}
|
||||
} elseif ('dynamic' === $frame['type']) {
|
||||
$frame['type'] = '->';
|
||||
} elseif ('static' === $frame['type']) {
|
||||
$frame['type'] = '::';
|
||||
}
|
||||
|
||||
// XDebug also has a different name for the parameters array
|
||||
if (!$traceArgs) {
|
||||
unset($frame['params'], $frame['args']);
|
||||
} elseif (isset($frame['params']) && !isset($frame['args'])) {
|
||||
$frame['args'] = $frame['params'];
|
||||
unset($frame['params']);
|
||||
}
|
||||
}
|
||||
|
||||
unset($frame);
|
||||
$trace = array_reverse($trace);
|
||||
} else {
|
||||
$trace = [];
|
||||
}
|
||||
}
|
||||
|
||||
foreach ([
|
||||
'file' => $error['file'],
|
||||
'line' => $error['line'],
|
||||
'trace' => $trace,
|
||||
] as $property => $value) {
|
||||
if (null !== $value) {
|
||||
$refl = new \ReflectionProperty(\Error::class, $property);
|
||||
$refl->setAccessible(true);
|
||||
$refl->setValue($this, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getError(): array
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
}
|
16
vendor/symfony/error-handler/Error/OutOfMemoryError.php
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Error;
|
||||
|
||||
class OutOfMemoryError extends FatalError
|
||||
{
|
||||
}
|
33
vendor/symfony/error-handler/Error/UndefinedFunctionError.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Error;
|
||||
|
||||
class UndefinedFunctionError extends \Error
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(string $message, \Throwable $previous)
|
||||
{
|
||||
parent::__construct($message, $previous->getCode(), $previous->getPrevious());
|
||||
|
||||
foreach ([
|
||||
'file' => $previous->getFile(),
|
||||
'line' => $previous->getLine(),
|
||||
'trace' => $previous->getTrace(),
|
||||
] as $property => $value) {
|
||||
$refl = new \ReflectionProperty(\Error::class, $property);
|
||||
$refl->setAccessible(true);
|
||||
$refl->setValue($this, $value);
|
||||
}
|
||||
}
|
||||
}
|
33
vendor/symfony/error-handler/Error/UndefinedMethodError.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Error;
|
||||
|
||||
class UndefinedMethodError extends \Error
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct(string $message, \Throwable $previous)
|
||||
{
|
||||
parent::__construct($message, $previous->getCode(), $previous->getPrevious());
|
||||
|
||||
foreach ([
|
||||
'file' => $previous->getFile(),
|
||||
'line' => $previous->getLine(),
|
||||
'trace' => $previous->getTrace(),
|
||||
] as $property => $value) {
|
||||
$refl = new \ReflectionProperty(\Error::class, $property);
|
||||
$refl->setAccessible(true);
|
||||
$refl->setValue($this, $value);
|
||||
}
|
||||
}
|
||||
}
|
177
vendor/symfony/error-handler/ErrorEnhancer/ClassNotFoundErrorEnhancer.php
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\ErrorEnhancer;
|
||||
|
||||
use Composer\Autoload\ClassLoader;
|
||||
use Symfony\Component\ErrorHandler\DebugClassLoader;
|
||||
use Symfony\Component\ErrorHandler\Error\ClassNotFoundError;
|
||||
use Symfony\Component\ErrorHandler\Error\FatalError;
|
||||
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class ClassNotFoundErrorEnhancer implements ErrorEnhancerInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function enhance(\Throwable $error): ?\Throwable
|
||||
{
|
||||
// Some specific versions of PHP produce a fatal error when extending a not found class.
|
||||
$message = !$error instanceof FatalError ? $error->getMessage() : $error->getError()['message'];
|
||||
if (!preg_match('/^(Class|Interface|Trait) [\'"]([^\'"]+)[\'"] not found$/', $message, $matches)) {
|
||||
return null;
|
||||
}
|
||||
$typeName = strtolower($matches[1]);
|
||||
$fullyQualifiedClassName = $matches[2];
|
||||
|
||||
if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedClassName, '\\')) {
|
||||
$className = substr($fullyQualifiedClassName, $namespaceSeparatorIndex + 1);
|
||||
$namespacePrefix = substr($fullyQualifiedClassName, 0, $namespaceSeparatorIndex);
|
||||
$message = sprintf('Attempted to load %s "%s" from namespace "%s".', $typeName, $className, $namespacePrefix);
|
||||
$tail = ' for another namespace?';
|
||||
} else {
|
||||
$className = $fullyQualifiedClassName;
|
||||
$message = sprintf('Attempted to load %s "%s" from the global namespace.', $typeName, $className);
|
||||
$tail = '?';
|
||||
}
|
||||
|
||||
if ($candidates = $this->getClassCandidates($className)) {
|
||||
$tail = array_pop($candidates).'"?';
|
||||
if ($candidates) {
|
||||
$tail = ' for e.g. "'.implode('", "', $candidates).'" or "'.$tail;
|
||||
} else {
|
||||
$tail = ' for "'.$tail;
|
||||
}
|
||||
}
|
||||
$message .= "\nDid you forget a \"use\" statement".$tail;
|
||||
|
||||
return new ClassNotFoundError($message, $error);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to guess the full namespace for a given class name.
|
||||
*
|
||||
* By default, it looks for PSR-0 and PSR-4 classes registered via a Symfony or a Composer
|
||||
* autoloader (that should cover all common cases).
|
||||
*
|
||||
* @param string $class A class name (without its namespace)
|
||||
*
|
||||
* Returns an array of possible fully qualified class names
|
||||
*/
|
||||
private function getClassCandidates(string $class): array
|
||||
{
|
||||
if (!\is_array($functions = spl_autoload_functions())) {
|
||||
return [];
|
||||
}
|
||||
|
||||
// find Symfony and Composer autoloaders
|
||||
$classes = [];
|
||||
|
||||
foreach ($functions as $function) {
|
||||
if (!\is_array($function)) {
|
||||
continue;
|
||||
}
|
||||
// get class loaders wrapped by DebugClassLoader
|
||||
if ($function[0] instanceof DebugClassLoader) {
|
||||
$function = $function[0]->getClassLoader();
|
||||
|
||||
if (!\is_array($function)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if ($function[0] instanceof ClassLoader) {
|
||||
foreach ($function[0]->getPrefixes() as $prefix => $paths) {
|
||||
foreach ($paths as $path) {
|
||||
$classes[] = $this->findClassInPath($path, $class, $prefix);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($function[0]->getPrefixesPsr4() as $prefix => $paths) {
|
||||
foreach ($paths as $path) {
|
||||
$classes[] = $this->findClassInPath($path, $class, $prefix);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array_unique(array_merge([], ...$classes));
|
||||
}
|
||||
|
||||
private function findClassInPath(string $path, string $class, string $prefix): array
|
||||
{
|
||||
if (!$path = realpath($path.'/'.strtr($prefix, '\\_', '//')) ?: realpath($path.'/'.\dirname(strtr($prefix, '\\_', '//'))) ?: realpath($path)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$classes = [];
|
||||
$filename = $class.'.php';
|
||||
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
|
||||
if ($filename == $file->getFileName() && $class = $this->convertFileToClass($path, $file->getPathName(), $prefix)) {
|
||||
$classes[] = $class;
|
||||
}
|
||||
}
|
||||
|
||||
return $classes;
|
||||
}
|
||||
|
||||
private function convertFileToClass(string $path, string $file, string $prefix): ?string
|
||||
{
|
||||
$candidates = [
|
||||
// namespaced class
|
||||
$namespacedClass = str_replace([$path.\DIRECTORY_SEPARATOR, '.php', '/'], ['', '', '\\'], $file),
|
||||
// namespaced class (with target dir)
|
||||
$prefix.$namespacedClass,
|
||||
// namespaced class (with target dir and separator)
|
||||
$prefix.'\\'.$namespacedClass,
|
||||
// PEAR class
|
||||
str_replace('\\', '_', $namespacedClass),
|
||||
// PEAR class (with target dir)
|
||||
str_replace('\\', '_', $prefix.$namespacedClass),
|
||||
// PEAR class (with target dir and separator)
|
||||
str_replace('\\', '_', $prefix.'\\'.$namespacedClass),
|
||||
];
|
||||
|
||||
if ($prefix) {
|
||||
$candidates = array_filter($candidates, function ($candidate) use ($prefix) { return 0 === strpos($candidate, $prefix); });
|
||||
}
|
||||
|
||||
// We cannot use the autoloader here as most of them use require; but if the class
|
||||
// is not found, the new autoloader call will require the file again leading to a
|
||||
// "cannot redeclare class" error.
|
||||
foreach ($candidates as $candidate) {
|
||||
if ($this->classExists($candidate)) {
|
||||
return $candidate;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
require_once $file;
|
||||
} catch (\Throwable $e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
foreach ($candidates as $candidate) {
|
||||
if ($this->classExists($candidate)) {
|
||||
return $candidate;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function classExists(string $class): bool
|
||||
{
|
||||
return class_exists($class, false) || interface_exists($class, false) || trait_exists($class, false);
|
||||
}
|
||||
}
|
20
vendor/symfony/error-handler/ErrorEnhancer/ErrorEnhancerInterface.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\ErrorEnhancer;
|
||||
|
||||
interface ErrorEnhancerInterface
|
||||
{
|
||||
/**
|
||||
* Returns an \Throwable instance if the class is able to improve the error, null otherwise.
|
||||
*/
|
||||
public function enhance(\Throwable $error): ?\Throwable;
|
||||
}
|
87
vendor/symfony/error-handler/ErrorEnhancer/UndefinedFunctionErrorEnhancer.php
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\ErrorEnhancer;
|
||||
|
||||
use Symfony\Component\ErrorHandler\Error\FatalError;
|
||||
use Symfony\Component\ErrorHandler\Error\UndefinedFunctionError;
|
||||
|
||||
/**
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class UndefinedFunctionErrorEnhancer implements ErrorEnhancerInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function enhance(\Throwable $error): ?\Throwable
|
||||
{
|
||||
if ($error instanceof FatalError) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$message = $error->getMessage();
|
||||
$messageLen = \strlen($message);
|
||||
$notFoundSuffix = '()';
|
||||
$notFoundSuffixLen = \strlen($notFoundSuffix);
|
||||
if ($notFoundSuffixLen > $messageLen) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (0 !== substr_compare($message, $notFoundSuffix, -$notFoundSuffixLen)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$prefix = 'Call to undefined function ';
|
||||
$prefixLen = \strlen($prefix);
|
||||
if (0 !== strpos($message, $prefix)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$fullyQualifiedFunctionName = substr($message, $prefixLen, -$notFoundSuffixLen);
|
||||
if (false !== $namespaceSeparatorIndex = strrpos($fullyQualifiedFunctionName, '\\')) {
|
||||
$functionName = substr($fullyQualifiedFunctionName, $namespaceSeparatorIndex + 1);
|
||||
$namespacePrefix = substr($fullyQualifiedFunctionName, 0, $namespaceSeparatorIndex);
|
||||
$message = sprintf('Attempted to call function "%s" from namespace "%s".', $functionName, $namespacePrefix);
|
||||
} else {
|
||||
$functionName = $fullyQualifiedFunctionName;
|
||||
$message = sprintf('Attempted to call function "%s" from the global namespace.', $functionName);
|
||||
}
|
||||
|
||||
$candidates = [];
|
||||
foreach (get_defined_functions() as $type => $definedFunctionNames) {
|
||||
foreach ($definedFunctionNames as $definedFunctionName) {
|
||||
if (false !== $namespaceSeparatorIndex = strrpos($definedFunctionName, '\\')) {
|
||||
$definedFunctionNameBasename = substr($definedFunctionName, $namespaceSeparatorIndex + 1);
|
||||
} else {
|
||||
$definedFunctionNameBasename = $definedFunctionName;
|
||||
}
|
||||
|
||||
if ($definedFunctionNameBasename === $functionName) {
|
||||
$candidates[] = '\\'.$definedFunctionName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($candidates) {
|
||||
sort($candidates);
|
||||
$last = array_pop($candidates).'"?';
|
||||
if ($candidates) {
|
||||
$candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last;
|
||||
} else {
|
||||
$candidates = '"'.$last;
|
||||
}
|
||||
$message .= "\nDid you mean to call ".$candidates;
|
||||
}
|
||||
|
||||
return new UndefinedFunctionError($message, $error);
|
||||
}
|
||||
}
|
69
vendor/symfony/error-handler/ErrorEnhancer/UndefinedMethodErrorEnhancer.php
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\ErrorEnhancer;
|
||||
|
||||
use Symfony\Component\ErrorHandler\Error\FatalError;
|
||||
use Symfony\Component\ErrorHandler\Error\UndefinedMethodError;
|
||||
|
||||
/**
|
||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||
*/
|
||||
class UndefinedMethodErrorEnhancer implements ErrorEnhancerInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function enhance(\Throwable $error): ?\Throwable
|
||||
{
|
||||
if ($error instanceof FatalError) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$message = $error->getMessage();
|
||||
preg_match('/^Call to undefined method (.*)::(.*)\(\)$/', $message, $matches);
|
||||
if (!$matches) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$className = $matches[1];
|
||||
$methodName = $matches[2];
|
||||
|
||||
$message = sprintf('Attempted to call an undefined method named "%s" of class "%s".', $methodName, $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);
|
||||
}
|
||||
|
||||
$candidates = [];
|
||||
foreach ($methods as $definedMethodName) {
|
||||
$lev = levenshtein($methodName, $definedMethodName);
|
||||
if ($lev <= \strlen($methodName) / 3 || false !== strpos($definedMethodName, $methodName)) {
|
||||
$candidates[] = $definedMethodName;
|
||||
}
|
||||
}
|
||||
|
||||
if ($candidates) {
|
||||
sort($candidates);
|
||||
$last = array_pop($candidates).'"?';
|
||||
if ($candidates) {
|
||||
$candidates = 'e.g. "'.implode('", "', $candidates).'" or "'.$last;
|
||||
} else {
|
||||
$candidates = '"'.$last;
|
||||
}
|
||||
|
||||
$message .= "\nDid you mean to call ".$candidates;
|
||||
}
|
||||
|
||||
return new UndefinedMethodError($message, $error);
|
||||
}
|
||||
}
|
798
vendor/symfony/error-handler/ErrorHandler.php
vendored
Normal file
@ -0,0 +1,798 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\LogLevel;
|
||||
use Symfony\Component\ErrorHandler\Error\FatalError;
|
||||
use Symfony\Component\ErrorHandler\Error\OutOfMemoryError;
|
||||
use Symfony\Component\ErrorHandler\ErrorEnhancer\ClassNotFoundErrorEnhancer;
|
||||
use Symfony\Component\ErrorHandler\ErrorEnhancer\ErrorEnhancerInterface;
|
||||
use Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedFunctionErrorEnhancer;
|
||||
use Symfony\Component\ErrorHandler\ErrorEnhancer\UndefinedMethodErrorEnhancer;
|
||||
use Symfony\Component\ErrorHandler\ErrorRenderer\CliErrorRenderer;
|
||||
use Symfony\Component\ErrorHandler\ErrorRenderer\HtmlErrorRenderer;
|
||||
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
|
||||
|
||||
/**
|
||||
* A generic ErrorHandler for the PHP engine.
|
||||
*
|
||||
* Provides five bit fields that control how errors are handled:
|
||||
* - thrownErrors: errors thrown as \ErrorException
|
||||
* - loggedErrors: logged errors, when not @-silenced
|
||||
* - scopedErrors: errors thrown or logged with their local context
|
||||
* - tracedErrors: errors logged with their stack trace
|
||||
* - screamedErrors: never @-silenced errors
|
||||
*
|
||||
* Each error level can be logged by a dedicated PSR-3 logger object.
|
||||
* Screaming only applies to logging.
|
||||
* Throwing takes precedence over logging.
|
||||
* Uncaught exceptions are logged as E_ERROR.
|
||||
* E_DEPRECATED and E_USER_DEPRECATED levels never throw.
|
||||
* E_RECOVERABLE_ERROR and E_USER_ERROR levels always throw.
|
||||
* Non catchable errors that can be detected at shutdown time are logged when the scream bit field allows so.
|
||||
* As errors have a performance cost, repeated errors are all logged, so that the developer
|
||||
* can see them and weight them as more important to fix than others of the same level.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class ErrorHandler
|
||||
{
|
||||
private $levels = [
|
||||
\E_DEPRECATED => 'Deprecated',
|
||||
\E_USER_DEPRECATED => 'User Deprecated',
|
||||
\E_NOTICE => 'Notice',
|
||||
\E_USER_NOTICE => 'User Notice',
|
||||
\E_STRICT => 'Runtime Notice',
|
||||
\E_WARNING => 'Warning',
|
||||
\E_USER_WARNING => 'User Warning',
|
||||
\E_COMPILE_WARNING => 'Compile Warning',
|
||||
\E_CORE_WARNING => 'Core Warning',
|
||||
\E_USER_ERROR => 'User Error',
|
||||
\E_RECOVERABLE_ERROR => 'Catchable Fatal Error',
|
||||
\E_COMPILE_ERROR => 'Compile Error',
|
||||
\E_PARSE => 'Parse Error',
|
||||
\E_ERROR => 'Error',
|
||||
\E_CORE_ERROR => 'Core Error',
|
||||
];
|
||||
|
||||
private $loggers = [
|
||||
\E_DEPRECATED => [null, LogLevel::INFO],
|
||||
\E_USER_DEPRECATED => [null, LogLevel::INFO],
|
||||
\E_NOTICE => [null, LogLevel::WARNING],
|
||||
\E_USER_NOTICE => [null, LogLevel::WARNING],
|
||||
\E_STRICT => [null, LogLevel::WARNING],
|
||||
\E_WARNING => [null, LogLevel::WARNING],
|
||||
\E_USER_WARNING => [null, LogLevel::WARNING],
|
||||
\E_COMPILE_WARNING => [null, LogLevel::WARNING],
|
||||
\E_CORE_WARNING => [null, LogLevel::WARNING],
|
||||
\E_USER_ERROR => [null, LogLevel::CRITICAL],
|
||||
\E_RECOVERABLE_ERROR => [null, LogLevel::CRITICAL],
|
||||
\E_COMPILE_ERROR => [null, LogLevel::CRITICAL],
|
||||
\E_PARSE => [null, LogLevel::CRITICAL],
|
||||
\E_ERROR => [null, LogLevel::CRITICAL],
|
||||
\E_CORE_ERROR => [null, LogLevel::CRITICAL],
|
||||
];
|
||||
|
||||
private $thrownErrors = 0x1FFF; // E_ALL - E_DEPRECATED - E_USER_DEPRECATED
|
||||
private $scopedErrors = 0x1FFF; // E_ALL - E_DEPRECATED - E_USER_DEPRECATED
|
||||
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 $configureException;
|
||||
private $debug;
|
||||
|
||||
private $isRecursive = 0;
|
||||
private $isRoot = false;
|
||||
private $exceptionHandler;
|
||||
private $bootstrappingLogger;
|
||||
|
||||
private static $reservedMemory;
|
||||
private static $toStringException;
|
||||
private static $silencedErrorCache = [];
|
||||
private static $silencedErrorCount = 0;
|
||||
private static $exitCode = 0;
|
||||
|
||||
/**
|
||||
* Registers the error handler.
|
||||
*/
|
||||
public static function register(self $handler = null, bool $replace = true): self
|
||||
{
|
||||
if (null === self::$reservedMemory) {
|
||||
self::$reservedMemory = str_repeat('x', 32768);
|
||||
register_shutdown_function(__CLASS__.'::handleFatalError');
|
||||
}
|
||||
|
||||
if ($handlerIsNew = null === $handler) {
|
||||
$handler = new static();
|
||||
}
|
||||
|
||||
if (null === $prev = set_error_handler([$handler, 'handleError'])) {
|
||||
restore_error_handler();
|
||||
// Specifying the error types earlier would expose us to https://bugs.php.net/63206
|
||||
set_error_handler([$handler, 'handleError'], $handler->thrownErrors | $handler->loggedErrors);
|
||||
$handler->isRoot = true;
|
||||
}
|
||||
|
||||
if ($handlerIsNew && \is_array($prev) && $prev[0] instanceof self) {
|
||||
$handler = $prev[0];
|
||||
$replace = false;
|
||||
}
|
||||
if (!$replace && $prev) {
|
||||
restore_error_handler();
|
||||
$handlerIsRegistered = \is_array($prev) && $handler === $prev[0];
|
||||
} else {
|
||||
$handlerIsRegistered = true;
|
||||
}
|
||||
if (\is_array($prev = set_exception_handler([$handler, 'handleException'])) && $prev[0] instanceof self) {
|
||||
restore_exception_handler();
|
||||
if (!$handlerIsRegistered) {
|
||||
$handler = $prev[0];
|
||||
} elseif ($handler !== $prev[0] && $replace) {
|
||||
set_exception_handler([$handler, 'handleException']);
|
||||
$p = $prev[0]->setExceptionHandler(null);
|
||||
$handler->setExceptionHandler($p);
|
||||
$prev[0]->setExceptionHandler($p);
|
||||
}
|
||||
} else {
|
||||
$handler->setExceptionHandler($prev ?? [$handler, 'renderException']);
|
||||
}
|
||||
|
||||
$handler->throwAt(\E_ALL & $handler->thrownErrors, true);
|
||||
|
||||
return $handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls a function and turns any PHP error into \ErrorException.
|
||||
*
|
||||
* @return mixed What $function(...$arguments) returns
|
||||
*
|
||||
* @throws \ErrorException When $function(...$arguments) triggers a PHP error
|
||||
*/
|
||||
public static function call(callable $function, ...$arguments)
|
||||
{
|
||||
set_error_handler(static function (int $type, string $message, string $file, int $line) {
|
||||
if (__FILE__ === $file) {
|
||||
$trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 3);
|
||||
$file = $trace[2]['file'] ?? $file;
|
||||
$line = $trace[2]['line'] ?? $line;
|
||||
}
|
||||
|
||||
throw new \ErrorException($message, 0, $type, $file, $line);
|
||||
});
|
||||
|
||||
try {
|
||||
return $function(...$arguments);
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(BufferingLogger $bootstrappingLogger = null, bool $debug = false)
|
||||
{
|
||||
if ($bootstrappingLogger) {
|
||||
$this->bootstrappingLogger = $bootstrappingLogger;
|
||||
$this->setDefaultLogger($bootstrappingLogger);
|
||||
}
|
||||
$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);
|
||||
$e->file = $file ?? $e->file;
|
||||
$e->line = $line ?? $e->line;
|
||||
}, null, new class() extends \Exception {
|
||||
});
|
||||
$this->debug = $debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a logger to non assigned errors levels.
|
||||
*
|
||||
* @param LoggerInterface $logger A PSR-3 logger to put as default for the given levels
|
||||
* @param array|int|null $levels An array map of E_* to LogLevel::* or an integer bit field of E_* constants
|
||||
* @param bool $replace Whether to replace or not any existing logger
|
||||
*/
|
||||
public function setDefaultLogger(LoggerInterface $logger, $levels = \E_ALL, bool $replace = false): void
|
||||
{
|
||||
$loggers = [];
|
||||
|
||||
if (\is_array($levels)) {
|
||||
foreach ($levels as $type => $logLevel) {
|
||||
if (empty($this->loggers[$type][0]) || $replace || $this->loggers[$type][0] === $this->bootstrappingLogger) {
|
||||
$loggers[$type] = [$logger, $logLevel];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (null === $levels) {
|
||||
$levels = \E_ALL;
|
||||
}
|
||||
foreach ($this->loggers as $type => $log) {
|
||||
if (($type & $levels) && (empty($log[0]) || $replace || $log[0] === $this->bootstrappingLogger)) {
|
||||
$log[0] = $logger;
|
||||
$loggers[$type] = $log;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->setLoggers($loggers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a logger for each error level.
|
||||
*
|
||||
* @param array $loggers Error levels to [LoggerInterface|null, LogLevel::*] map
|
||||
*
|
||||
* @return array The previous map
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setLoggers(array $loggers): array
|
||||
{
|
||||
$prevLogged = $this->loggedErrors;
|
||||
$prev = $this->loggers;
|
||||
$flush = [];
|
||||
|
||||
foreach ($loggers as $type => $log) {
|
||||
if (!isset($prev[$type])) {
|
||||
throw new \InvalidArgumentException('Unknown error type: '.$type);
|
||||
}
|
||||
if (!\is_array($log)) {
|
||||
$log = [$log];
|
||||
} elseif (!\array_key_exists(0, $log)) {
|
||||
throw new \InvalidArgumentException('No logger provided.');
|
||||
}
|
||||
if (null === $log[0]) {
|
||||
$this->loggedErrors &= ~$type;
|
||||
} elseif ($log[0] instanceof LoggerInterface) {
|
||||
$this->loggedErrors |= $type;
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Invalid logger provided.');
|
||||
}
|
||||
$this->loggers[$type] = $log + $prev[$type];
|
||||
|
||||
if ($this->bootstrappingLogger && $prev[$type][0] === $this->bootstrappingLogger) {
|
||||
$flush[$type] = $type;
|
||||
}
|
||||
}
|
||||
$this->reRegister($prevLogged | $this->thrownErrors);
|
||||
|
||||
if ($flush) {
|
||||
foreach ($this->bootstrappingLogger->cleanLogs() as $log) {
|
||||
$type = ThrowableUtils::getSeverity($log[2]['exception']);
|
||||
if (!isset($flush[$type])) {
|
||||
$this->bootstrappingLogger->log($log[0], $log[1], $log[2]);
|
||||
} elseif ($this->loggers[$type][0]) {
|
||||
$this->loggers[$type][0]->log($this->loggers[$type][1], $log[1], $log[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a user exception handler.
|
||||
*
|
||||
* @param callable(\Throwable $e)|null $handler
|
||||
*
|
||||
* @return callable|null The previous exception handler
|
||||
*/
|
||||
public function setExceptionHandler(?callable $handler): ?callable
|
||||
{
|
||||
$prev = $this->exceptionHandler;
|
||||
$this->exceptionHandler = $handler;
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the PHP error levels that throw an exception when a PHP error occurs.
|
||||
*
|
||||
* @param int $levels A bit field of E_* constants for thrown errors
|
||||
* @param bool $replace Replace or amend the previous value
|
||||
*
|
||||
* @return int The previous value
|
||||
*/
|
||||
public function throwAt(int $levels, bool $replace = false): int
|
||||
{
|
||||
$prev = $this->thrownErrors;
|
||||
$this->thrownErrors = ($levels | \E_RECOVERABLE_ERROR | \E_USER_ERROR) & ~\E_USER_DEPRECATED & ~\E_DEPRECATED;
|
||||
if (!$replace) {
|
||||
$this->thrownErrors |= $prev;
|
||||
}
|
||||
$this->reRegister($prev | $this->loggedErrors);
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the PHP error levels for which local variables are preserved.
|
||||
*
|
||||
* @param int $levels A bit field of E_* constants for scoped errors
|
||||
* @param bool $replace Replace or amend the previous value
|
||||
*
|
||||
* @return int The previous value
|
||||
*/
|
||||
public function scopeAt(int $levels, bool $replace = false): int
|
||||
{
|
||||
$prev = $this->scopedErrors;
|
||||
$this->scopedErrors = $levels;
|
||||
if (!$replace) {
|
||||
$this->scopedErrors |= $prev;
|
||||
}
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the PHP error levels for which the stack trace is preserved.
|
||||
*
|
||||
* @param int $levels A bit field of E_* constants for traced errors
|
||||
* @param bool $replace Replace or amend the previous value
|
||||
*
|
||||
* @return int The previous value
|
||||
*/
|
||||
public function traceAt(int $levels, bool $replace = false): int
|
||||
{
|
||||
$prev = $this->tracedErrors;
|
||||
$this->tracedErrors = $levels;
|
||||
if (!$replace) {
|
||||
$this->tracedErrors |= $prev;
|
||||
}
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the error levels where the @-operator is ignored.
|
||||
*
|
||||
* @param int $levels A bit field of E_* constants for screamed errors
|
||||
* @param bool $replace Replace or amend the previous value
|
||||
*
|
||||
* @return int The previous value
|
||||
*/
|
||||
public function screamAt(int $levels, bool $replace = false): int
|
||||
{
|
||||
$prev = $this->screamedErrors;
|
||||
$this->screamedErrors = $levels;
|
||||
if (!$replace) {
|
||||
$this->screamedErrors |= $prev;
|
||||
}
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-registers as a PHP error handler if levels changed.
|
||||
*/
|
||||
private function reRegister(int $prev): void
|
||||
{
|
||||
if ($prev !== $this->thrownErrors | $this->loggedErrors) {
|
||||
$handler = set_error_handler('var_dump');
|
||||
$handler = \is_array($handler) ? $handler[0] : null;
|
||||
restore_error_handler();
|
||||
if ($handler === $this) {
|
||||
restore_error_handler();
|
||||
if ($this->isRoot) {
|
||||
set_error_handler([$this, 'handleError'], $this->thrownErrors | $this->loggedErrors);
|
||||
} else {
|
||||
set_error_handler([$this, 'handleError']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles errors by filtering then logging them according to the configured bit fields.
|
||||
*
|
||||
* @return bool Returns false when no handling happens so that the PHP engine can handle the error itself
|
||||
*
|
||||
* @throws \ErrorException When $this->thrownErrors requests so
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function handleError(int $type, string $message, string $file, int $line): bool
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 70300 && \E_WARNING === $type && '"' === $message[0] && false !== strpos($message, '" targeting switch is equivalent to "break')) {
|
||||
$type = \E_DEPRECATED;
|
||||
}
|
||||
|
||||
// Level is the current error reporting level to manage silent error.
|
||||
$level = error_reporting();
|
||||
$silenced = 0 === ($level & $type);
|
||||
// Strong errors are not authorized to be silenced.
|
||||
$level |= \E_RECOVERABLE_ERROR | \E_USER_ERROR | \E_DEPRECATED | \E_USER_DEPRECATED;
|
||||
$log = $this->loggedErrors & $type;
|
||||
$throw = $this->thrownErrors & $type & $level;
|
||||
$type &= $level | $this->screamedErrors;
|
||||
|
||||
// Never throw on warnings triggered by assert()
|
||||
if (\E_WARNING === $type && 'a' === $message[0] && 0 === strncmp($message, 'assert(): ', 10)) {
|
||||
$throw = 0;
|
||||
}
|
||||
|
||||
if (!$type || (!$log && !$throw)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$logMessage = $this->levels[$type].': '.$message;
|
||||
|
||||
if (null !== self::$toStringException) {
|
||||
$errorAsException = self::$toStringException;
|
||||
self::$toStringException = null;
|
||||
} elseif (!$throw && !($type & $level)) {
|
||||
if (!isset(self::$silencedErrorCache[$id = $file.':'.$line])) {
|
||||
$lightTrace = $this->tracedErrors & $type ? $this->cleanTrace(debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 5), $type, $file, $line, false) : [];
|
||||
$errorAsException = new SilencedErrorContext($type, $file, $line, isset($lightTrace[1]) ? [$lightTrace[0]] : $lightTrace);
|
||||
} elseif (isset(self::$silencedErrorCache[$id][$message])) {
|
||||
$lightTrace = null;
|
||||
$errorAsException = self::$silencedErrorCache[$id][$message];
|
||||
++$errorAsException->count;
|
||||
} else {
|
||||
$lightTrace = [];
|
||||
$errorAsException = null;
|
||||
}
|
||||
|
||||
if (100 < ++self::$silencedErrorCount) {
|
||||
self::$silencedErrorCache = $lightTrace = [];
|
||||
self::$silencedErrorCount = 1;
|
||||
}
|
||||
if ($errorAsException) {
|
||||
self::$silencedErrorCache[$id][$message] = $errorAsException;
|
||||
}
|
||||
if (null === $lightTrace) {
|
||||
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) {
|
||||
$backtrace = $errorAsException->getTrace();
|
||||
$lightTrace = $this->cleanTrace($backtrace, $type, $file, $line, $throw);
|
||||
($this->configureException)($errorAsException, $lightTrace, $file, $line);
|
||||
} else {
|
||||
($this->configureException)($errorAsException, []);
|
||||
$backtrace = [];
|
||||
}
|
||||
}
|
||||
|
||||
if ($throw) {
|
||||
if (\PHP_VERSION_ID < 70400 && \E_USER_ERROR & $type) {
|
||||
for ($i = 1; isset($backtrace[$i]); ++$i) {
|
||||
if (isset($backtrace[$i]['function'], $backtrace[$i]['type'], $backtrace[$i - 1]['function'])
|
||||
&& '__toString' === $backtrace[$i]['function']
|
||||
&& '->' === $backtrace[$i]['type']
|
||||
&& !isset($backtrace[$i - 1]['class'])
|
||||
&& ('trigger_error' === $backtrace[$i - 1]['function'] || 'user_error' === $backtrace[$i - 1]['function'])
|
||||
) {
|
||||
// Here, we know trigger_error() has been called from __toString().
|
||||
// PHP triggers a fatal error when throwing from __toString().
|
||||
// A small convention allows working around the limitation:
|
||||
// given a caught $e exception in __toString(), quitting the method with
|
||||
// `return trigger_error($e, E_USER_ERROR);` allows this error handler
|
||||
// to make $e get through the __toString() barrier.
|
||||
|
||||
$context = 4 < \func_num_args() ? (func_get_arg(4) ?: []) : [];
|
||||
|
||||
foreach ($context as $e) {
|
||||
if ($e instanceof \Throwable && $e->__toString() === $message) {
|
||||
self::$toStringException = $e;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Display the original error message instead of the default one.
|
||||
$this->handleException($errorAsException);
|
||||
|
||||
// Stop the process by giving back the error to the native handler.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw $errorAsException;
|
||||
}
|
||||
|
||||
if ($this->isRecursive) {
|
||||
$log = 0;
|
||||
} else {
|
||||
if (\PHP_VERSION_ID < (\PHP_VERSION_ID < 70400 ? 70316 : 70404)) {
|
||||
$currentErrorHandler = set_error_handler('var_dump');
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
try {
|
||||
$this->isRecursive = true;
|
||||
$level = ($type & $level) ? $this->loggers[$type][1] : LogLevel::DEBUG;
|
||||
$this->loggers[$type][0]->log($level, $logMessage, $errorAsException ? ['exception' => $errorAsException] : []);
|
||||
} finally {
|
||||
$this->isRecursive = false;
|
||||
|
||||
if (\PHP_VERSION_ID < (\PHP_VERSION_ID < 70400 ? 70316 : 70404)) {
|
||||
set_error_handler($currentErrorHandler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return !$silenced && $type && $log;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles an exception by logging then forwarding it to another handler.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function handleException(\Throwable $exception)
|
||||
{
|
||||
$handlerException = null;
|
||||
|
||||
if (!$exception instanceof FatalError) {
|
||||
self::$exitCode = 255;
|
||||
|
||||
$type = ThrowableUtils::getSeverity($exception);
|
||||
} else {
|
||||
$type = $exception->getError()['type'];
|
||||
}
|
||||
|
||||
if ($this->loggedErrors & $type) {
|
||||
if (false !== strpos($message = $exception->getMessage(), "@anonymous\0")) {
|
||||
$message = $this->parseAnonymousClass($message);
|
||||
}
|
||||
|
||||
if ($exception instanceof FatalError) {
|
||||
$message = 'Fatal '.$message;
|
||||
} elseif ($exception instanceof \Error) {
|
||||
$message = 'Uncaught Error: '.$message;
|
||||
} elseif ($exception instanceof \ErrorException) {
|
||||
$message = 'Uncaught '.$message;
|
||||
} else {
|
||||
$message = 'Uncaught Exception: '.$message;
|
||||
}
|
||||
|
||||
try {
|
||||
$this->loggers[$type][0]->log($this->loggers[$type][1], $message, ['exception' => $exception]);
|
||||
} catch (\Throwable $handlerException) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$exception instanceof OutOfMemoryError) {
|
||||
foreach ($this->getErrorEnhancers() as $errorEnhancer) {
|
||||
if ($e = $errorEnhancer->enhance($exception)) {
|
||||
$exception = $e;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$exceptionHandler = $this->exceptionHandler;
|
||||
$this->exceptionHandler = [$this, 'renderException'];
|
||||
|
||||
if (null === $exceptionHandler || $exceptionHandler === $this->exceptionHandler) {
|
||||
$this->exceptionHandler = null;
|
||||
}
|
||||
|
||||
try {
|
||||
if (null !== $exceptionHandler) {
|
||||
return $exceptionHandler($exception);
|
||||
}
|
||||
$handlerException = $handlerException ?: $exception;
|
||||
} catch (\Throwable $handlerException) {
|
||||
}
|
||||
if ($exception === $handlerException && null === $this->exceptionHandler) {
|
||||
self::$reservedMemory = null; // Disable the fatal error handler
|
||||
throw $exception; // Give back $exception to the native handler
|
||||
}
|
||||
|
||||
$loggedErrors = $this->loggedErrors;
|
||||
if ($exception === $handlerException) {
|
||||
$this->loggedErrors &= ~$type;
|
||||
}
|
||||
|
||||
try {
|
||||
$this->handleException($handlerException);
|
||||
} finally {
|
||||
$this->loggedErrors = $loggedErrors;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown registered function for handling PHP fatal errors.
|
||||
*
|
||||
* @param array|null $error An array as returned by error_get_last()
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public static function handleFatalError(array $error = null): void
|
||||
{
|
||||
if (null === self::$reservedMemory) {
|
||||
return;
|
||||
}
|
||||
|
||||
$handler = self::$reservedMemory = null;
|
||||
$handlers = [];
|
||||
$previousHandler = null;
|
||||
$sameHandlerLimit = 10;
|
||||
|
||||
while (!\is_array($handler) || !$handler[0] instanceof self) {
|
||||
$handler = set_exception_handler('var_dump');
|
||||
restore_exception_handler();
|
||||
|
||||
if (!$handler) {
|
||||
break;
|
||||
}
|
||||
restore_exception_handler();
|
||||
|
||||
if ($handler !== $previousHandler) {
|
||||
array_unshift($handlers, $handler);
|
||||
$previousHandler = $handler;
|
||||
} elseif (0 === --$sameHandlerLimit) {
|
||||
$handler = null;
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach ($handlers as $h) {
|
||||
set_exception_handler($h);
|
||||
}
|
||||
if (!$handler) {
|
||||
return;
|
||||
}
|
||||
if ($handler !== $h) {
|
||||
$handler[0]->setExceptionHandler($h);
|
||||
}
|
||||
$handler = $handler[0];
|
||||
$handlers = [];
|
||||
|
||||
if ($exit = null === $error) {
|
||||
$error = error_get_last();
|
||||
}
|
||||
|
||||
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 = $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);
|
||||
} else {
|
||||
$fatalError = new FatalError($handler->levels[$error['type']].': '.$error['message'], 0, $error, 2, true, $trace);
|
||||
}
|
||||
} else {
|
||||
$fatalError = null;
|
||||
}
|
||||
|
||||
try {
|
||||
if (null !== $fatalError) {
|
||||
self::$exitCode = 255;
|
||||
$handler->handleException($fatalError);
|
||||
}
|
||||
} catch (FatalError $e) {
|
||||
// Ignore this re-throw
|
||||
}
|
||||
|
||||
if ($exit && self::$exitCode) {
|
||||
$exitCode = self::$exitCode;
|
||||
register_shutdown_function('register_shutdown_function', function () use ($exitCode) { exit($exitCode); });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the given exception.
|
||||
*
|
||||
* As this method is mainly called during boot where nothing is yet available,
|
||||
* the output is always either HTML or CLI depending where PHP runs.
|
||||
*/
|
||||
private function renderException(\Throwable $exception): void
|
||||
{
|
||||
$renderer = \in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) ? new CliErrorRenderer() : new HtmlErrorRenderer($this->debug);
|
||||
|
||||
$exception = $renderer->render($exception);
|
||||
|
||||
if (!headers_sent()) {
|
||||
http_response_code($exception->getStatusCode());
|
||||
|
||||
foreach ($exception->getHeaders() as $name => $value) {
|
||||
header($name.': '.$value, false);
|
||||
}
|
||||
}
|
||||
|
||||
echo $exception->getAsString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Override this method if you want to define more error enhancers.
|
||||
*
|
||||
* @return ErrorEnhancerInterface[]
|
||||
*/
|
||||
protected function getErrorEnhancers(): iterable
|
||||
{
|
||||
return [
|
||||
new UndefinedFunctionErrorEnhancer(),
|
||||
new UndefinedMethodErrorEnhancer(),
|
||||
new ClassNotFoundErrorEnhancer(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
{
|
||||
$lightTrace = $backtrace;
|
||||
|
||||
for ($i = 0; isset($backtrace[$i]); ++$i) {
|
||||
if (isset($backtrace[$i]['file'], $backtrace[$i]['line']) && $backtrace[$i]['line'] === $line && $backtrace[$i]['file'] === $file) {
|
||||
$lightTrace = \array_slice($lightTrace, 1 + $i);
|
||||
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)) {
|
||||
array_splice($lightTrace, --$i, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!($throw || $this->scopedErrors & $type)) {
|
||||
for ($i = 0; isset($lightTrace[$i]); ++$i) {
|
||||
unset($lightTrace[$i]['args'], $lightTrace[$i]['object']);
|
||||
}
|
||||
}
|
||||
|
||||
return $lightTrace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the error message by removing the anonymous class notation
|
||||
* and using the parent class instead if possible.
|
||||
*/
|
||||
private function parseAnonymousClass(string $message): string
|
||||
{
|
||||
return preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', static function ($m) {
|
||||
return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
|
||||
}, $message);
|
||||
}
|
||||
}
|
49
vendor/symfony/error-handler/ErrorRenderer/CliErrorRenderer.php
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
|
||||
|
||||
use Symfony\Component\ErrorHandler\Exception\FlattenException;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
|
||||
// Help opcache.preload discover always-needed symbols
|
||||
class_exists(CliDumper::class);
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class CliErrorRenderer implements ErrorRendererInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render(\Throwable $exception): FlattenException
|
||||
{
|
||||
$cloner = new VarCloner();
|
||||
$dumper = new class() extends CliDumper {
|
||||
protected function supportsColors(): bool
|
||||
{
|
||||
$outputStream = $this->outputStream;
|
||||
$this->outputStream = fopen('php://stdout', 'w');
|
||||
|
||||
try {
|
||||
return parent::supportsColors();
|
||||
} finally {
|
||||
$this->outputStream = $outputStream;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return FlattenException::createFromThrowable($exception)
|
||||
->setAsString($dumper->dump($cloner->cloneVar($exception), true));
|
||||
}
|
||||
}
|
27
vendor/symfony/error-handler/ErrorRenderer/ErrorRendererInterface.php
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
|
||||
|
||||
use Symfony\Component\ErrorHandler\Exception\FlattenException;
|
||||
|
||||
/**
|
||||
* Formats an exception to be used as response content.
|
||||
*
|
||||
* @author Yonel Ceruto <yonelceruto@gmail.com>
|
||||
*/
|
||||
interface ErrorRendererInterface
|
||||
{
|
||||
/**
|
||||
* Renders a Throwable as a FlattenException.
|
||||
*/
|
||||
public function render(\Throwable $exception): FlattenException;
|
||||
}
|
367
vendor/symfony/error-handler/ErrorRenderer/HtmlErrorRenderer.php
vendored
Normal file
94
vendor/symfony/error-handler/ErrorRenderer/SerializerErrorRenderer.php
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\ErrorRenderer;
|
||||
|
||||
use Symfony\Component\ErrorHandler\Exception\FlattenException;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Serializer\Exception\NotEncodableValueException;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
|
||||
/**
|
||||
* Formats an exception using Serializer for rendering.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class SerializerErrorRenderer implements ErrorRendererInterface
|
||||
{
|
||||
private $serializer;
|
||||
private $format;
|
||||
private $fallbackErrorRenderer;
|
||||
private $debug;
|
||||
|
||||
/**
|
||||
* @param string|callable(FlattenException) $format The format as a string or a callable that should return it
|
||||
* formats not supported by Request::getMimeTypes() should be given as mime types
|
||||
* @param bool|callable $debug The debugging mode as a boolean or a callable that should return it
|
||||
*/
|
||||
public function __construct(SerializerInterface $serializer, $format, ErrorRendererInterface $fallbackErrorRenderer = null, $debug = false)
|
||||
{
|
||||
if (!\is_string($format) && !\is_callable($format)) {
|
||||
throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be a string or a callable, "%s" given.', __METHOD__, \gettype($format)));
|
||||
}
|
||||
|
||||
if (!\is_bool($debug) && !\is_callable($debug)) {
|
||||
throw new \TypeError(sprintf('Argument 4 passed to "%s()" must be a boolean or a callable, "%s" given.', __METHOD__, \gettype($debug)));
|
||||
}
|
||||
|
||||
$this->serializer = $serializer;
|
||||
$this->format = $format;
|
||||
$this->fallbackErrorRenderer = $fallbackErrorRenderer ?? new HtmlErrorRenderer();
|
||||
$this->debug = $debug;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function render(\Throwable $exception): FlattenException
|
||||
{
|
||||
$headers = [];
|
||||
$debug = \is_bool($this->debug) ? $this->debug : ($this->debug)($exception);
|
||||
if ($debug) {
|
||||
$headers['X-Debug-Exception'] = rawurlencode($exception->getMessage());
|
||||
$headers['X-Debug-Exception-File'] = rawurlencode($exception->getFile()).':'.$exception->getLine();
|
||||
}
|
||||
|
||||
$flattenException = FlattenException::createFromThrowable($exception, null, $headers);
|
||||
|
||||
try {
|
||||
$format = \is_string($this->format) ? $this->format : ($this->format)($flattenException);
|
||||
$headers = [
|
||||
'Content-Type' => Request::getMimeTypes($format)[0] ?? $format,
|
||||
'Vary' => 'Accept',
|
||||
];
|
||||
|
||||
return $flattenException->setAsString($this->serializer->serialize($flattenException, $format, [
|
||||
'exception' => $exception,
|
||||
'debug' => $debug,
|
||||
]))
|
||||
->setHeaders($flattenException->getHeaders() + $headers);
|
||||
} catch (NotEncodableValueException $e) {
|
||||
return $this->fallbackErrorRenderer->render($exception);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getPreferredFormat(RequestStack $requestStack): \Closure
|
||||
{
|
||||
return static function () use ($requestStack) {
|
||||
if (!$request = $requestStack->getCurrentRequest()) {
|
||||
throw new NotEncodableValueException();
|
||||
}
|
||||
|
||||
return $request->getPreferredFormat();
|
||||
};
|
||||
}
|
||||
}
|
427
vendor/symfony/error-handler/Exception/FlattenException.php
vendored
Normal file
@ -0,0 +1,427 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Exception;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
|
||||
/**
|
||||
* FlattenException wraps a PHP Error or Exception to be able to serialize it.
|
||||
*
|
||||
* Basically, this class removes all objects from the trace.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* @return static
|
||||
*/
|
||||
public static function create(\Exception $exception, int $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();
|
||||
$e->setMessage($exception->getMessage());
|
||||
$e->setCode($exception->getCode());
|
||||
|
||||
if ($exception instanceof HttpExceptionInterface) {
|
||||
$statusCode = $exception->getStatusCode();
|
||||
$headers = array_merge($headers, $exception->getHeaders());
|
||||
} elseif ($exception instanceof RequestExceptionInterface) {
|
||||
$statusCode = 400;
|
||||
}
|
||||
|
||||
if (null === $statusCode) {
|
||||
$statusCode = 500;
|
||||
}
|
||||
|
||||
if (class_exists(Response::class) && isset(Response::$statusTexts[$statusCode])) {
|
||||
$statusText = Response::$statusTexts[$statusCode];
|
||||
} else {
|
||||
$statusText = 'Whoops, looks like something went wrong.';
|
||||
}
|
||||
|
||||
$e->setStatusText($statusText);
|
||||
$e->setStatusCode($statusCode);
|
||||
$e->setHeaders($headers);
|
||||
$e->setTraceFromThrowable($exception);
|
||||
$e->setClass(\get_class($exception));
|
||||
$e->setFile($exception->getFile());
|
||||
$e->setLine($exception->getLine());
|
||||
|
||||
$previous = $exception->getPrevious();
|
||||
|
||||
if ($previous instanceof \Throwable) {
|
||||
$e->setPrevious(static::createFromThrowable($previous));
|
||||
}
|
||||
|
||||
return $e;
|
||||
}
|
||||
|
||||
public function toArray(): array
|
||||
{
|
||||
$exceptions = [];
|
||||
foreach (array_merge([$this], $this->getAllPrevious()) as $exception) {
|
||||
$exceptions[] = [
|
||||
'message' => $exception->getMessage(),
|
||||
'class' => $exception->getClass(),
|
||||
'trace' => $exception->getTrace(),
|
||||
];
|
||||
}
|
||||
|
||||
return $exceptions;
|
||||
}
|
||||
|
||||
public function getStatusCode(): int
|
||||
{
|
||||
return $this->statusCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatusCode(int $code): self
|
||||
{
|
||||
$this->statusCode = $code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getHeaders(): array
|
||||
{
|
||||
return $this->headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setHeaders(array $headers): self
|
||||
{
|
||||
$this->headers = $headers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getClass(): string
|
||||
{
|
||||
return $this->class;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setClass(string $class): self
|
||||
{
|
||||
$this->class = false !== strpos($class, "@anonymous\0") ? (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous' : $class;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getFile(): string
|
||||
{
|
||||
return $this->file;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setFile(string $file): self
|
||||
{
|
||||
$this->file = $file;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLine(): int
|
||||
{
|
||||
return $this->line;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setLine(int $line): self
|
||||
{
|
||||
$this->line = $line;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStatusText(): string
|
||||
{
|
||||
return $this->statusText;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setStatusText(string $statusText): self
|
||||
{
|
||||
$this->statusText = $statusText;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMessage(): string
|
||||
{
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setMessage(string $message): self
|
||||
{
|
||||
if (false !== strpos($message, "@anonymous\0")) {
|
||||
$message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||
return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
|
||||
}, $message);
|
||||
}
|
||||
|
||||
$this->message = $message;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int|string int most of the time (might be a string with PDOException)
|
||||
*/
|
||||
public function getCode()
|
||||
{
|
||||
return $this->code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int|string $code
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setCode($code): self
|
||||
{
|
||||
$this->code = $code;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPrevious(): ?self
|
||||
{
|
||||
return $this->previous;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setPrevious(?self $previous): self
|
||||
{
|
||||
$this->previous = $previous;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return self[]
|
||||
*/
|
||||
public function getAllPrevious(): array
|
||||
{
|
||||
$exceptions = [];
|
||||
$e = $this;
|
||||
while ($e = $e->getPrevious()) {
|
||||
$exceptions[] = $e;
|
||||
}
|
||||
|
||||
return $exceptions;
|
||||
}
|
||||
|
||||
public function getTrace(): array
|
||||
{
|
||||
return $this->trace;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setTraceFromThrowable(\Throwable $throwable): self
|
||||
{
|
||||
$this->traceAsString = $throwable->getTraceAsString();
|
||||
|
||||
return $this->setTrace($throwable->getTrace(), $throwable->getFile(), $throwable->getLine());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setTrace(array $trace, ?string $file, ?int $line): self
|
||||
{
|
||||
$this->trace = [];
|
||||
$this->trace[] = [
|
||||
'namespace' => '',
|
||||
'short_class' => '',
|
||||
'class' => '',
|
||||
'type' => '',
|
||||
'function' => '',
|
||||
'file' => $file,
|
||||
'line' => $line,
|
||||
'args' => [],
|
||||
];
|
||||
foreach ($trace as $entry) {
|
||||
$class = '';
|
||||
$namespace = '';
|
||||
if (isset($entry['class'])) {
|
||||
$parts = explode('\\', $entry['class']);
|
||||
$class = array_pop($parts);
|
||||
$namespace = implode('\\', $parts);
|
||||
}
|
||||
|
||||
$this->trace[] = [
|
||||
'namespace' => $namespace,
|
||||
'short_class' => $class,
|
||||
'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']) : [],
|
||||
];
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function flattenArgs(array $args, int $level = 0, int &$count = 0): array
|
||||
{
|
||||
$result = [];
|
||||
foreach ($args as $key => $value) {
|
||||
if (++$count > 1e4) {
|
||||
return ['array', '*SKIPPED over 10000 entries*'];
|
||||
}
|
||||
if ($value instanceof \__PHP_Incomplete_Class) {
|
||||
$result[$key] = ['incomplete-object', $this->getClassNameFromIncomplete($value)];
|
||||
} elseif (\is_object($value)) {
|
||||
$result[$key] = ['object', \get_class($value)];
|
||||
} elseif (\is_array($value)) {
|
||||
if ($level > 10) {
|
||||
$result[$key] = ['array', '*DEEP NESTED ARRAY*'];
|
||||
} else {
|
||||
$result[$key] = ['array', $this->flattenArgs($value, $level + 1, $count)];
|
||||
}
|
||||
} elseif (null === $value) {
|
||||
$result[$key] = ['null', null];
|
||||
} elseif (\is_bool($value)) {
|
||||
$result[$key] = ['boolean', $value];
|
||||
} elseif (\is_int($value)) {
|
||||
$result[$key] = ['integer', $value];
|
||||
} elseif (\is_float($value)) {
|
||||
$result[$key] = ['float', $value];
|
||||
} elseif (\is_resource($value)) {
|
||||
$result[$key] = ['resource', get_resource_type($value)];
|
||||
} else {
|
||||
$result[$key] = ['string', (string) $value];
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function getClassNameFromIncomplete(\__PHP_Incomplete_Class $value): string
|
||||
{
|
||||
$array = new \ArrayObject($value);
|
||||
|
||||
return $array['__PHP_Incomplete_Class_Name'];
|
||||
}
|
||||
|
||||
public function getTraceAsString(): string
|
||||
{
|
||||
return $this->traceAsString;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setAsString(?string $asString): self
|
||||
{
|
||||
$this->asString = $asString;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAsString(): string
|
||||
{
|
||||
if (null !== $this->asString) {
|
||||
return $this->asString;
|
||||
}
|
||||
|
||||
$message = '';
|
||||
$next = false;
|
||||
|
||||
foreach (array_reverse(array_merge([$this], $this->getAllPrevious())) as $exception) {
|
||||
if ($next) {
|
||||
$message .= 'Next ';
|
||||
} else {
|
||||
$next = true;
|
||||
}
|
||||
$message .= $exception->getClass();
|
||||
|
||||
if ('' != $exception->getMessage()) {
|
||||
$message .= ': '.$exception->getMessage();
|
||||
}
|
||||
|
||||
$message .= ' in '.$exception->getFile().':'.$exception->getLine().
|
||||
"\nStack trace:\n".$exception->getTraceAsString()."\n\n";
|
||||
}
|
||||
|
||||
return rtrim($message);
|
||||
}
|
||||
}
|
67
vendor/symfony/error-handler/Exception/SilencedErrorContext.php
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Exception;
|
||||
|
||||
/**
|
||||
* Data Object that represents a Silenced Error.
|
||||
*
|
||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||
*/
|
||||
class SilencedErrorContext implements \JsonSerializable
|
||||
{
|
||||
public $count = 1;
|
||||
|
||||
private $severity;
|
||||
private $file;
|
||||
private $line;
|
||||
private $trace;
|
||||
|
||||
public function __construct(int $severity, string $file, int $line, array $trace = [], int $count = 1)
|
||||
{
|
||||
$this->severity = $severity;
|
||||
$this->file = $file;
|
||||
$this->line = $line;
|
||||
$this->trace = $trace;
|
||||
$this->count = $count;
|
||||
}
|
||||
|
||||
public function getSeverity(): int
|
||||
{
|
||||
return $this->severity;
|
||||
}
|
||||
|
||||
public function getFile(): string
|
||||
{
|
||||
return $this->file;
|
||||
}
|
||||
|
||||
public function getLine(): int
|
||||
{
|
||||
return $this->line;
|
||||
}
|
||||
|
||||
public function getTrace(): array
|
||||
{
|
||||
return $this->trace;
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return [
|
||||
'severity' => $this->severity,
|
||||
'file' => $this->file,
|
||||
'line' => $this->line,
|
||||
'trace' => $this->trace,
|
||||
'count' => $this->count,
|
||||
];
|
||||
}
|
||||
}
|
1640
vendor/symfony/error-handler/Internal/TentativeTypes.php
vendored
Normal file
@ -0,0 +1,1640 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Internal;
|
||||
|
||||
/**
|
||||
* This class has been generated by extract-tentative-return-types.php.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class TentativeTypes
|
||||
{
|
||||
public const RETURN_TYPES = [
|
||||
'CURLFile' => [
|
||||
'getFilename' => 'string',
|
||||
'getMimeType' => 'string',
|
||||
'getPostFilename' => 'string',
|
||||
'setMimeType' => 'void',
|
||||
'setPostFilename' => 'void',
|
||||
],
|
||||
'DateTimeInterface' => [
|
||||
'format' => 'string',
|
||||
'getTimezone' => 'DateTimeZone|false',
|
||||
'getOffset' => 'int',
|
||||
'getTimestamp' => 'int',
|
||||
'diff' => 'DateInterval',
|
||||
'__wakeup' => 'void',
|
||||
],
|
||||
'DateTime' => [
|
||||
'__wakeup' => 'void',
|
||||
'__set_state' => 'DateTime',
|
||||
'createFromImmutable' => 'DateTime',
|
||||
'createFromFormat' => 'DateTime|false',
|
||||
'getLastErrors' => 'array|false',
|
||||
'format' => 'string',
|
||||
'modify' => 'DateTime|false',
|
||||
'add' => 'DateTime',
|
||||
'sub' => 'DateTime',
|
||||
'getTimezone' => 'DateTimeZone|false',
|
||||
'setTimezone' => 'DateTime',
|
||||
'getOffset' => 'int',
|
||||
'setTime' => 'DateTime',
|
||||
'setDate' => 'DateTime',
|
||||
'setISODate' => 'DateTime',
|
||||
'setTimestamp' => 'DateTime',
|
||||
'getTimestamp' => 'int',
|
||||
'diff' => 'DateInterval',
|
||||
],
|
||||
'DateTimeImmutable' => [
|
||||
'__wakeup' => 'void',
|
||||
'__set_state' => 'DateTimeImmutable',
|
||||
'createFromFormat' => 'DateTimeImmutable|false',
|
||||
'getLastErrors' => 'array|false',
|
||||
'format' => 'string',
|
||||
'getTimezone' => 'DateTimeZone|false',
|
||||
'getOffset' => 'int',
|
||||
'getTimestamp' => 'int',
|
||||
'diff' => 'DateInterval',
|
||||
'modify' => 'DateTimeImmutable|false',
|
||||
'add' => 'DateTimeImmutable',
|
||||
'sub' => 'DateTimeImmutable',
|
||||
'setTimezone' => 'DateTimeImmutable',
|
||||
'setTime' => 'DateTimeImmutable',
|
||||
'setDate' => 'DateTimeImmutable',
|
||||
'setISODate' => 'DateTimeImmutable',
|
||||
'setTimestamp' => 'DateTimeImmutable',
|
||||
'createFromMutable' => 'DateTimeImmutable',
|
||||
],
|
||||
'DateTimeZone' => [
|
||||
'getName' => 'string',
|
||||
'getOffset' => 'int',
|
||||
'getTransitions' => 'array|false',
|
||||
'getLocation' => 'array|false',
|
||||
'listAbbreviations' => 'array',
|
||||
'listIdentifiers' => 'array',
|
||||
'__wakeup' => 'void',
|
||||
'__set_state' => 'DateTimeZone',
|
||||
],
|
||||
'DateInterval' => [
|
||||
'createFromDateString' => 'DateInterval|false',
|
||||
'format' => 'string',
|
||||
'__wakeup' => 'void',
|
||||
'__set_state' => 'DateInterval',
|
||||
],
|
||||
'DatePeriod' => [
|
||||
'getStartDate' => 'DateTimeInterface',
|
||||
'getEndDate' => '?DateTimeInterface',
|
||||
'getDateInterval' => 'DateInterval',
|
||||
'getRecurrences' => '?int',
|
||||
'__wakeup' => 'void',
|
||||
'__set_state' => 'DatePeriod',
|
||||
],
|
||||
'DOMNode' => [
|
||||
'C14N' => 'string|false',
|
||||
'C14NFile' => 'int|false',
|
||||
'getLineNo' => 'int',
|
||||
'getNodePath' => '?string',
|
||||
'hasAttributes' => 'bool',
|
||||
'hasChildNodes' => 'bool',
|
||||
'isDefaultNamespace' => 'bool',
|
||||
'isSameNode' => 'bool',
|
||||
'isSupported' => 'bool',
|
||||
'lookupNamespaceURI' => '?string',
|
||||
'lookupPrefix' => '?string',
|
||||
'normalize' => 'void',
|
||||
],
|
||||
'DOMImplementation' => [
|
||||
'getFeature' => 'never',
|
||||
'hasFeature' => 'bool',
|
||||
],
|
||||
'DOMDocumentFragment' => [
|
||||
'appendXML' => 'bool',
|
||||
],
|
||||
'DOMNodeList' => [
|
||||
'count' => 'int',
|
||||
],
|
||||
'DOMCharacterData' => [
|
||||
'appendData' => 'bool',
|
||||
'insertData' => 'bool',
|
||||
'deleteData' => 'bool',
|
||||
'replaceData' => 'bool',
|
||||
],
|
||||
'DOMAttr' => [
|
||||
'isId' => 'bool',
|
||||
],
|
||||
'DOMElement' => [
|
||||
'getAttribute' => 'string',
|
||||
'getAttributeNS' => 'string',
|
||||
'getElementsByTagName' => 'DOMNodeList',
|
||||
'getElementsByTagNameNS' => 'DOMNodeList',
|
||||
'hasAttribute' => 'bool',
|
||||
'hasAttributeNS' => 'bool',
|
||||
'removeAttribute' => 'bool',
|
||||
'removeAttributeNS' => 'void',
|
||||
'setAttributeNS' => 'void',
|
||||
'setIdAttribute' => 'void',
|
||||
'setIdAttributeNS' => 'void',
|
||||
'setIdAttributeNode' => 'void',
|
||||
],
|
||||
'DOMDocument' => [
|
||||
'createComment' => 'DOMComment',
|
||||
'createDocumentFragment' => 'DOMDocumentFragment',
|
||||
'createTextNode' => 'DOMText',
|
||||
'getElementById' => '?DOMElement',
|
||||
'getElementsByTagName' => 'DOMNodeList',
|
||||
'getElementsByTagNameNS' => 'DOMNodeList',
|
||||
'normalizeDocument' => 'void',
|
||||
'registerNodeClass' => 'bool',
|
||||
'save' => 'int|false',
|
||||
'saveHTML' => 'string|false',
|
||||
'saveHTMLFile' => 'int|false',
|
||||
'saveXML' => 'string|false',
|
||||
'schemaValidate' => 'bool',
|
||||
'schemaValidateSource' => 'bool',
|
||||
'relaxNGValidate' => 'bool',
|
||||
'relaxNGValidateSource' => 'bool',
|
||||
'validate' => 'bool',
|
||||
'xinclude' => 'int|false',
|
||||
],
|
||||
'DOMText' => [
|
||||
'isWhitespaceInElementContent' => 'bool',
|
||||
'isElementContentWhitespace' => 'bool',
|
||||
],
|
||||
'DOMNamedNodeMap' => [
|
||||
'getNamedItem' => '?DOMNode',
|
||||
'getNamedItemNS' => '?DOMNode',
|
||||
'item' => '?DOMNode',
|
||||
'count' => 'int',
|
||||
],
|
||||
'DOMXPath' => [
|
||||
'evaluate' => 'mixed',
|
||||
'query' => 'mixed',
|
||||
'registerNamespace' => 'bool',
|
||||
'registerPhpFunctions' => 'void',
|
||||
],
|
||||
'finfo' => [
|
||||
'file' => 'string|false',
|
||||
'buffer' => 'string|false',
|
||||
],
|
||||
'IntlPartsIterator' => [
|
||||
'getBreakIterator' => 'IntlBreakIterator',
|
||||
'getRuleStatus' => 'int',
|
||||
],
|
||||
'IntlBreakIterator' => [
|
||||
'createCharacterInstance' => '?IntlBreakIterator',
|
||||
'createCodePointInstance' => 'IntlCodePointBreakIterator',
|
||||
'createLineInstance' => '?IntlBreakIterator',
|
||||
'createSentenceInstance' => '?IntlBreakIterator',
|
||||
'createTitleInstance' => '?IntlBreakIterator',
|
||||
'createWordInstance' => '?IntlBreakIterator',
|
||||
'current' => 'int',
|
||||
'first' => 'int',
|
||||
'following' => 'int',
|
||||
'getErrorCode' => 'int',
|
||||
'getErrorMessage' => 'string',
|
||||
'getLocale' => 'string|false',
|
||||
'getPartsIterator' => 'IntlPartsIterator',
|
||||
'getText' => '?string',
|
||||
'isBoundary' => 'bool',
|
||||
'last' => 'int',
|
||||
'next' => 'int',
|
||||
'preceding' => 'int',
|
||||
'previous' => 'int',
|
||||
'setText' => '?bool',
|
||||
],
|
||||
'IntlRuleBasedBreakIterator' => [
|
||||
'getBinaryRules' => 'string|false',
|
||||
'getRules' => 'string|false',
|
||||
'getRuleStatus' => 'int',
|
||||
'getRuleStatusVec' => 'array|false',
|
||||
],
|
||||
'IntlCodePointBreakIterator' => [
|
||||
'getLastCodePoint' => 'int',
|
||||
],
|
||||
'IntlCalendar' => [
|
||||
'createInstance' => '?IntlCalendar',
|
||||
'equals' => 'bool',
|
||||
'fieldDifference' => 'int|false',
|
||||
'add' => 'bool',
|
||||
'after' => 'bool',
|
||||
'before' => 'bool',
|
||||
'fromDateTime' => '?IntlCalendar',
|
||||
'get' => 'int|false',
|
||||
'getActualMaximum' => 'int|false',
|
||||
'getActualMinimum' => 'int|false',
|
||||
'getAvailableLocales' => 'array',
|
||||
'getDayOfWeekType' => 'int|false',
|
||||
'getErrorCode' => 'int|false',
|
||||
'getErrorMessage' => 'string|false',
|
||||
'getFirstDayOfWeek' => 'int|false',
|
||||
'getGreatestMinimum' => 'int|false',
|
||||
'getKeywordValuesForLocale' => 'IntlIterator|false',
|
||||
'getLeastMaximum' => 'int|false',
|
||||
'getLocale' => 'string|false',
|
||||
'getMaximum' => 'int|false',
|
||||
'getMinimalDaysInFirstWeek' => 'int|false',
|
||||
'getMinimum' => 'int|false',
|
||||
'getNow' => 'float',
|
||||
'getRepeatedWallTimeOption' => 'int',
|
||||
'getSkippedWallTimeOption' => 'int',
|
||||
'getTime' => 'float|false',
|
||||
'getTimeZone' => 'IntlTimeZone|false',
|
||||
'getType' => 'string',
|
||||
'getWeekendTransition' => 'int|false',
|
||||
'inDaylightTime' => 'bool',
|
||||
'isEquivalentTo' => 'bool',
|
||||
'isLenient' => 'bool',
|
||||
'isWeekend' => 'bool',
|
||||
'roll' => 'bool',
|
||||
'isSet' => 'bool',
|
||||
'setTime' => 'bool',
|
||||
'setTimeZone' => 'bool',
|
||||
'toDateTime' => 'DateTime|false',
|
||||
],
|
||||
'IntlGregorianCalendar' => [
|
||||
'setGregorianChange' => 'bool',
|
||||
'getGregorianChange' => 'float',
|
||||
'isLeapYear' => 'bool',
|
||||
],
|
||||
'Collator' => [
|
||||
'create' => '?Collator',
|
||||
'compare' => 'int|false',
|
||||
'sort' => 'bool',
|
||||
'sortWithSortKeys' => 'bool',
|
||||
'asort' => 'bool',
|
||||
'getAttribute' => 'int|false',
|
||||
'setAttribute' => 'bool',
|
||||
'getStrength' => 'int',
|
||||
'getLocale' => 'string|false',
|
||||
'getErrorCode' => 'int|false',
|
||||
'getErrorMessage' => 'string|false',
|
||||
'getSortKey' => 'string|false',
|
||||
],
|
||||
'IntlIterator' => [
|
||||
'current' => 'mixed',
|
||||
'key' => 'mixed',
|
||||
'next' => 'void',
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
],
|
||||
'UConverter' => [
|
||||
'convert' => 'string|false',
|
||||
'fromUCallback' => 'string|int|array|null',
|
||||
'getAliases' => 'array|false|null',
|
||||
'getAvailable' => 'array',
|
||||
'getDestinationEncoding' => 'string|false|null',
|
||||
'getDestinationType' => 'int|false|null',
|
||||
'getErrorCode' => 'int',
|
||||
'getErrorMessage' => '?string',
|
||||
'getSourceEncoding' => 'string|false|null',
|
||||
'getSourceType' => 'int|false|null',
|
||||
'getStandards' => '?array',
|
||||
'getSubstChars' => 'string|false|null',
|
||||
'reasonText' => 'string',
|
||||
'setDestinationEncoding' => 'bool',
|
||||
'setSourceEncoding' => 'bool',
|
||||
'setSubstChars' => 'bool',
|
||||
'toUCallback' => 'string|int|array|null',
|
||||
'transcode' => 'string|false',
|
||||
],
|
||||
'IntlDateFormatter' => [
|
||||
'create' => '?IntlDateFormatter',
|
||||
'getDateType' => 'int|false',
|
||||
'getTimeType' => 'int|false',
|
||||
'getCalendar' => 'int|false',
|
||||
'setCalendar' => 'bool',
|
||||
'getTimeZoneId' => 'string|false',
|
||||
'getCalendarObject' => 'IntlCalendar|false|null',
|
||||
'getTimeZone' => 'IntlTimeZone|false',
|
||||
'setTimeZone' => '?bool',
|
||||
'setPattern' => 'bool',
|
||||
'getPattern' => 'string|false',
|
||||
'getLocale' => 'string|false',
|
||||
'setLenient' => 'void',
|
||||
'isLenient' => 'bool',
|
||||
'format' => 'string|false',
|
||||
'formatObject' => 'string|false',
|
||||
'parse' => 'int|float|false',
|
||||
'localtime' => 'array|false',
|
||||
'getErrorCode' => 'int',
|
||||
'getErrorMessage' => 'string',
|
||||
],
|
||||
'NumberFormatter' => [
|
||||
'create' => '?NumberFormatter',
|
||||
'format' => 'string|false',
|
||||
'parse' => 'int|float|false',
|
||||
'formatCurrency' => 'string|false',
|
||||
'parseCurrency' => 'float|false',
|
||||
'setAttribute' => 'bool',
|
||||
'getAttribute' => 'int|float|false',
|
||||
'setTextAttribute' => 'bool',
|
||||
'getTextAttribute' => 'string|false',
|
||||
'setSymbol' => 'bool',
|
||||
'getSymbol' => 'string|false',
|
||||
'setPattern' => 'bool',
|
||||
'getPattern' => 'string|false',
|
||||
'getLocale' => 'string|false',
|
||||
'getErrorCode' => 'int',
|
||||
'getErrorMessage' => 'string',
|
||||
],
|
||||
'Locale' => [
|
||||
'getDefault' => 'string',
|
||||
'getPrimaryLanguage' => '?string',
|
||||
'getScript' => '?string',
|
||||
'getRegion' => '?string',
|
||||
'getKeywords' => 'array|false|null',
|
||||
'getDisplayScript' => 'string|false',
|
||||
'getDisplayRegion' => 'string|false',
|
||||
'getDisplayName' => 'string|false',
|
||||
'getDisplayLanguage' => 'string|false',
|
||||
'getDisplayVariant' => 'string|false',
|
||||
'composeLocale' => 'string|false',
|
||||
'parseLocale' => '?array',
|
||||
'getAllVariants' => '?array',
|
||||
'filterMatches' => '?bool',
|
||||
'lookup' => '?string',
|
||||
'canonicalize' => '?string',
|
||||
'acceptFromHttp' => 'string|false',
|
||||
],
|
||||
'MessageFormatter' => [
|
||||
'create' => '?MessageFormatter',
|
||||
'format' => 'string|false',
|
||||
'formatMessage' => 'string|false',
|
||||
'parse' => 'array|false',
|
||||
'parseMessage' => 'array|false',
|
||||
'setPattern' => 'bool',
|
||||
'getPattern' => 'string|false',
|
||||
'getLocale' => 'string',
|
||||
'getErrorCode' => 'int',
|
||||
'getErrorMessage' => 'string',
|
||||
],
|
||||
'Normalizer' => [
|
||||
'normalize' => 'string|false',
|
||||
'isNormalized' => 'bool',
|
||||
'getRawDecomposition' => '?string',
|
||||
],
|
||||
'ResourceBundle' => [
|
||||
'create' => '?ResourceBundle',
|
||||
'get' => 'mixed',
|
||||
'count' => 'int',
|
||||
'getLocales' => 'array|false',
|
||||
'getErrorCode' => 'int',
|
||||
'getErrorMessage' => 'string',
|
||||
],
|
||||
'Spoofchecker' => [
|
||||
'isSuspicious' => 'bool',
|
||||
'areConfusable' => 'bool',
|
||||
'setAllowedLocales' => 'void',
|
||||
'setChecks' => 'void',
|
||||
'setRestrictionLevel' => 'void',
|
||||
],
|
||||
'IntlTimeZone' => [
|
||||
'countEquivalentIDs' => 'int|false',
|
||||
'createDefault' => 'IntlTimeZone',
|
||||
'createEnumeration' => 'IntlIterator|false',
|
||||
'createTimeZone' => '?IntlTimeZone',
|
||||
'createTimeZoneIDEnumeration' => 'IntlIterator|false',
|
||||
'fromDateTimeZone' => '?IntlTimeZone',
|
||||
'getCanonicalID' => 'string|false',
|
||||
'getDisplayName' => 'string|false',
|
||||
'getDSTSavings' => 'int',
|
||||
'getEquivalentID' => 'string|false',
|
||||
'getErrorCode' => 'int|false',
|
||||
'getErrorMessage' => 'string|false',
|
||||
'getGMT' => 'IntlTimeZone',
|
||||
'getID' => 'string|false',
|
||||
'getOffset' => 'bool',
|
||||
'getRawOffset' => 'int',
|
||||
'getRegion' => 'string|false',
|
||||
'getTZDataVersion' => 'string|false',
|
||||
'getUnknown' => 'IntlTimeZone',
|
||||
'getWindowsID' => 'string|false',
|
||||
'getIDForWindowsID' => 'string|false',
|
||||
'hasSameRules' => 'bool',
|
||||
'toDateTimeZone' => 'DateTimeZone|false',
|
||||
'useDaylightTime' => 'bool',
|
||||
],
|
||||
'Transliterator' => [
|
||||
'create' => '?Transliterator',
|
||||
'createFromRules' => '?Transliterator',
|
||||
'createInverse' => '?Transliterator',
|
||||
'listIDs' => 'array|false',
|
||||
'transliterate' => 'string|false',
|
||||
'getErrorCode' => 'int|false',
|
||||
'getErrorMessage' => 'string|false',
|
||||
],
|
||||
'IntlChar' => [
|
||||
'hasBinaryProperty' => '?bool',
|
||||
'charAge' => '?array',
|
||||
'charDigitValue' => '?int',
|
||||
'charDirection' => '?int',
|
||||
'charFromName' => '?int',
|
||||
'charMirror' => 'int|string|null',
|
||||
'charName' => '?string',
|
||||
'charType' => '?int',
|
||||
'chr' => '?string',
|
||||
'digit' => 'int|false|null',
|
||||
'enumCharNames' => '?bool',
|
||||
'enumCharTypes' => 'void',
|
||||
'foldCase' => 'int|string|null',
|
||||
'forDigit' => 'int',
|
||||
'getBidiPairedBracket' => 'int|string|null',
|
||||
'getBlockCode' => '?int',
|
||||
'getCombiningClass' => '?int',
|
||||
'getFC_NFKC_Closure' => 'string|false|null',
|
||||
'getIntPropertyMaxValue' => 'int',
|
||||
'getIntPropertyMinValue' => 'int',
|
||||
'getIntPropertyValue' => '?int',
|
||||
'getNumericValue' => '?float',
|
||||
'getPropertyEnum' => 'int',
|
||||
'getPropertyName' => 'string|false',
|
||||
'getPropertyValueEnum' => 'int',
|
||||
'getPropertyValueName' => 'string|false',
|
||||
'getUnicodeVersion' => 'array',
|
||||
'isalnum' => '?bool',
|
||||
'isalpha' => '?bool',
|
||||
'isbase' => '?bool',
|
||||
'isblank' => '?bool',
|
||||
'iscntrl' => '?bool',
|
||||
'isdefined' => '?bool',
|
||||
'isdigit' => '?bool',
|
||||
'isgraph' => '?bool',
|
||||
'isIDIgnorable' => '?bool',
|
||||
'isIDPart' => '?bool',
|
||||
'isIDStart' => '?bool',
|
||||
'isISOControl' => '?bool',
|
||||
'isJavaIDPart' => '?bool',
|
||||
'isJavaIDStart' => '?bool',
|
||||
'isJavaSpaceChar' => '?bool',
|
||||
'islower' => '?bool',
|
||||
'isMirrored' => '?bool',
|
||||
'isprint' => '?bool',
|
||||
'ispunct' => '?bool',
|
||||
'isspace' => '?bool',
|
||||
'istitle' => '?bool',
|
||||
'isUAlphabetic' => '?bool',
|
||||
'isULowercase' => '?bool',
|
||||
'isupper' => '?bool',
|
||||
'isUUppercase' => '?bool',
|
||||
'isUWhiteSpace' => '?bool',
|
||||
'isWhitespace' => '?bool',
|
||||
'isxdigit' => '?bool',
|
||||
'ord' => '?int',
|
||||
'tolower' => 'int|string|null',
|
||||
'totitle' => 'int|string|null',
|
||||
'toupper' => 'int|string|null',
|
||||
],
|
||||
'JsonSerializable' => [
|
||||
'jsonSerialize' => 'mixed',
|
||||
],
|
||||
'mysqli' => [
|
||||
'autocommit' => 'bool',
|
||||
'begin_transaction' => 'bool',
|
||||
'change_user' => 'bool',
|
||||
'character_set_name' => 'string',
|
||||
'commit' => 'bool',
|
||||
'connect' => 'bool',
|
||||
'dump_debug_info' => 'bool',
|
||||
'get_charset' => '?object',
|
||||
'get_client_info' => 'string',
|
||||
'get_connection_stats' => 'array',
|
||||
'get_server_info' => 'string',
|
||||
'get_warnings' => 'mysqli_warning|false',
|
||||
'kill' => 'bool',
|
||||
'multi_query' => 'bool',
|
||||
'more_results' => 'bool',
|
||||
'next_result' => 'bool',
|
||||
'ping' => 'bool',
|
||||
'poll' => 'int|false',
|
||||
'prepare' => 'mysqli_stmt|false',
|
||||
'query' => 'mysqli_result|bool',
|
||||
'real_connect' => 'bool',
|
||||
'real_escape_string' => 'string',
|
||||
'reap_async_query' => 'mysqli_result|bool',
|
||||
'escape_string' => 'string',
|
||||
'real_query' => 'bool',
|
||||
'release_savepoint' => 'bool',
|
||||
'rollback' => 'bool',
|
||||
'savepoint' => 'bool',
|
||||
'select_db' => 'bool',
|
||||
'set_charset' => 'bool',
|
||||
'options' => 'bool',
|
||||
'set_opt' => 'bool',
|
||||
'stat' => 'string|false',
|
||||
'stmt_init' => 'mysqli_stmt|false',
|
||||
'store_result' => 'mysqli_result|false',
|
||||
'thread_safe' => 'bool',
|
||||
'use_result' => 'mysqli_result|false',
|
||||
'refresh' => 'bool',
|
||||
],
|
||||
'mysqli_result' => [
|
||||
'close' => 'void',
|
||||
'free' => 'void',
|
||||
'data_seek' => 'bool',
|
||||
'fetch_field' => 'object|false',
|
||||
'fetch_fields' => 'array',
|
||||
'fetch_field_direct' => 'object|false',
|
||||
'fetch_all' => 'array',
|
||||
'fetch_array' => 'array|null|false',
|
||||
'fetch_assoc' => 'array|null|false',
|
||||
'fetch_object' => 'object|null|false',
|
||||
'fetch_row' => 'array|null|false',
|
||||
'field_seek' => 'bool',
|
||||
'free_result' => 'void',
|
||||
],
|
||||
'mysqli_stmt' => [
|
||||
'attr_get' => 'int',
|
||||
'attr_set' => 'bool',
|
||||
'bind_param' => 'bool',
|
||||
'bind_result' => 'bool',
|
||||
'data_seek' => 'void',
|
||||
'execute' => 'bool',
|
||||
'fetch' => '?bool',
|
||||
'get_warnings' => 'mysqli_warning|false',
|
||||
'result_metadata' => 'mysqli_result|false',
|
||||
'more_results' => 'bool',
|
||||
'next_result' => 'bool',
|
||||
'num_rows' => 'int|string',
|
||||
'send_long_data' => 'bool',
|
||||
'free_result' => 'void',
|
||||
'reset' => 'bool',
|
||||
'prepare' => 'bool',
|
||||
'store_result' => 'bool',
|
||||
'get_result' => 'mysqli_result|false',
|
||||
],
|
||||
'OCILob' => [
|
||||
'save' => 'bool',
|
||||
'import' => 'bool',
|
||||
'saveFile' => 'bool',
|
||||
'load' => 'string|false',
|
||||
'read' => 'string|false',
|
||||
'eof' => 'bool',
|
||||
'tell' => 'int|false',
|
||||
'rewind' => 'bool',
|
||||
'seek' => 'bool',
|
||||
'size' => 'int|false',
|
||||
'write' => 'int|false',
|
||||
'append' => 'bool',
|
||||
'truncate' => 'bool',
|
||||
'erase' => 'int|false',
|
||||
'flush' => 'bool',
|
||||
'setBuffering' => 'bool',
|
||||
'getBuffering' => 'bool',
|
||||
'writeToFile' => 'bool',
|
||||
'export' => 'bool',
|
||||
'writeTemporary' => 'bool',
|
||||
'close' => 'bool',
|
||||
'free' => 'bool',
|
||||
],
|
||||
'OCICollection' => [
|
||||
'free' => 'bool',
|
||||
'append' => 'bool',
|
||||
'getElem' => 'string|float|null|false',
|
||||
'assign' => 'bool',
|
||||
'assignElem' => 'bool',
|
||||
'size' => 'int|false',
|
||||
'max' => 'int|false',
|
||||
'trim' => 'bool',
|
||||
],
|
||||
'PDO' => [
|
||||
'beginTransaction' => 'bool',
|
||||
'commit' => 'bool',
|
||||
'errorCode' => '?string',
|
||||
'errorInfo' => 'array',
|
||||
'exec' => 'int|false',
|
||||
'getAttribute' => 'mixed',
|
||||
'getAvailableDrivers' => 'array',
|
||||
'inTransaction' => 'bool',
|
||||
'lastInsertId' => 'string|false',
|
||||
'prepare' => 'PDOStatement|false',
|
||||
'query' => 'PDOStatement|false',
|
||||
'quote' => 'string|false',
|
||||
'rollBack' => 'bool',
|
||||
'setAttribute' => 'bool',
|
||||
],
|
||||
'PDOStatement' => [
|
||||
'bindColumn' => 'bool',
|
||||
'bindParam' => 'bool',
|
||||
'bindValue' => 'bool',
|
||||
'closeCursor' => 'bool',
|
||||
'columnCount' => 'int',
|
||||
'debugDumpParams' => '?bool',
|
||||
'errorCode' => '?string',
|
||||
'errorInfo' => 'array',
|
||||
'execute' => 'bool',
|
||||
'fetch' => 'mixed',
|
||||
'fetchAll' => 'array',
|
||||
'fetchColumn' => 'mixed',
|
||||
'fetchObject' => 'object|false',
|
||||
'getAttribute' => 'mixed',
|
||||
'getColumnMeta' => 'array|false',
|
||||
'nextRowset' => 'bool',
|
||||
'rowCount' => 'int',
|
||||
'setAttribute' => 'bool',
|
||||
],
|
||||
'PDO_PGSql_Ext' => [
|
||||
'pgsqlCopyFromArray' => 'bool',
|
||||
'pgsqlCopyFromFile' => 'bool',
|
||||
'pgsqlCopyToArray' => 'array|false',
|
||||
'pgsqlCopyToFile' => 'bool',
|
||||
'pgsqlLOBCreate' => 'string|false',
|
||||
'pgsqlLOBUnlink' => 'bool',
|
||||
'pgsqlGetNotify' => 'array|false',
|
||||
'pgsqlGetPid' => 'int',
|
||||
],
|
||||
'PDO_SQLite_Ext' => [
|
||||
'sqliteCreateFunction' => 'bool',
|
||||
'sqliteCreateAggregate' => 'bool',
|
||||
'sqliteCreateCollation' => 'bool',
|
||||
],
|
||||
'Phar' => [
|
||||
'addEmptyDir' => 'void',
|
||||
'addFile' => 'void',
|
||||
'addFromString' => 'void',
|
||||
'buildFromDirectory' => 'array',
|
||||
'buildFromIterator' => 'array',
|
||||
'compressFiles' => 'void',
|
||||
'compress' => '?Phar',
|
||||
'decompress' => '?Phar',
|
||||
'convertToExecutable' => '?Phar',
|
||||
'convertToData' => '?PharData',
|
||||
'count' => 'int',
|
||||
'extractTo' => 'bool',
|
||||
'getAlias' => '?string',
|
||||
'getPath' => 'string',
|
||||
'getMetadata' => 'mixed',
|
||||
'getModified' => 'bool',
|
||||
'getSignature' => 'array|false',
|
||||
'getStub' => 'string',
|
||||
'getVersion' => 'string',
|
||||
'hasMetadata' => 'bool',
|
||||
'isBuffering' => 'bool',
|
||||
'isCompressed' => 'int|false',
|
||||
'isFileFormat' => 'bool',
|
||||
'isWritable' => 'bool',
|
||||
'offsetExists' => 'bool',
|
||||
'offsetGet' => 'SplFileInfo',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
'setAlias' => 'bool',
|
||||
'setDefaultStub' => 'bool',
|
||||
'setMetadata' => 'void',
|
||||
'setSignatureAlgorithm' => 'void',
|
||||
'startBuffering' => 'void',
|
||||
'stopBuffering' => 'void',
|
||||
],
|
||||
'PharData' => [
|
||||
'addEmptyDir' => 'void',
|
||||
'addFile' => 'void',
|
||||
'addFromString' => 'void',
|
||||
'buildFromDirectory' => 'array',
|
||||
'buildFromIterator' => 'array',
|
||||
'compressFiles' => 'void',
|
||||
'compress' => '?PharData',
|
||||
'decompress' => '?PharData',
|
||||
'convertToExecutable' => '?Phar',
|
||||
'convertToData' => '?PharData',
|
||||
'count' => 'int',
|
||||
'extractTo' => 'bool',
|
||||
'getAlias' => '?string',
|
||||
'getPath' => 'string',
|
||||
'getMetadata' => 'mixed',
|
||||
'getModified' => 'bool',
|
||||
'getSignature' => 'array|false',
|
||||
'getStub' => 'string',
|
||||
'getVersion' => 'string',
|
||||
'hasMetadata' => 'bool',
|
||||
'isBuffering' => 'bool',
|
||||
'isCompressed' => 'int|false',
|
||||
'isFileFormat' => 'bool',
|
||||
'isWritable' => 'bool',
|
||||
'offsetExists' => 'bool',
|
||||
'offsetGet' => 'SplFileInfo',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
'setAlias' => 'bool',
|
||||
'setDefaultStub' => 'bool',
|
||||
'setMetadata' => 'void',
|
||||
'setSignatureAlgorithm' => 'void',
|
||||
'startBuffering' => 'void',
|
||||
'stopBuffering' => 'void',
|
||||
],
|
||||
'PharFileInfo' => [
|
||||
'chmod' => 'void',
|
||||
'getCompressedSize' => 'int',
|
||||
'getCRC32' => 'int',
|
||||
'getContent' => 'string',
|
||||
'getMetadata' => 'mixed',
|
||||
'getPharFlags' => 'int',
|
||||
'hasMetadata' => 'bool',
|
||||
'isCompressed' => 'bool',
|
||||
'isCRCChecked' => 'bool',
|
||||
'setMetadata' => 'void',
|
||||
],
|
||||
'Reflection' => [
|
||||
'getModifierNames' => 'array',
|
||||
],
|
||||
'ReflectionFunctionAbstract' => [
|
||||
'inNamespace' => 'bool',
|
||||
'isClosure' => 'bool',
|
||||
'isDeprecated' => 'bool',
|
||||
'isInternal' => 'bool',
|
||||
'isUserDefined' => 'bool',
|
||||
'isGenerator' => 'bool',
|
||||
'isVariadic' => 'bool',
|
||||
'isStatic' => 'bool',
|
||||
'getClosureThis' => '?object',
|
||||
'getClosureScopeClass' => '?ReflectionClass',
|
||||
'getDocComment' => 'string|false',
|
||||
'getEndLine' => 'int|false',
|
||||
'getExtension' => '?ReflectionExtension',
|
||||
'getExtensionName' => 'string|false',
|
||||
'getFileName' => 'string|false',
|
||||
'getName' => 'string',
|
||||
'getNamespaceName' => 'string',
|
||||
'getNumberOfParameters' => 'int',
|
||||
'getNumberOfRequiredParameters' => 'int',
|
||||
'getParameters' => 'array',
|
||||
'getShortName' => 'string',
|
||||
'getStartLine' => 'int|false',
|
||||
'getStaticVariables' => 'array',
|
||||
'returnsReference' => 'bool',
|
||||
'hasReturnType' => 'bool',
|
||||
'getReturnType' => '?ReflectionType',
|
||||
],
|
||||
'ReflectionFunction' => [
|
||||
'isDisabled' => 'bool',
|
||||
'invoke' => 'mixed',
|
||||
'invokeArgs' => 'mixed',
|
||||
'getClosure' => 'Closure',
|
||||
'getExecutingLine' => 'int',
|
||||
'getExecutingFile' => 'string',
|
||||
'getTrace' => 'array',
|
||||
'getFunction' => 'ReflectionFunctionAbstract',
|
||||
'getThis' => '?object',
|
||||
'getExecutingGenerator' => 'Generator',
|
||||
],
|
||||
'ReflectionMethod' => [
|
||||
'isPublic' => 'bool',
|
||||
'isPrivate' => 'bool',
|
||||
'isProtected' => 'bool',
|
||||
'isAbstract' => 'bool',
|
||||
'isFinal' => 'bool',
|
||||
'isConstructor' => 'bool',
|
||||
'isDestructor' => 'bool',
|
||||
'getClosure' => 'Closure',
|
||||
'getModifiers' => 'int',
|
||||
'invoke' => 'mixed',
|
||||
'invokeArgs' => 'mixed',
|
||||
'getDeclaringClass' => 'ReflectionClass',
|
||||
'getPrototype' => 'ReflectionMethod',
|
||||
'setAccessible' => 'void',
|
||||
],
|
||||
'ReflectionClass' => [
|
||||
'getName' => 'string',
|
||||
'isInternal' => 'bool',
|
||||
'isUserDefined' => 'bool',
|
||||
'isAnonymous' => 'bool',
|
||||
'isInstantiable' => 'bool',
|
||||
'isCloneable' => 'bool',
|
||||
'getFileName' => 'string|false',
|
||||
'getStartLine' => 'int|false',
|
||||
'getEndLine' => 'int|false',
|
||||
'getDocComment' => 'string|false',
|
||||
'getConstructor' => '?ReflectionMethod',
|
||||
'hasMethod' => 'bool',
|
||||
'getMethod' => 'ReflectionMethod',
|
||||
'getMethods' => 'array',
|
||||
'hasProperty' => 'bool',
|
||||
'getProperty' => 'ReflectionProperty',
|
||||
'getProperties' => 'array',
|
||||
'hasConstant' => 'bool',
|
||||
'getConstants' => 'array',
|
||||
'getReflectionConstants' => 'array',
|
||||
'getConstant' => 'mixed',
|
||||
'getReflectionConstant' => 'ReflectionClassConstant|false',
|
||||
'getInterfaces' => 'array',
|
||||
'getInterfaceNames' => 'array',
|
||||
'isInterface' => 'bool',
|
||||
'getTraits' => 'array',
|
||||
'getTraitNames' => 'array',
|
||||
'getTraitAliases' => 'array',
|
||||
'isTrait' => 'bool',
|
||||
'isAbstract' => 'bool',
|
||||
'isFinal' => 'bool',
|
||||
'getModifiers' => 'int',
|
||||
'isInstance' => 'bool',
|
||||
'newInstance' => 'object',
|
||||
'newInstanceWithoutConstructor' => 'object',
|
||||
'newInstanceArgs' => '?object',
|
||||
'getParentClass' => 'ReflectionClass|false',
|
||||
'isSubclassOf' => 'bool',
|
||||
'getStaticProperties' => '?array',
|
||||
'getStaticPropertyValue' => 'mixed',
|
||||
'setStaticPropertyValue' => 'void',
|
||||
'getDefaultProperties' => 'array',
|
||||
'isIterable' => 'bool',
|
||||
'isIterateable' => 'bool',
|
||||
'implementsInterface' => 'bool',
|
||||
'getExtension' => '?ReflectionExtension',
|
||||
'getExtensionName' => 'string|false',
|
||||
'inNamespace' => 'bool',
|
||||
'getNamespaceName' => 'string',
|
||||
'getShortName' => 'string',
|
||||
],
|
||||
'ReflectionProperty' => [
|
||||
'getName' => 'string',
|
||||
'getValue' => 'mixed',
|
||||
'setValue' => 'void',
|
||||
'isInitialized' => 'bool',
|
||||
'isPublic' => 'bool',
|
||||
'isPrivate' => 'bool',
|
||||
'isProtected' => 'bool',
|
||||
'isStatic' => 'bool',
|
||||
'isDefault' => 'bool',
|
||||
'getModifiers' => 'int',
|
||||
'getDeclaringClass' => 'ReflectionClass',
|
||||
'getDocComment' => 'string|false',
|
||||
'setAccessible' => 'void',
|
||||
'getType' => '?ReflectionType',
|
||||
'hasType' => 'bool',
|
||||
'getDefaultValue' => 'mixed',
|
||||
],
|
||||
'ReflectionClassConstant' => [
|
||||
'getName' => 'string',
|
||||
'getValue' => 'mixed',
|
||||
'isPublic' => 'bool',
|
||||
'isPrivate' => 'bool',
|
||||
'isProtected' => 'bool',
|
||||
'getModifiers' => 'int',
|
||||
'getDeclaringClass' => 'ReflectionClass',
|
||||
'getDocComment' => 'string|false',
|
||||
],
|
||||
'ReflectionParameter' => [
|
||||
'getName' => 'string',
|
||||
'isPassedByReference' => 'bool',
|
||||
'canBePassedByValue' => 'bool',
|
||||
'getDeclaringFunction' => 'ReflectionFunctionAbstract',
|
||||
'getDeclaringClass' => '?ReflectionClass',
|
||||
'getClass' => '?ReflectionClass',
|
||||
'hasType' => 'bool',
|
||||
'getType' => '?ReflectionType',
|
||||
'isArray' => 'bool',
|
||||
'isCallable' => 'bool',
|
||||
'allowsNull' => 'bool',
|
||||
'getPosition' => 'int',
|
||||
'isOptional' => 'bool',
|
||||
'isDefaultValueAvailable' => 'bool',
|
||||
'getDefaultValue' => 'mixed',
|
||||
'isDefaultValueConstant' => 'bool',
|
||||
'getDefaultValueConstantName' => '?string',
|
||||
'isVariadic' => 'bool',
|
||||
],
|
||||
'ReflectionType' => [
|
||||
'allowsNull' => 'bool',
|
||||
],
|
||||
'ReflectionNamedType' => [
|
||||
'getName' => 'string',
|
||||
'isBuiltin' => 'bool',
|
||||
],
|
||||
'ReflectionExtension' => [
|
||||
'getName' => 'string',
|
||||
'getVersion' => '?string',
|
||||
'getFunctions' => 'array',
|
||||
'getConstants' => 'array',
|
||||
'getINIEntries' => 'array',
|
||||
'getClasses' => 'array',
|
||||
'getClassNames' => 'array',
|
||||
'getDependencies' => 'array',
|
||||
'info' => 'void',
|
||||
'isPersistent' => 'bool',
|
||||
'isTemporary' => 'bool',
|
||||
],
|
||||
'ReflectionZendExtension' => [
|
||||
'getName' => 'string',
|
||||
'getVersion' => 'string',
|
||||
'getAuthor' => 'string',
|
||||
'getURL' => 'string',
|
||||
'getCopyright' => 'string',
|
||||
],
|
||||
'SessionHandlerInterface' => [
|
||||
'open' => 'bool',
|
||||
'close' => 'bool',
|
||||
'read' => 'string|false',
|
||||
'write' => 'bool',
|
||||
'destroy' => 'bool',
|
||||
'gc' => 'int|false',
|
||||
],
|
||||
'SessionIdInterface' => [
|
||||
'create_sid' => 'string',
|
||||
],
|
||||
'SessionUpdateTimestampHandlerInterface' => [
|
||||
'validateId' => 'bool',
|
||||
'updateTimestamp' => 'bool',
|
||||
],
|
||||
'SessionHandler' => [
|
||||
'open' => 'bool',
|
||||
'close' => 'bool',
|
||||
'read' => 'string|false',
|
||||
'write' => 'bool',
|
||||
'destroy' => 'bool',
|
||||
'gc' => 'int|false',
|
||||
'create_sid' => 'string',
|
||||
],
|
||||
'SimpleXMLElement' => [
|
||||
'xpath' => 'array|null|false',
|
||||
'registerXPathNamespace' => 'bool',
|
||||
'asXML' => 'string|bool',
|
||||
'saveXML' => 'string|bool',
|
||||
'getNamespaces' => 'array',
|
||||
'getDocNamespaces' => 'array|false',
|
||||
'children' => '?SimpleXMLElement',
|
||||
'attributes' => '?SimpleXMLElement',
|
||||
'addChild' => '?SimpleXMLElement',
|
||||
'addAttribute' => 'void',
|
||||
'getName' => 'string',
|
||||
'count' => 'int',
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'current' => 'SimpleXMLElement',
|
||||
'key' => 'string',
|
||||
'next' => 'void',
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => '?SimpleXMLElement',
|
||||
],
|
||||
'SNMP' => [
|
||||
'close' => 'bool',
|
||||
'setSecurity' => 'bool',
|
||||
'get' => 'mixed',
|
||||
'getnext' => 'mixed',
|
||||
'walk' => 'array|false',
|
||||
'set' => 'bool',
|
||||
'getErrno' => 'int',
|
||||
'getError' => 'string',
|
||||
],
|
||||
'SoapServer' => [
|
||||
'fault' => 'void',
|
||||
'addSoapHeader' => 'void',
|
||||
'setPersistence' => 'void',
|
||||
'setClass' => 'void',
|
||||
'setObject' => 'void',
|
||||
'getFunctions' => 'array',
|
||||
'addFunction' => 'void',
|
||||
'handle' => 'void',
|
||||
],
|
||||
'SoapClient' => [
|
||||
'__call' => 'mixed',
|
||||
'__soapCall' => 'mixed',
|
||||
'__getFunctions' => '?array',
|
||||
'__getTypes' => '?array',
|
||||
'__getLastRequest' => '?string',
|
||||
'__getLastResponse' => '?string',
|
||||
'__getLastRequestHeaders' => '?string',
|
||||
'__getLastResponseHeaders' => '?string',
|
||||
'__doRequest' => '?string',
|
||||
'__setCookie' => 'void',
|
||||
'__getCookies' => 'array',
|
||||
'__setSoapHeaders' => 'bool',
|
||||
'__setLocation' => '?string',
|
||||
],
|
||||
'ArrayObject' => [
|
||||
'offsetExists' => 'bool',
|
||||
'offsetGet' => 'mixed',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
'append' => 'void',
|
||||
'getArrayCopy' => 'array',
|
||||
'count' => 'int',
|
||||
'getFlags' => 'int',
|
||||
'setFlags' => 'void',
|
||||
'asort' => 'bool',
|
||||
'ksort' => 'bool',
|
||||
'uasort' => 'bool',
|
||||
'uksort' => 'bool',
|
||||
'natsort' => 'bool',
|
||||
'natcasesort' => 'bool',
|
||||
'unserialize' => 'void',
|
||||
'serialize' => 'string',
|
||||
'__serialize' => 'array',
|
||||
'__unserialize' => 'void',
|
||||
'getIterator' => 'Iterator',
|
||||
'exchangeArray' => 'array',
|
||||
'setIteratorClass' => 'void',
|
||||
'getIteratorClass' => 'string',
|
||||
'__debugInfo' => 'array',
|
||||
],
|
||||
'ArrayIterator' => [
|
||||
'offsetExists' => 'bool',
|
||||
'offsetGet' => 'mixed',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
'append' => 'void',
|
||||
'getArrayCopy' => 'array',
|
||||
'count' => 'int',
|
||||
'getFlags' => 'int',
|
||||
'setFlags' => 'void',
|
||||
'asort' => 'bool',
|
||||
'ksort' => 'bool',
|
||||
'uasort' => 'bool',
|
||||
'uksort' => 'bool',
|
||||
'natsort' => 'bool',
|
||||
'natcasesort' => 'bool',
|
||||
'unserialize' => 'void',
|
||||
'serialize' => 'string',
|
||||
'__serialize' => 'array',
|
||||
'__unserialize' => 'void',
|
||||
'rewind' => 'void',
|
||||
'current' => 'mixed',
|
||||
'key' => 'string|int|null',
|
||||
'next' => 'void',
|
||||
'valid' => 'bool',
|
||||
'seek' => 'void',
|
||||
'__debugInfo' => 'array',
|
||||
],
|
||||
'RecursiveArrayIterator' => [
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => '?RecursiveArrayIterator',
|
||||
],
|
||||
'SplFileInfo' => [
|
||||
'getPath' => 'string',
|
||||
'getFilename' => 'string',
|
||||
'getExtension' => 'string',
|
||||
'getBasename' => 'string',
|
||||
'getPathname' => 'string',
|
||||
'getPerms' => 'int|false',
|
||||
'getInode' => 'int|false',
|
||||
'getSize' => 'int|false',
|
||||
'getOwner' => 'int|false',
|
||||
'getGroup' => 'int|false',
|
||||
'getATime' => 'int|false',
|
||||
'getMTime' => 'int|false',
|
||||
'getCTime' => 'int|false',
|
||||
'getType' => 'string|false',
|
||||
'isWritable' => 'bool',
|
||||
'isReadable' => 'bool',
|
||||
'isExecutable' => 'bool',
|
||||
'isFile' => 'bool',
|
||||
'isDir' => 'bool',
|
||||
'isLink' => 'bool',
|
||||
'getLinkTarget' => 'string|false',
|
||||
'getRealPath' => 'string|false',
|
||||
'getFileInfo' => 'SplFileInfo',
|
||||
'getPathInfo' => '?SplFileInfo',
|
||||
'openFile' => 'SplFileObject',
|
||||
'setFileClass' => 'void',
|
||||
'setInfoClass' => 'void',
|
||||
'__debugInfo' => 'array',
|
||||
'_bad_state_ex' => 'void',
|
||||
],
|
||||
'DirectoryIterator' => [
|
||||
'getFilename' => 'string',
|
||||
'getExtension' => 'string',
|
||||
'getBasename' => 'string',
|
||||
'isDot' => 'bool',
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'next' => 'void',
|
||||
'seek' => 'void',
|
||||
],
|
||||
'FilesystemIterator' => [
|
||||
'rewind' => 'void',
|
||||
'key' => 'string',
|
||||
'current' => 'string|SplFileInfo|FilesystemIterator',
|
||||
'getFlags' => 'int',
|
||||
'setFlags' => 'void',
|
||||
],
|
||||
'RecursiveDirectoryIterator' => [
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => 'RecursiveDirectoryIterator',
|
||||
'getSubPath' => 'string',
|
||||
'getSubPathname' => 'string',
|
||||
],
|
||||
'GlobIterator' => [
|
||||
'count' => 'int',
|
||||
],
|
||||
'SplFileObject' => [
|
||||
'rewind' => 'void',
|
||||
'eof' => 'bool',
|
||||
'valid' => 'bool',
|
||||
'fgets' => 'string',
|
||||
'fread' => 'string|false',
|
||||
'fgetcsv' => 'array|false',
|
||||
'fputcsv' => 'int|false',
|
||||
'setCsvControl' => 'void',
|
||||
'getCsvControl' => 'array',
|
||||
'flock' => 'bool',
|
||||
'fflush' => 'bool',
|
||||
'ftell' => 'int|false',
|
||||
'fseek' => 'int',
|
||||
'fgetc' => 'string|false',
|
||||
'fpassthru' => 'int',
|
||||
'fscanf' => 'array|int|null',
|
||||
'fwrite' => 'int|false',
|
||||
'fstat' => 'array',
|
||||
'ftruncate' => 'bool',
|
||||
'current' => 'string|array|false',
|
||||
'key' => 'int',
|
||||
'next' => 'void',
|
||||
'setFlags' => 'void',
|
||||
'getFlags' => 'int',
|
||||
'setMaxLineLen' => 'void',
|
||||
'getMaxLineLen' => 'int',
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => '?RecursiveIterator',
|
||||
'seek' => 'void',
|
||||
'getCurrentLine' => 'string',
|
||||
],
|
||||
'SplDoublyLinkedList' => [
|
||||
'add' => 'void',
|
||||
'pop' => 'mixed',
|
||||
'shift' => 'mixed',
|
||||
'push' => 'void',
|
||||
'unshift' => 'void',
|
||||
'top' => 'mixed',
|
||||
'bottom' => 'mixed',
|
||||
'__debugInfo' => 'array',
|
||||
'count' => 'int',
|
||||
'isEmpty' => 'bool',
|
||||
'setIteratorMode' => 'int',
|
||||
'getIteratorMode' => 'int',
|
||||
'offsetExists' => 'bool',
|
||||
'offsetGet' => 'mixed',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
'rewind' => 'void',
|
||||
'current' => 'mixed',
|
||||
'key' => 'int',
|
||||
'prev' => 'void',
|
||||
'next' => 'void',
|
||||
'valid' => 'bool',
|
||||
'unserialize' => 'void',
|
||||
'serialize' => 'string',
|
||||
'__serialize' => 'array',
|
||||
'__unserialize' => 'void',
|
||||
],
|
||||
'SplQueue' => [
|
||||
'enqueue' => 'void',
|
||||
'dequeue' => 'mixed',
|
||||
],
|
||||
'SplFixedArray' => [
|
||||
'__wakeup' => 'void',
|
||||
'count' => 'int',
|
||||
'toArray' => 'array',
|
||||
'fromArray' => 'SplFixedArray',
|
||||
'getSize' => 'int',
|
||||
'offsetExists' => 'bool',
|
||||
'offsetGet' => 'mixed',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
],
|
||||
'SplPriorityQueue' => [
|
||||
'compare' => 'int',
|
||||
'setExtractFlags' => 'int',
|
||||
'top' => 'mixed',
|
||||
'extract' => 'mixed',
|
||||
'count' => 'int',
|
||||
'isEmpty' => 'bool',
|
||||
'rewind' => 'void',
|
||||
'current' => 'mixed',
|
||||
'key' => 'int',
|
||||
'next' => 'void',
|
||||
'valid' => 'bool',
|
||||
'isCorrupted' => 'bool',
|
||||
'getExtractFlags' => 'int',
|
||||
'__debugInfo' => 'array',
|
||||
],
|
||||
'SplHeap' => [
|
||||
'extract' => 'mixed',
|
||||
'insert' => 'bool',
|
||||
'top' => 'mixed',
|
||||
'count' => 'int',
|
||||
'isEmpty' => 'bool',
|
||||
'rewind' => 'void',
|
||||
'current' => 'mixed',
|
||||
'key' => 'int',
|
||||
'next' => 'void',
|
||||
'valid' => 'bool',
|
||||
'recoverFromCorruption' => 'bool',
|
||||
'compare' => 'int',
|
||||
'isCorrupted' => 'bool',
|
||||
'__debugInfo' => 'array',
|
||||
],
|
||||
'SplMinHeap' => [
|
||||
'compare' => 'int',
|
||||
],
|
||||
'SplMaxHeap' => [
|
||||
'compare' => 'int',
|
||||
],
|
||||
'EmptyIterator' => [
|
||||
'current' => 'never',
|
||||
'next' => 'void',
|
||||
'key' => 'never',
|
||||
'valid' => 'bool',
|
||||
'rewind' => 'void',
|
||||
],
|
||||
'CallbackFilterIterator' => [
|
||||
'accept' => 'bool',
|
||||
],
|
||||
'RecursiveCallbackFilterIterator' => [
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => 'RecursiveCallbackFilterIterator',
|
||||
],
|
||||
'RecursiveIterator' => [
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => '?RecursiveIterator',
|
||||
],
|
||||
'RecursiveIteratorIterator' => [
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'key' => 'mixed',
|
||||
'current' => 'mixed',
|
||||
'next' => 'void',
|
||||
'getDepth' => 'int',
|
||||
'getSubIterator' => '?RecursiveIterator',
|
||||
'getInnerIterator' => 'RecursiveIterator',
|
||||
'beginIteration' => 'void',
|
||||
'endIteration' => 'void',
|
||||
'callHasChildren' => 'bool',
|
||||
'callGetChildren' => '?RecursiveIterator',
|
||||
'beginChildren' => 'void',
|
||||
'endChildren' => 'void',
|
||||
'nextElement' => 'void',
|
||||
'setMaxDepth' => 'void',
|
||||
'getMaxDepth' => 'int|false',
|
||||
],
|
||||
'OuterIterator' => [
|
||||
'getInnerIterator' => '?Iterator',
|
||||
],
|
||||
'IteratorIterator' => [
|
||||
'getInnerIterator' => '?Iterator',
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'key' => 'mixed',
|
||||
'current' => 'mixed',
|
||||
'next' => 'void',
|
||||
],
|
||||
'FilterIterator' => [
|
||||
'accept' => 'bool',
|
||||
'rewind' => 'void',
|
||||
'next' => 'void',
|
||||
],
|
||||
'RecursiveFilterIterator' => [
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => '?RecursiveFilterIterator',
|
||||
],
|
||||
'ParentIterator' => [
|
||||
'accept' => 'bool',
|
||||
],
|
||||
'SeekableIterator' => [
|
||||
'seek' => 'void',
|
||||
],
|
||||
'LimitIterator' => [
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'next' => 'void',
|
||||
'seek' => 'int',
|
||||
'getPosition' => 'int',
|
||||
],
|
||||
'CachingIterator' => [
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'next' => 'void',
|
||||
'hasNext' => 'bool',
|
||||
'getFlags' => 'int',
|
||||
'setFlags' => 'void',
|
||||
'offsetGet' => 'mixed',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
'offsetExists' => 'bool',
|
||||
'getCache' => 'array',
|
||||
'count' => 'int',
|
||||
],
|
||||
'RecursiveCachingIterator' => [
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => '?RecursiveCachingIterator',
|
||||
],
|
||||
'NoRewindIterator' => [
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'key' => 'mixed',
|
||||
'current' => 'mixed',
|
||||
'next' => 'void',
|
||||
],
|
||||
'AppendIterator' => [
|
||||
'append' => 'void',
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'current' => 'mixed',
|
||||
'next' => 'void',
|
||||
'getIteratorIndex' => '?int',
|
||||
'getArrayIterator' => 'ArrayIterator',
|
||||
],
|
||||
'InfiniteIterator' => [
|
||||
'next' => 'void',
|
||||
],
|
||||
'RegexIterator' => [
|
||||
'accept' => 'bool',
|
||||
'getMode' => 'int',
|
||||
'setMode' => 'void',
|
||||
'getFlags' => 'int',
|
||||
'setFlags' => 'void',
|
||||
'getRegex' => 'string',
|
||||
'getPregFlags' => 'int',
|
||||
'setPregFlags' => 'void',
|
||||
],
|
||||
'RecursiveRegexIterator' => [
|
||||
'accept' => 'bool',
|
||||
'hasChildren' => 'bool',
|
||||
'getChildren' => 'RecursiveRegexIterator',
|
||||
],
|
||||
'RecursiveTreeIterator' => [
|
||||
'key' => 'mixed',
|
||||
'current' => 'mixed',
|
||||
'getPrefix' => 'string',
|
||||
'setPostfix' => 'void',
|
||||
'setPrefixPart' => 'void',
|
||||
'getEntry' => 'string',
|
||||
'getPostfix' => 'string',
|
||||
],
|
||||
'SplObserver' => [
|
||||
'update' => 'void',
|
||||
],
|
||||
'SplSubject' => [
|
||||
'attach' => 'void',
|
||||
'detach' => 'void',
|
||||
'notify' => 'void',
|
||||
],
|
||||
'SplObjectStorage' => [
|
||||
'attach' => 'void',
|
||||
'detach' => 'void',
|
||||
'contains' => 'bool',
|
||||
'addAll' => 'int',
|
||||
'removeAll' => 'int',
|
||||
'removeAllExcept' => 'int',
|
||||
'getInfo' => 'mixed',
|
||||
'setInfo' => 'void',
|
||||
'count' => 'int',
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'key' => 'int',
|
||||
'current' => 'object',
|
||||
'next' => 'void',
|
||||
'unserialize' => 'void',
|
||||
'serialize' => 'string',
|
||||
'offsetExists' => 'bool',
|
||||
'offsetGet' => 'mixed',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
'getHash' => 'string',
|
||||
'__serialize' => 'array',
|
||||
'__unserialize' => 'void',
|
||||
'__debugInfo' => 'array',
|
||||
],
|
||||
'MultipleIterator' => [
|
||||
'getFlags' => 'int',
|
||||
'setFlags' => 'void',
|
||||
'attachIterator' => 'void',
|
||||
'detachIterator' => 'void',
|
||||
'containsIterator' => 'bool',
|
||||
'countIterators' => 'int',
|
||||
'rewind' => 'void',
|
||||
'valid' => 'bool',
|
||||
'key' => 'array',
|
||||
'current' => 'array',
|
||||
'next' => 'void',
|
||||
'__debugInfo' => 'array',
|
||||
],
|
||||
'SQLite3' => [
|
||||
'open' => 'void',
|
||||
'version' => 'array',
|
||||
'lastInsertRowID' => 'int',
|
||||
'lastErrorCode' => 'int',
|
||||
'lastExtendedErrorCode' => 'int',
|
||||
'lastErrorMsg' => 'string',
|
||||
'changes' => 'int',
|
||||
'busyTimeout' => 'bool',
|
||||
'loadExtension' => 'bool',
|
||||
'backup' => 'bool',
|
||||
'escapeString' => 'string',
|
||||
'prepare' => 'SQLite3Stmt|false',
|
||||
'exec' => 'bool',
|
||||
'query' => 'SQLite3Result|false',
|
||||
'querySingle' => 'mixed',
|
||||
'createFunction' => 'bool',
|
||||
'createAggregate' => 'bool',
|
||||
'createCollation' => 'bool',
|
||||
'enableExceptions' => 'bool',
|
||||
'enableExtendedResultCodes' => 'bool',
|
||||
'setAuthorizer' => 'bool',
|
||||
],
|
||||
'SQLite3Stmt' => [
|
||||
'bindParam' => 'bool',
|
||||
'bindValue' => 'bool',
|
||||
'clear' => 'bool',
|
||||
'close' => 'bool',
|
||||
'execute' => 'SQLite3Result|false',
|
||||
'getSQL' => 'string|false',
|
||||
'paramCount' => 'int',
|
||||
'readOnly' => 'bool',
|
||||
'reset' => 'bool',
|
||||
],
|
||||
'SQLite3Result' => [
|
||||
'numColumns' => 'int',
|
||||
'columnName' => 'string|false',
|
||||
'columnType' => 'int|false',
|
||||
'fetchArray' => 'array|false',
|
||||
'reset' => 'bool',
|
||||
],
|
||||
'Directory' => [
|
||||
'close' => 'void',
|
||||
'rewind' => 'void',
|
||||
'read' => 'string|false',
|
||||
],
|
||||
'php_user_filter' => [
|
||||
'filter' => 'int',
|
||||
'onCreate' => 'bool',
|
||||
'onClose' => 'void',
|
||||
],
|
||||
'tidy' => [
|
||||
'getOpt' => 'string|int|bool',
|
||||
'cleanRepair' => 'bool',
|
||||
'parseFile' => 'bool',
|
||||
'parseString' => 'bool',
|
||||
'repairString' => 'string|false',
|
||||
'repairFile' => 'string|false',
|
||||
'diagnose' => 'bool',
|
||||
'getRelease' => 'string',
|
||||
'getConfig' => 'array',
|
||||
'getStatus' => 'int',
|
||||
'getHtmlVer' => 'int',
|
||||
'getOptDoc' => 'string|false',
|
||||
'isXhtml' => 'bool',
|
||||
'isXml' => 'bool',
|
||||
'root' => '?tidyNode',
|
||||
'head' => '?tidyNode',
|
||||
'html' => '?tidyNode',
|
||||
'body' => '?tidyNode',
|
||||
],
|
||||
'XMLReader' => [
|
||||
'getAttribute' => '?string',
|
||||
'getAttributeNo' => '?string',
|
||||
'getAttributeNs' => '?string',
|
||||
'getParserProperty' => 'bool',
|
||||
'isValid' => 'bool',
|
||||
'lookupNamespace' => '?string',
|
||||
'moveToAttribute' => 'bool',
|
||||
'moveToAttributeNo' => 'bool',
|
||||
'moveToAttributeNs' => 'bool',
|
||||
'moveToElement' => 'bool',
|
||||
'moveToFirstAttribute' => 'bool',
|
||||
'moveToNextAttribute' => 'bool',
|
||||
'read' => 'bool',
|
||||
'next' => 'bool',
|
||||
'readInnerXml' => 'string',
|
||||
'readOuterXml' => 'string',
|
||||
'readString' => 'string',
|
||||
'setSchema' => 'bool',
|
||||
'setParserProperty' => 'bool',
|
||||
'setRelaxNGSchema' => 'bool',
|
||||
'setRelaxNGSchemaSource' => 'bool',
|
||||
'expand' => 'DOMNode|false',
|
||||
],
|
||||
'XMLWriter' => [
|
||||
'openUri' => 'bool',
|
||||
'openMemory' => 'bool',
|
||||
'setIndent' => 'bool',
|
||||
'setIndentString' => 'bool',
|
||||
'startComment' => 'bool',
|
||||
'endComment' => 'bool',
|
||||
'startAttribute' => 'bool',
|
||||
'endAttribute' => 'bool',
|
||||
'writeAttribute' => 'bool',
|
||||
'startAttributeNs' => 'bool',
|
||||
'writeAttributeNs' => 'bool',
|
||||
'startElement' => 'bool',
|
||||
'endElement' => 'bool',
|
||||
'fullEndElement' => 'bool',
|
||||
'startElementNs' => 'bool',
|
||||
'writeElement' => 'bool',
|
||||
'writeElementNs' => 'bool',
|
||||
'startPi' => 'bool',
|
||||
'endPi' => 'bool',
|
||||
'writePi' => 'bool',
|
||||
'startCdata' => 'bool',
|
||||
'endCdata' => 'bool',
|
||||
'writeCdata' => 'bool',
|
||||
'text' => 'bool',
|
||||
'writeRaw' => 'bool',
|
||||
'startDocument' => 'bool',
|
||||
'endDocument' => 'bool',
|
||||
'writeComment' => 'bool',
|
||||
'startDtd' => 'bool',
|
||||
'endDtd' => 'bool',
|
||||
'writeDtd' => 'bool',
|
||||
'startDtdElement' => 'bool',
|
||||
'endDtdElement' => 'bool',
|
||||
'writeDtdElement' => 'bool',
|
||||
'startDtdAttlist' => 'bool',
|
||||
'endDtdAttlist' => 'bool',
|
||||
'writeDtdAttlist' => 'bool',
|
||||
'startDtdEntity' => 'bool',
|
||||
'endDtdEntity' => 'bool',
|
||||
'writeDtdEntity' => 'bool',
|
||||
'outputMemory' => 'string',
|
||||
'flush' => 'string|int',
|
||||
],
|
||||
'XSLTProcessor' => [
|
||||
'importStylesheet' => 'bool',
|
||||
'transformToDoc' => 'DOMDocument|false',
|
||||
'transformToUri' => 'int',
|
||||
'transformToXml' => 'string|null|false',
|
||||
'setParameter' => 'bool',
|
||||
'getParameter' => 'string|false',
|
||||
'removeParameter' => 'bool',
|
||||
'hasExsltSupport' => 'bool',
|
||||
'registerPHPFunctions' => 'void',
|
||||
'setSecurityPrefs' => 'int',
|
||||
'getSecurityPrefs' => 'int',
|
||||
],
|
||||
'ZipArchive' => [
|
||||
'open' => 'bool|int',
|
||||
'setPassword' => 'bool',
|
||||
'close' => 'bool',
|
||||
'count' => 'int',
|
||||
'getStatusString' => 'string',
|
||||
'addEmptyDir' => 'bool',
|
||||
'addFromString' => 'bool',
|
||||
'addFile' => 'bool',
|
||||
'replaceFile' => 'bool',
|
||||
'addGlob' => 'array|false',
|
||||
'addPattern' => 'array|false',
|
||||
'renameIndex' => 'bool',
|
||||
'renameName' => 'bool',
|
||||
'setArchiveComment' => 'bool',
|
||||
'getArchiveComment' => 'string|false',
|
||||
'setCommentIndex' => 'bool',
|
||||
'setCommentName' => 'bool',
|
||||
'setMtimeIndex' => 'bool',
|
||||
'setMtimeName' => 'bool',
|
||||
'getCommentIndex' => 'string|false',
|
||||
'getCommentName' => 'string|false',
|
||||
'deleteIndex' => 'bool',
|
||||
'deleteName' => 'bool',
|
||||
'statName' => 'array|false',
|
||||
'statIndex' => 'array|false',
|
||||
'locateName' => 'int|false',
|
||||
'getNameIndex' => 'string|false',
|
||||
'unchangeArchive' => 'bool',
|
||||
'unchangeAll' => 'bool',
|
||||
'unchangeIndex' => 'bool',
|
||||
'unchangeName' => 'bool',
|
||||
'extractTo' => 'bool',
|
||||
'getFromName' => 'string|false',
|
||||
'getFromIndex' => 'string|false',
|
||||
'setExternalAttributesName' => 'bool',
|
||||
'setExternalAttributesIndex' => 'bool',
|
||||
'getExternalAttributesName' => 'bool',
|
||||
'getExternalAttributesIndex' => 'bool',
|
||||
'setCompressionName' => 'bool',
|
||||
'setCompressionIndex' => 'bool',
|
||||
'setEncryptionName' => 'bool',
|
||||
'setEncryptionIndex' => 'bool',
|
||||
'registerProgressCallback' => 'bool',
|
||||
'registerCancelCallback' => 'bool',
|
||||
],
|
||||
'Exception' => [
|
||||
'__wakeup' => 'void',
|
||||
],
|
||||
'Error' => [
|
||||
'__wakeup' => 'void',
|
||||
],
|
||||
'IteratorAggregate' => [
|
||||
'getIterator' => 'Traversable',
|
||||
],
|
||||
'Iterator' => [
|
||||
'current' => 'mixed',
|
||||
'next' => 'void',
|
||||
'key' => 'mixed',
|
||||
'valid' => 'bool',
|
||||
'rewind' => 'void',
|
||||
],
|
||||
'ArrayAccess' => [
|
||||
'offsetExists' => 'bool',
|
||||
'offsetGet' => 'mixed',
|
||||
'offsetSet' => 'void',
|
||||
'offsetUnset' => 'void',
|
||||
],
|
||||
'Countable' => [
|
||||
'count' => 'int',
|
||||
],
|
||||
];
|
||||
}
|
19
vendor/symfony/error-handler/LICENSE
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2019-2022 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
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
44
vendor/symfony/error-handler/README.md
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
ErrorHandler Component
|
||||
======================
|
||||
|
||||
The ErrorHandler component provides tools to manage errors and ease debugging PHP code.
|
||||
|
||||
Getting Started
|
||||
---------------
|
||||
|
||||
```
|
||||
$ composer require symfony/error-handler
|
||||
```
|
||||
|
||||
```php
|
||||
use Symfony\Component\ErrorHandler\Debug;
|
||||
use Symfony\Component\ErrorHandler\ErrorHandler;
|
||||
use Symfony\Component\ErrorHandler\DebugClassLoader;
|
||||
|
||||
Debug::enable();
|
||||
|
||||
// or enable only one feature
|
||||
//ErrorHandler::register();
|
||||
//DebugClassLoader::enable();
|
||||
|
||||
// If you want a custom generic template when debug is not enabled
|
||||
// HtmlErrorRenderer::setTemplate('/path/to/custom/error.html.php');
|
||||
|
||||
$data = ErrorHandler::call(static function () use ($filename, $datetimeFormat) {
|
||||
// if any code executed inside this anonymous function fails, a PHP exception
|
||||
// will be thrown, even if the code uses the '@' PHP silence operator
|
||||
$data = json_decode(file_get_contents($filename), true);
|
||||
$data['read_at'] = date($datetimeFormat);
|
||||
file_put_contents($filename, json_encode($data));
|
||||
|
||||
return $data;
|
||||
});
|
||||
```
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
|
||||
* [Report issues](https://github.com/symfony/symfony/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/symfony/pulls)
|
||||
in the [main Symfony repository](https://github.com/symfony/symfony)
|
4
vendor/symfony/error-handler/Resources/assets/css/error.css
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
body { background-color: #fff; color: #222; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; margin: 0; }
|
||||
.container { margin: 30px; max-width: 600px; }
|
||||
h1 { color: #dc3545; font-size: 24px; }
|
||||
h2 { font-size: 18px; }
|
252
vendor/symfony/error-handler/Resources/assets/css/exception.css
vendored
Normal file
@ -0,0 +1,252 @@
|
||||
/* This file is based on WebProfilerBundle/Resources/views/Profiler/profiler.css.twig.
|
||||
If you make any change in this file, verify the same change is needed in the other file. */
|
||||
:root {
|
||||
--font-sans-serif: Helvetica, Arial, sans-serif;
|
||||
--page-background: #f9f9f9;
|
||||
--color-text: #222;
|
||||
/* when updating any of these colors, do the same in toolbar.css.twig */
|
||||
--color-success: #4f805d;
|
||||
--color-warning: #a46a1f;
|
||||
--color-error: #b0413e;
|
||||
--color-muted: #999;
|
||||
--tab-background: #fff;
|
||||
--tab-color: #444;
|
||||
--tab-active-background: #666;
|
||||
--tab-active-color: #fafafa;
|
||||
--tab-disabled-background: #f5f5f5;
|
||||
--tab-disabled-color: #999;
|
||||
--metric-value-background: #fff;
|
||||
--metric-value-color: inherit;
|
||||
--metric-unit-color: #999;
|
||||
--metric-label-background: #e0e0e0;
|
||||
--metric-label-color: inherit;
|
||||
--table-border: #e0e0e0;
|
||||
--table-background: #fff;
|
||||
--table-header: #e0e0e0;
|
||||
--trace-selected-background: #F7E5A1;
|
||||
--tree-active-background: #F7E5A1;
|
||||
--exception-title-color: var(--base-2);
|
||||
--shadow: 0px 0px 1px rgba(128, 128, 128, .2);
|
||||
--border: 1px solid #e0e0e0;
|
||||
--background-error: var(--color-error);
|
||||
--highlight-comment: #969896;
|
||||
--highlight-default: #222222;
|
||||
--highlight-keyword: #a71d5d;
|
||||
--highlight-string: #183691;
|
||||
--base-0: #fff;
|
||||
--base-1: #f5f5f5;
|
||||
--base-2: #e0e0e0;
|
||||
--base-3: #ccc;
|
||||
--base-4: #666;
|
||||
--base-5: #444;
|
||||
--base-6: #222;
|
||||
}
|
||||
|
||||
.theme-dark {
|
||||
--page-background: #36393e;
|
||||
--color-text: #e0e0e0;
|
||||
--color-muted: #777;
|
||||
--color-error: #d43934;
|
||||
--tab-background: #555;
|
||||
--tab-color: #ccc;
|
||||
--tab-active-background: #888;
|
||||
--tab-active-color: #fafafa;
|
||||
--tab-disabled-background: var(--page-background);
|
||||
--tab-disabled-color: #777;
|
||||
--metric-value-background: #555;
|
||||
--metric-value-color: inherit;
|
||||
--metric-unit-color: #999;
|
||||
--metric-label-background: #777;
|
||||
--metric-label-color: #e0e0e0;
|
||||
--trace-selected-background: #71663acc;
|
||||
--table-border: #444;
|
||||
--table-background: #333;
|
||||
--table-header: #555;
|
||||
--info-background: rgba(79, 148, 195, 0.5);
|
||||
--tree-active-background: var(--metric-label-background);
|
||||
--exception-title-color: var(--base-2);
|
||||
--shadow: 0px 0px 1px rgba(32, 32, 32, .2);
|
||||
--border: 1px solid #666;
|
||||
--background-error: #b0413e;
|
||||
--highlight-comment: #dedede;
|
||||
--highlight-default: var(--base-6);
|
||||
--highlight-keyword: #ff413c;
|
||||
--highlight-string: #70a6fd;
|
||||
--base-0: #2e3136;
|
||||
--base-1: #444;
|
||||
--base-2: #666;
|
||||
--base-3: #666;
|
||||
--base-4: #666;
|
||||
--base-5: #e0e0e0;
|
||||
--base-6: #f5f5f5;
|
||||
--card-label-background: var(--tab-active-background);
|
||||
--card-label-color: var(--tab-active-color);
|
||||
}
|
||||
|
||||
html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}
|
||||
|
||||
html {
|
||||
/* always display the vertical scrollbar to avoid jumps when toggling contents */
|
||||
overflow-y: scroll;
|
||||
}
|
||||
body { background-color: var(--page-background); color: var(--base-6); font: 14px/1.4 Helvetica, Arial, sans-serif; padding-bottom: 45px; }
|
||||
|
||||
a { cursor: pointer; text-decoration: none; }
|
||||
a:hover { text-decoration: underline; }
|
||||
abbr[title] { border-bottom: none; cursor: help; text-decoration: none; }
|
||||
|
||||
code, pre { font: 13px/1.5 Consolas, Monaco, Menlo, "Ubuntu Mono", "Liberation Mono", monospace; }
|
||||
|
||||
table, tr, th, td { background: var(--base-0); border-collapse: collapse; vertical-align: top; }
|
||||
table { background: var(--base-0); border: var(--border); box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; width: 100%; }
|
||||
table th, table td { border: solid var(--base-2); border-width: 1px 0; padding: 8px 10px; }
|
||||
table th { background-color: var(--base-2); font-weight: bold; text-align: left; }
|
||||
|
||||
.m-t-5 { margin-top: 5px; }
|
||||
.hidden-xs-down { display: none; }
|
||||
.block { display: block; }
|
||||
.full-width { width: 100%; }
|
||||
.hidden { display: none; }
|
||||
.prewrap { white-space: pre-wrap; }
|
||||
.nowrap { white-space: nowrap; }
|
||||
.newline { display: block; }
|
||||
.break-long-words { word-wrap: break-word; overflow-wrap: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; min-width: 0; }
|
||||
.text-small { font-size: 12px !important; }
|
||||
.text-muted { color: #999; }
|
||||
.text-bold { font-weight: bold; }
|
||||
.empty { border: 4px dashed var(--base-2); color: #999; margin: 1em 0; padding: .5em 2em; }
|
||||
|
||||
.status-success { background: rgba(94, 151, 110, 0.3); }
|
||||
.status-warning { background: rgba(240, 181, 24, 0.3); }
|
||||
.status-error { background: rgba(176, 65, 62, 0.2); }
|
||||
.status-success td, .status-warning td, .status-error td { background: transparent; }
|
||||
tr.status-error td, tr.status-warning td { border-bottom: 1px solid var(--base-2); border-top: 1px solid var(--base-2); }
|
||||
.status-warning .colored { color: #A46A1F; }
|
||||
.status-error .colored { color: var(--color-error); }
|
||||
|
||||
.sf-toggle { cursor: pointer; position: relative; }
|
||||
.sf-toggle-content { -moz-transition: display .25s ease; -webkit-transition: display .25s ease; transition: display .25s ease; }
|
||||
.sf-toggle-content.sf-toggle-hidden { display: none; }
|
||||
.sf-toggle-content.sf-toggle-visible { display: block; }
|
||||
thead.sf-toggle-content.sf-toggle-visible, tbody.sf-toggle-content.sf-toggle-visible { display: table-row-group; }
|
||||
.sf-toggle-off .icon-close, .sf-toggle-on .icon-open { display: none; }
|
||||
.sf-toggle-off .icon-open, .sf-toggle-on .icon-close { display: block; }
|
||||
|
||||
.tab-navigation { margin: 0 0 1em 0; padding: 0; }
|
||||
.tab-navigation li { background: var(--tab-background); border: 1px solid var(--table-border); color: var(--tab-color); cursor: pointer; display: inline-block; font-size: 16px; margin: 0 0 0 -1px; padding: .5em .75em; z-index: 1; }
|
||||
.tab-navigation li .badge { background-color: var(--base-1); color: var(--base-4); display: inline-block; font-size: 14px; font-weight: bold; margin-left: 8px; min-width: 10px; padding: 1px 6px; text-align: center; white-space: nowrap; }
|
||||
.tab-navigation li.disabled { background: var(--tab-disabled-background); color: var(--tab-disabled-color); }
|
||||
.tab-navigation li.active { background: var(--tab-active-background); color: var(--tab-active-color); z-index: 1100; }
|
||||
.tab-navigation li.active .badge { background-color: var(--base-5); color: var(--base-2); }
|
||||
.tab-content > *:first-child { margin-top: 0; }
|
||||
.tab-navigation li .badge.status-warning { background: var(--color-warning); color: #FFF; }
|
||||
.tab-navigation li .badge.status-error { background: var(--background-error); color: #FFF; }
|
||||
.sf-tabs .tab:not(:first-child) { display: none; }
|
||||
|
||||
[data-filters] { position: relative; }
|
||||
[data-filtered] { cursor: pointer; }
|
||||
[data-filtered]:after { content: '\00a0\25BE'; }
|
||||
[data-filtered]:hover .filter-list li { display: inline-flex; }
|
||||
[class*="filter-hidden-"] { display: none; }
|
||||
.filter-list { position: absolute; border: var(--border); box-shadow: var(--shadow); margin: 0; padding: 0; display: flex; flex-direction: column; }
|
||||
.filter-list :after { content: ''; }
|
||||
.filter-list li {
|
||||
background: var(--tab-disabled-background);
|
||||
border-bottom: var(--border);
|
||||
color: var(--tab-disabled-color);
|
||||
display: none;
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 5px 10px;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
}
|
||||
.filter-list li.active {
|
||||
background: var(--tab-background);
|
||||
color: var(--tab-color);
|
||||
}
|
||||
.filter-list li.last-active {
|
||||
background: var(--tab-active-background);
|
||||
color: var(--tab-active-color);
|
||||
}
|
||||
|
||||
.filter-list-level li { cursor: s-resize; }
|
||||
.filter-list-level li.active { cursor: n-resize; }
|
||||
.filter-list-level li.last-active { cursor: default; }
|
||||
.filter-list-level li.last-active:before { content: '\2714\00a0'; }
|
||||
.filter-list-choice li:before { content: '\2714\00a0'; color: transparent; }
|
||||
.filter-list-choice li.active:before { color: unset; }
|
||||
|
||||
.container { max-width: 1024px; margin: 0 auto; padding: 0 15px; }
|
||||
.container::after { content: ""; display: table; clear: both; }
|
||||
|
||||
header { background-color: #222; color: rgba(255, 255, 255, 0.75); font-size: 13px; height: 33px; line-height: 33px; padding: 0; }
|
||||
header .container { display: flex; justify-content: space-between; }
|
||||
.logo { flex: 1; font-size: 13px; font-weight: normal; margin: 0; padding: 0; }
|
||||
.logo svg { height: 18px; width: 18px; opacity: .8; vertical-align: -5px; }
|
||||
|
||||
.help-link { margin-left: 15px; }
|
||||
.help-link a { color: inherit; }
|
||||
.help-link .icon svg { height: 15px; width: 15px; opacity: .7; vertical-align: -2px; }
|
||||
.help-link a:hover { color: #EEE; text-decoration: none; }
|
||||
.help-link a:hover svg { opacity: .9; }
|
||||
|
||||
.exception-summary { background: var(--background-error); border-bottom: 2px solid rgba(0, 0, 0, 0.1); border-top: 1px solid rgba(0, 0, 0, .3); flex: 0 0 auto; margin-bottom: 15px; }
|
||||
.exception-metadata { background: rgba(0, 0, 0, 0.1); padding: 7px 0; }
|
||||
.exception-metadata .container { display: flex; flex-direction: row; justify-content: space-between; }
|
||||
.exception-metadata h2, .exception-metadata h2 > a { color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 400; margin: 0; }
|
||||
.exception-http small { font-size: 13px; opacity: .7; }
|
||||
.exception-hierarchy { flex: 1; }
|
||||
.exception-hierarchy .icon { margin: 0 3px; opacity: .7; }
|
||||
.exception-hierarchy .icon svg { height: 13px; width: 13px; vertical-align: -2px; }
|
||||
|
||||
.exception-without-message .exception-message-wrapper { display: none; }
|
||||
.exception-message-wrapper .container { display: flex; align-items: flex-start; min-height: 70px; padding: 10px 15px 8px; }
|
||||
.exception-message { flex-grow: 1; }
|
||||
.exception-message, .exception-message a { color: #FFF; font-size: 21px; font-weight: 400; margin: 0; }
|
||||
.exception-message.long { font-size: 18px; }
|
||||
.exception-message a { border-bottom: 1px solid rgba(255, 255, 255, 0.5); font-size: inherit; text-decoration: none; }
|
||||
.exception-message a:hover { border-bottom-color: #ffffff; }
|
||||
|
||||
.exception-illustration { flex-basis: 111px; flex-shrink: 0; height: 66px; margin-left: 15px; opacity: .7; }
|
||||
|
||||
.trace + .trace { margin-top: 30px; }
|
||||
.trace-head { background-color: var(--base-2); padding: 10px; position: relative; }
|
||||
.trace-head .trace-class { color: var(--base-6); font-size: 18px; font-weight: bold; line-height: 1.3; margin: 0; position: relative; }
|
||||
.trace-head .trace-namespace { color: #999; display: block; font-size: 13px; }
|
||||
.trace-head .icon { position: absolute; right: 0; top: 0; }
|
||||
.trace-head .icon svg { fill: var(--base-5); height: 24px; width: 24px; }
|
||||
|
||||
.trace-details { background: var(--base-0); border: var(--border); box-shadow: 0px 0px 1px rgba(128, 128, 128, .2); margin: 1em 0; table-layout: fixed; }
|
||||
|
||||
.trace-message { font-size: 14px; font-weight: normal; margin: .5em 0 0; }
|
||||
|
||||
.trace-line { position: relative; padding-top: 8px; padding-bottom: 8px; }
|
||||
.trace-line + .trace-line { border-top: var(--border); }
|
||||
.trace-line:hover { background: var(--base-1); }
|
||||
.trace-line a { color: var(--base-6); }
|
||||
.trace-line .icon { opacity: .4; position: absolute; left: 10px; }
|
||||
.trace-line .icon svg { fill: var(--base-5); height: 16px; width: 16px; }
|
||||
.trace-line .icon.icon-copy { left: auto; top: auto; padding-left: 5px; display: none }
|
||||
.trace-line:hover .icon.icon-copy:not(.hidden) { display: inline-block }
|
||||
.trace-line-header { padding-left: 36px; padding-right: 10px; }
|
||||
|
||||
.trace-file-path, .trace-file-path a { color: var(--base-6); font-size: 13px; }
|
||||
.trace-class { color: var(--color-error); }
|
||||
.trace-type { padding: 0 2px; }
|
||||
.trace-method { color: var(--color-error); font-weight: bold; }
|
||||
.trace-arguments { color: #777; font-weight: normal; padding-left: 2px; }
|
||||
|
||||
.trace-code { background: var(--base-0); font-size: 12px; margin: 10px 10px 2px 10px; padding: 10px; overflow-x: auto; white-space: nowrap; }
|
||||
.trace-code ol { margin: 0; float: left; }
|
||||
.trace-code li { color: #969896; margin: 0; padding-left: 10px; float: left; width: 100%; }
|
||||
.trace-code li + li { margin-top: 5px; }
|
||||
.trace-code li.selected { background: var(--trace-selected-background); margin-top: 2px; }
|
||||
.trace-code li code { color: var(--base-6); white-space: nowrap; }
|
||||
|
||||
.trace-as-text .stacktrace { line-height: 1.8; margin: 0 0 15px; white-space: pre-wrap; }
|
||||
|
||||
@media (min-width: 575px) {
|
||||
.hidden-xs-down { display: initial; }
|
||||
.help-link { margin-left: 30px; }
|
||||
}
|
128
vendor/symfony/error-handler/Resources/assets/css/exception_full.css
vendored
Normal file
@ -0,0 +1,128 @@
|
||||
.sf-reset .traces {
|
||||
padding-bottom: 14px;
|
||||
}
|
||||
.sf-reset .traces li {
|
||||
font-size: 12px;
|
||||
color: #868686;
|
||||
padding: 5px 4px;
|
||||
list-style-type: decimal;
|
||||
margin-left: 20px;
|
||||
}
|
||||
.sf-reset #logs .traces li.error {
|
||||
font-style: normal;
|
||||
color: #AA3333;
|
||||
background: #f9ecec;
|
||||
}
|
||||
.sf-reset #logs .traces li.warning {
|
||||
font-style: normal;
|
||||
background: #ffcc00;
|
||||
}
|
||||
/* fix for Opera not liking empty <li> */
|
||||
.sf-reset .traces li:after {
|
||||
content: "\00A0";
|
||||
}
|
||||
.sf-reset .trace {
|
||||
border: 1px solid #D3D3D3;
|
||||
padding: 10px;
|
||||
overflow: auto;
|
||||
margin: 10px 0 20px;
|
||||
}
|
||||
.sf-reset .block-exception {
|
||||
-moz-border-radius: 16px;
|
||||
-webkit-border-radius: 16px;
|
||||
border-radius: 16px;
|
||||
margin-bottom: 20px;
|
||||
background-color: #f6f6f6;
|
||||
border: 1px solid #dfdfdf;
|
||||
padding: 30px 28px;
|
||||
word-wrap: break-word;
|
||||
overflow: hidden;
|
||||
}
|
||||
.sf-reset .block-exception div {
|
||||
color: #313131;
|
||||
font-size: 10px;
|
||||
}
|
||||
.sf-reset .block-exception-detected .illustration-exception,
|
||||
.sf-reset .block-exception-detected .text-exception {
|
||||
float: left;
|
||||
}
|
||||
.sf-reset .block-exception-detected .illustration-exception {
|
||||
width: 152px;
|
||||
}
|
||||
.sf-reset .block-exception-detected .text-exception {
|
||||
width: 670px;
|
||||
padding: 30px 44px 24px 46px;
|
||||
position: relative;
|
||||
}
|
||||
.sf-reset .text-exception .open-quote,
|
||||
.sf-reset .text-exception .close-quote {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
position: absolute;
|
||||
color: #C9C9C9;
|
||||
font-size: 8em;
|
||||
}
|
||||
.sf-reset .open-quote {
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.sf-reset .close-quote {
|
||||
bottom: -0.5em;
|
||||
right: 50px;
|
||||
}
|
||||
.sf-reset .block-exception p {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.sf-reset .block-exception p a,
|
||||
.sf-reset .block-exception p a:hover {
|
||||
color: #565656;
|
||||
}
|
||||
.sf-reset .logs h2 {
|
||||
float: left;
|
||||
width: 654px;
|
||||
}
|
||||
.sf-reset .error-count, .sf-reset .support {
|
||||
float: right;
|
||||
width: 170px;
|
||||
text-align: right;
|
||||
}
|
||||
.sf-reset .error-count span {
|
||||
display: inline-block;
|
||||
background-color: #aacd4e;
|
||||
-moz-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
padding: 4px;
|
||||
color: white;
|
||||
margin-right: 2px;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sf-reset .support a {
|
||||
display: inline-block;
|
||||
-moz-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
padding: 4px;
|
||||
color: #000000;
|
||||
margin-right: 2px;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sf-reset .toggle {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.sf-reset .linked ul,
|
||||
.sf-reset .linked li {
|
||||
display: inline;
|
||||
}
|
||||
.sf-reset #output-content {
|
||||
color: #000;
|
||||
font-size: 12px;
|
||||
}
|
||||
.sf-reset #traces-text pre {
|
||||
white-space: pre;
|
||||
font-size: 12px;
|
||||
font-family: monospace;
|
||||
}
|
1
vendor/symfony/error-handler/Resources/assets/images/chevron-right.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path fill="#FFF" d="M1363 877l-742 742q-19 19-45 19t-45-19l-166-166q-19-19-19-45t19-45l531-531-531-531q-19-19-19-45t19-45L531 45q19-19 45-19t45 19l742 742q19 19 19 45t-19 45z"/></svg>
|
After Width: | Height: | Size: 276 B |
1
vendor/symfony/error-handler/Resources/assets/images/favicon.png.base64
vendored
Normal file
@ -0,0 +1 @@
|
||||
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAgCAYAAAABtRhCAAADVUlEQVRIx82XX0jTURTHLYPyqZdefQx66CEo80+aYpoIkqzUikz6Z5klQoWUWYRIJYEUGpQ+lIr9U5dOTLdCtkmWZis3rbnC5fw/neYW002307mX/cZvP3/7o1PwwOdh95x7vnf39zvnd29AgBer2xO6DclAXiMqZAqxIiNIN/IYSUS2BPhjmGATchUxI+ADWiRhpWK7HKuHFVBFdmU5YvnI4grFGCaReF/EBH4KsZlGgj2JBTuCYBWRIYF8YoEOJ6wBt/gEs7mBbyOjQXruPLSdOgPCiEiPSUUHDoL8Ug5IUo9B/d5wrt+G7OAKNrODPuVdB6vRCIzN6SdBlpW9RIgk/1FeAXabzRlrUPVCS/JhbmwudztnGeeH9AyXBIwtmM3wLinZJZHifjHw2V+NBoRh+9ixQrbgbnaSIcl7cGea6hoXQbNe7za241oeO5Z0p42M4BV2EqP2D50wo+6HzvwC6C4sApNOR8cmOrtcnhtj2kYRyC9eBvXzKrBZrXSs72kFd1t3MoKVbMekQkEnSNKOO8fac3LpmK6l1TlGtsxmsdKFsecPYgwxst0cwROMYDXboSotg0WLBRqjY51jLYcENElXwW2XJKPydvoI2GN9T8rBtrAArYIUruBJXkFheCQYlCpQP6uk5dAQFQNaUROMSGVQFxLmkoQsxDJrhLbTZ+nvVsERME9MgPJRKV/58AsyomTSzE813WLFvWK++qI0xSfQl8k8Pg46sYRuv5t6dS+4RqxDwaa4BGjYH+NTQvKScIp9+YL/hoZh3jDtLRHtt2C3g6bmhX+CpsFBWg7ilDSPgj0lD2ncr5ev/BP8VvyAJhqVyZeUhPOrEhEFxgEtjft846Z/guQTNT89Q5P9flMLoth4F7808wKtWWKzAwNQHxrh/1vaid2F+XpYTSbQf1XA2McOmOpROnvpvMEA4tSjq1cW0sws2gCYxswY6TKkvzYnJq1NHZLnRU4BX+4U0uburvusu8Kv8iHY7qefkM4IFngJHEOUXmLEPgiGsI8YnlZILit3vSSLRTQe/MPIZva5pshNIEmyFQlCvruJKXPkCEfmePzkphXHdzZNQdoRI9KPlBAxlj/I8U97ERPS5bjGbWDFbEdqHVe5caTBeZZx2H/IMvzeN15yoQAAAABJRU5ErkJggg==
|
1
vendor/symfony/error-handler/Resources/assets/images/icon-book.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path fill="#FFF" d="M1703 478q40 57 18 129l-275 906q-19 64-76.5 107.5T1247 1664H324q-77 0-148.5-53.5T76 1479q-24-67-2-127 0-4 3-27t4-37q1-8-3-21.5t-3-19.5q2-11 8-21t16.5-23.5T116 1179q23-38 45-91.5t30-91.5q3-10 .5-30t-.5-28q3-11 17-28t17-23q21-36 42-92t25-90q1-9-2.5-32t.5-28q4-13 22-30.5t22-22.5q19-26 42.5-84.5T404 411q1-8-3-25.5t-2-26.5q2-8 9-18t18-23 17-21q8-12 16.5-30.5t15-35 16-36 19.5-32 26.5-23.5 36-11.5T620 134l-1 3q38-9 51-9h761q74 0 114 56t18 130l-274 906q-36 119-71.5 153.5T1089 1408H220q-27 0-38 15-11 16-1 43 24 70 144 70h923q29 0 56-15.5t35-41.5l300-987q7-22 5-57 38 15 59 43zm-1064 2q-4 13 2 22.5t20 9.5h608q13 0 25.5-9.5T1311 480l21-64q4-13-2-22.5t-20-9.5H702q-13 0-25.5 9.5T660 416zm-83 256q-4 13 2 22.5t20 9.5h608q13 0 25.5-9.5T1228 736l21-64q4-13-2-22.5t-20-9.5H619q-13 0-25.5 9.5T577 672z"/></svg>
|
After Width: | Height: | Size: 913 B |
1
vendor/symfony/error-handler/Resources/assets/images/icon-copy.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>
|
After Width: | Height: | Size: 265 B |
1
vendor/symfony/error-handler/Resources/assets/images/icon-minus-square-o.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 800v64q0 14-9 23t-23 9H480q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448V416q0-66-47-113t-113-47H480q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5T1312 1536H480q-119 0-203.5-84.5T192 1248V416q0-119 84.5-203.5T480 128h832q119 0 203.5 84.5T1600 416z"/></svg>
|
After Width: | Height: | Size: 432 B |
1
vendor/symfony/error-handler/Resources/assets/images/icon-minus-square.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1408 960V832q0-26-19-45t-45-19H448q-26 0-45 19t-19 45v128q0 26 19 45t45 19h896q26 0 45-19t19-45zm256-544v960q0 119-84.5 203.5T1376 1664H416q-119 0-203.5-84.5T128 1376V416q0-119 84.5-203.5T416 128h960q119 0 203.5 84.5T1664 416z"/></svg>
|
After Width: | Height: | Size: 337 B |
1
vendor/symfony/error-handler/Resources/assets/images/icon-plus-square-o.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 800v64q0 14-9 23t-23 9H960v352q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23V896H480q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h352V416q0-14 9-23t23-9h64q14 0 23 9t9 23v352h352q14 0 23 9t9 23zm128 448V416q0-66-47-113t-113-47H480q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5T1312 1536H480q-119 0-203.5-84.5T192 1248V416q0-119 84.5-203.5T480 128h832q119 0 203.5 84.5T1600 416z"/></svg>
|
After Width: | Height: | Size: 526 B |
1
vendor/symfony/error-handler/Resources/assets/images/icon-plus-square.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1408 960V832q0-26-19-45t-45-19h-320V448q0-26-19-45t-45-19H832q-26 0-45 19t-19 45v320H448q-26 0-45 19t-19 45v128q0 26 19 45t45 19h320v320q0 26 19 45t45 19h128q26 0 45-19t19-45v-320h320q26 0 45-19t19-45zm256-544v960q0 119-84.5 203.5T1376 1664H416q-119 0-203.5-84.5T128 1376V416q0-119 84.5-203.5T416 128h960q119 0 203.5 84.5T1664 416z"/></svg>
|
After Width: | Height: | Size: 442 B |
1
vendor/symfony/error-handler/Resources/assets/images/icon-support.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path fill="#FFF" d="M896 0q182 0 348 71t286 191 191 286 71 348-71 348-191 286-286 191-348 71-348-71-286-191-191-286T0 896t71-348 191-286T548 71 896 0zm0 128q-190 0-361 90l194 194q82-28 167-28t167 28l194-194q-171-90-361-90zM218 1257l194-194q-28-82-28-167t28-167L218 535q-90 171-90 361t90 361zm678 407q190 0 361-90l-194-194q-82 28-167 28t-167-28l-194 194q171 90 361 90zm0-384q159 0 271.5-112.5T1280 896t-112.5-271.5T896 512 624.5 624.5 512 896t112.5 271.5T896 1280zm484-217l194 194q90-171 90-361t-90-361l-194 194q28 82 28 167t-28 167z"/></svg>
|
After Width: | Height: | Size: 634 B |
1
vendor/symfony/error-handler/Resources/assets/images/symfony-ghost.svg.php
vendored
Normal file
After Width: | Height: | Size: 8.0 KiB |
1
vendor/symfony/error-handler/Resources/assets/images/symfony-logo.svg
vendored
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="#FFF" d="M12 .9C5.8.9.9 5.8.9 12a11 11 0 1 0 22.2 0A11 11 0 0 0 12 .9zm6.5 6c-.6 0-.9-.3-.9-.8 0-.2 0-.4.2-.6l.2-.4c0-.3-.5-.4-.6-.4-1.8.1-2.3 2.5-2.7 4.4l-.2 1c1 .2 1.8 0 2.2-.3.6-.4-.2-.7-.1-1.2.1-.3.5-.5.7-.6.5 0 .7.5.7.9 0 .7-1 1.8-3 1.8l-.6-.1-.6 2.4c-.4 1.6-.8 3.8-2.4 5.7-1.4 1.7-2.9 1.9-3.5 1.9-1.2 0-1.9-.6-2-1.5 0-.8.7-1.3 1.2-1.3.6 0 1.1.5 1.1 1s-.2.6-.4.6c-.1.1-.3.2-.3.4 0 .1.1.3.4.3.5 0 .8-.3 1.1-.5 1.2-.9 1.6-2.7 2.2-5.7l.1-.7.7-3.2c-.8-.6-1.3-1.4-2.4-1.7-.6-.1-1.1.1-1.5.5-.4.5-.2 1.1.2 1.5l.7.6c.7.8 1.2 1.6 1 2.5-.3 1.5-2 2.6-4 1.9-1.8-.6-2-1.8-1.8-2.5.2-.6.6-.7 1.1-.6.5.2.6.7.6 1.2l-.1.3c-.2.1-.3.3-.3.4-.1.4.4.6.7.7.7.3 1.6-.2 1.8-.8a1 1 0 0 0-.4-1.1l-.7-.8c-.4-.4-1.1-1.4-.7-2.6.1-.5.4-.9.7-1.3a4 4 0 0 1 2.8-.6c1.2.4 1.8 1.1 2.6 1.8.5-1.2 1-2.4 1.8-3.5.9-.9 1.9-1.6 3.1-1.7 1.3.2 2.2.7 2.2 1.6 0 .4-.2 1.1-.9 1.1z"/></svg>
|
After Width: | Height: | Size: 942 B |
297
vendor/symfony/error-handler/Resources/assets/js/exception.js
vendored
Normal file
@ -0,0 +1,297 @@
|
||||
/* This file is based on WebProfilerBundle/Resources/views/Profiler/base_js.html.twig.
|
||||
If you make any change in this file, verify the same change is needed in the other file. */
|
||||
/*<![CDATA[*/
|
||||
if (typeof Sfjs === 'undefined') {
|
||||
Sfjs = (function() {
|
||||
"use strict";
|
||||
|
||||
if ('classList' in document.documentElement) {
|
||||
var hasClass = function (el, cssClass) { return el.classList.contains(cssClass); };
|
||||
var removeClass = function(el, cssClass) { el.classList.remove(cssClass); };
|
||||
var addClass = function(el, cssClass) { el.classList.add(cssClass); };
|
||||
var toggleClass = function(el, cssClass) { el.classList.toggle(cssClass); };
|
||||
} else {
|
||||
var hasClass = function (el, cssClass) { return el.className.match(new RegExp('\\b' + cssClass + '\\b')); };
|
||||
var removeClass = function(el, cssClass) { el.className = el.className.replace(new RegExp('\\b' + cssClass + '\\b'), ' '); };
|
||||
var addClass = function(el, cssClass) { if (!hasClass(el, cssClass)) { el.className += " " + cssClass; } };
|
||||
var toggleClass = function(el, cssClass) { hasClass(el, cssClass) ? removeClass(el, cssClass) : addClass(el, cssClass); };
|
||||
}
|
||||
|
||||
var addEventListener;
|
||||
|
||||
var el = document.createElement('div');
|
||||
if (!('addEventListener' in el)) {
|
||||
addEventListener = function (element, eventName, callback) {
|
||||
element.attachEvent('on' + eventName, callback);
|
||||
};
|
||||
} else {
|
||||
addEventListener = function (element, eventName, callback) {
|
||||
element.addEventListener(eventName, callback, false);
|
||||
};
|
||||
}
|
||||
|
||||
if (navigator.clipboard) {
|
||||
document.querySelectorAll('[data-clipboard-text]').forEach(function(element) {
|
||||
removeClass(element, 'hidden');
|
||||
element.addEventListener('click', function() {
|
||||
navigator.clipboard.writeText(element.getAttribute('data-clipboard-text'));
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
addEventListener: addEventListener,
|
||||
|
||||
createTabs: function() {
|
||||
var tabGroups = document.querySelectorAll('.sf-tabs:not([data-processed=true])');
|
||||
|
||||
/* create the tab navigation for each group of tabs */
|
||||
for (var i = 0; i < tabGroups.length; i++) {
|
||||
var tabs = tabGroups[i].querySelectorAll(':scope > .tab');
|
||||
var tabNavigation = document.createElement('ul');
|
||||
tabNavigation.className = 'tab-navigation';
|
||||
|
||||
var selectedTabId = 'tab-' + i + '-0'; /* select the first tab by default */
|
||||
for (var j = 0; j < tabs.length; j++) {
|
||||
var tabId = 'tab-' + i + '-' + j;
|
||||
var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;
|
||||
|
||||
var tabNavigationItem = document.createElement('li');
|
||||
tabNavigationItem.setAttribute('data-tab-id', tabId);
|
||||
if (hasClass(tabs[j], 'active')) { selectedTabId = tabId; }
|
||||
if (hasClass(tabs[j], 'disabled')) { addClass(tabNavigationItem, 'disabled'); }
|
||||
tabNavigationItem.innerHTML = tabTitle;
|
||||
tabNavigation.appendChild(tabNavigationItem);
|
||||
|
||||
var tabContent = tabs[j].querySelector('.tab-content');
|
||||
tabContent.parentElement.setAttribute('id', tabId);
|
||||
}
|
||||
|
||||
tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);
|
||||
addClass(document.querySelector('[data-tab-id="' + selectedTabId + '"]'), 'active');
|
||||
}
|
||||
|
||||
/* display the active tab and add the 'click' event listeners */
|
||||
for (i = 0; i < tabGroups.length; i++) {
|
||||
tabNavigation = tabGroups[i].querySelectorAll(':scope >.tab-navigation li');
|
||||
|
||||
for (j = 0; j < tabNavigation.length; j++) {
|
||||
tabId = tabNavigation[j].getAttribute('data-tab-id');
|
||||
document.getElementById(tabId).querySelector('.tab-title').className = 'hidden';
|
||||
|
||||
if (hasClass(tabNavigation[j], 'active')) {
|
||||
document.getElementById(tabId).className = 'block';
|
||||
} else {
|
||||
document.getElementById(tabId).className = 'hidden';
|
||||
}
|
||||
|
||||
tabNavigation[j].addEventListener('click', function(e) {
|
||||
var activeTab = e.target || e.srcElement;
|
||||
|
||||
/* needed because when the tab contains HTML contents, user can click */
|
||||
/* on any of those elements instead of their parent '<li>' element */
|
||||
while (activeTab.tagName.toLowerCase() !== 'li') {
|
||||
activeTab = activeTab.parentNode;
|
||||
}
|
||||
|
||||
/* get the full list of tabs through the parent of the active tab element */
|
||||
var tabNavigation = activeTab.parentNode.children;
|
||||
for (var k = 0; k < tabNavigation.length; k++) {
|
||||
var tabId = tabNavigation[k].getAttribute('data-tab-id');
|
||||
document.getElementById(tabId).className = 'hidden';
|
||||
removeClass(tabNavigation[k], 'active');
|
||||
}
|
||||
|
||||
addClass(activeTab, 'active');
|
||||
var activeTabId = activeTab.getAttribute('data-tab-id');
|
||||
document.getElementById(activeTabId).className = 'block';
|
||||
});
|
||||
}
|
||||
|
||||
tabGroups[i].setAttribute('data-processed', 'true');
|
||||
}
|
||||
},
|
||||
|
||||
createToggles: function() {
|
||||
var toggles = document.querySelectorAll('.sf-toggle:not([data-processed=true])');
|
||||
|
||||
for (var i = 0; i < toggles.length; i++) {
|
||||
var elementSelector = toggles[i].getAttribute('data-toggle-selector');
|
||||
var element = document.querySelector(elementSelector);
|
||||
|
||||
addClass(element, 'sf-toggle-content');
|
||||
|
||||
if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') {
|
||||
addClass(toggles[i], 'sf-toggle-on');
|
||||
addClass(element, 'sf-toggle-visible');
|
||||
} else {
|
||||
addClass(toggles[i], 'sf-toggle-off');
|
||||
addClass(element, 'sf-toggle-hidden');
|
||||
}
|
||||
|
||||
addEventListener(toggles[i], 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
if ('' !== window.getSelection().toString()) {
|
||||
/* Don't do anything on text selection */
|
||||
return;
|
||||
}
|
||||
|
||||
var toggle = e.target || e.srcElement;
|
||||
|
||||
/* needed because when the toggle contains HTML contents, user can click */
|
||||
/* on any of those elements instead of their parent '.sf-toggle' element */
|
||||
while (!hasClass(toggle, 'sf-toggle')) {
|
||||
toggle = toggle.parentNode;
|
||||
}
|
||||
|
||||
var element = document.querySelector(toggle.getAttribute('data-toggle-selector'));
|
||||
|
||||
toggleClass(toggle, 'sf-toggle-on');
|
||||
toggleClass(toggle, 'sf-toggle-off');
|
||||
toggleClass(element, 'sf-toggle-hidden');
|
||||
toggleClass(element, 'sf-toggle-visible');
|
||||
|
||||
/* the toggle doesn't change its contents when clicking on it */
|
||||
if (!toggle.hasAttribute('data-toggle-alt-content')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!toggle.hasAttribute('data-toggle-original-content')) {
|
||||
toggle.setAttribute('data-toggle-original-content', toggle.innerHTML);
|
||||
}
|
||||
|
||||
var currentContent = toggle.innerHTML;
|
||||
var originalContent = toggle.getAttribute('data-toggle-original-content');
|
||||
var altContent = toggle.getAttribute('data-toggle-alt-content');
|
||||
toggle.innerHTML = currentContent !== altContent ? altContent : originalContent;
|
||||
});
|
||||
|
||||
/* Prevents from disallowing clicks on links inside toggles */
|
||||
var toggleLinks = toggles[i].querySelectorAll('a');
|
||||
for (var j = 0; j < toggleLinks.length; j++) {
|
||||
addEventListener(toggleLinks[j], 'click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
/* Prevents from disallowing clicks on "copy to clipboard" elements inside toggles */
|
||||
var copyToClipboardElements = toggles[i].querySelectorAll('span[data-clipboard-text]');
|
||||
for (var k = 0; k < copyToClipboardElements.length; k++) {
|
||||
addEventListener(copyToClipboardElements[k], 'click', function(e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
}
|
||||
|
||||
toggles[i].setAttribute('data-processed', 'true');
|
||||
}
|
||||
},
|
||||
|
||||
createFilters: function() {
|
||||
document.querySelectorAll('[data-filters] [data-filter]').forEach(function (filter) {
|
||||
var filters = filter.closest('[data-filters]'),
|
||||
type = 'choice',
|
||||
name = filter.dataset.filter,
|
||||
ucName = name.charAt(0).toUpperCase()+name.slice(1),
|
||||
list = document.createElement('ul'),
|
||||
values = filters.dataset['filter'+ucName] || filters.querySelectorAll('[data-filter-'+name+']'),
|
||||
labels = {},
|
||||
defaults = null,
|
||||
indexed = {},
|
||||
processed = {};
|
||||
if (typeof values === 'string') {
|
||||
type = 'level';
|
||||
labels = values.split(',');
|
||||
values = values.toLowerCase().split(',');
|
||||
defaults = values.length - 1;
|
||||
}
|
||||
addClass(list, 'filter-list');
|
||||
addClass(list, 'filter-list-'+type);
|
||||
values.forEach(function (value, i) {
|
||||
if (value instanceof HTMLElement) {
|
||||
value = value.dataset['filter'+ucName];
|
||||
}
|
||||
if (value in processed) {
|
||||
return;
|
||||
}
|
||||
var option = document.createElement('li'),
|
||||
label = i in labels ? labels[i] : value,
|
||||
active = false,
|
||||
matches;
|
||||
if ('' === label) {
|
||||
option.innerHTML = '<em>(none)</em>';
|
||||
} else {
|
||||
option.innerText = label;
|
||||
}
|
||||
option.dataset.filter = value;
|
||||
option.setAttribute('title', 1 === (matches = filters.querySelectorAll('[data-filter-'+name+'="'+value+'"]').length) ? 'Matches 1 row' : 'Matches '+matches+' rows');
|
||||
indexed[value] = i;
|
||||
list.appendChild(option);
|
||||
addEventListener(option, 'click', function () {
|
||||
if ('choice' === type) {
|
||||
filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) {
|
||||
if (option.dataset.filter === row.dataset['filter'+ucName]) {
|
||||
toggleClass(row, 'filter-hidden-'+name);
|
||||
}
|
||||
});
|
||||
toggleClass(option, 'active');
|
||||
} else if ('level' === type) {
|
||||
if (i === this.parentNode.querySelectorAll('.active').length - 1) {
|
||||
return;
|
||||
}
|
||||
this.parentNode.querySelectorAll('li').forEach(function (currentOption, j) {
|
||||
if (j <= i) {
|
||||
addClass(currentOption, 'active');
|
||||
if (i === j) {
|
||||
addClass(currentOption, 'last-active');
|
||||
} else {
|
||||
removeClass(currentOption, 'last-active');
|
||||
}
|
||||
} else {
|
||||
removeClass(currentOption, 'active');
|
||||
removeClass(currentOption, 'last-active');
|
||||
}
|
||||
});
|
||||
filters.querySelectorAll('[data-filter-'+name+']').forEach(function (row) {
|
||||
if (i < indexed[row.dataset['filter'+ucName]]) {
|
||||
addClass(row, 'filter-hidden-'+name);
|
||||
} else {
|
||||
removeClass(row, 'filter-hidden-'+name);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
if ('choice' === type) {
|
||||
active = null === defaults || 0 <= defaults.indexOf(value);
|
||||
} else if ('level' === type) {
|
||||
active = i <= defaults;
|
||||
if (active && i === defaults) {
|
||||
addClass(option, 'last-active');
|
||||
}
|
||||
}
|
||||
if (active) {
|
||||
addClass(option, 'active');
|
||||
} else {
|
||||
filters.querySelectorAll('[data-filter-'+name+'="'+value+'"]').forEach(function (row) {
|
||||
toggleClass(row, 'filter-hidden-'+name);
|
||||
});
|
||||
}
|
||||
processed[value] = true;
|
||||
});
|
||||
|
||||
if (1 < list.childNodes.length) {
|
||||
filter.appendChild(list);
|
||||
filter.dataset.filtered = '';
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
|
||||
Sfjs.createTabs();
|
||||
Sfjs.createToggles();
|
||||
Sfjs.createFilters();
|
||||
});
|
||||
}
|
||||
/*]]>*/
|
80
vendor/symfony/error-handler/Resources/bin/extract-tentative-return-types.php
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
// Run from the root of the php-src repository, this script generates
|
||||
// a table with all the methods that have a tentative return type.
|
||||
//
|
||||
// Usage: find -name *.stub.php | sort | /path/to/extract-tentative-return-types.php > /path/to/TentativeTypes.php
|
||||
|
||||
echo <<<EOPHP
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler\Internal;
|
||||
|
||||
/**
|
||||
* This class has been generated by extract-tentative-return-types.php.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class TentativeTypes
|
||||
{
|
||||
public const RETURN_TYPES = [
|
||||
|
||||
EOPHP;
|
||||
|
||||
while (false !== $file = fgets(\STDIN)) {
|
||||
$code = file_get_contents(substr($file, 0, -1));
|
||||
|
||||
if (!str_contains($code, '@tentative-return-type')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$code = preg_split('{^\s*(?:(?:abstract )?class|interface|trait) ([^\s]++)}m', $code, -1, \PREG_SPLIT_DELIM_CAPTURE);
|
||||
|
||||
if (1 === count($code)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for ($i = 1; null !== $class = $code[$i] ?? null; $i += 2) {
|
||||
$methods = $code[1 + $i];
|
||||
|
||||
if (!str_contains($methods, '@tentative-return-type')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
echo " '$class' => [\n";
|
||||
|
||||
preg_replace_callback('{@tentative-return-type.*?[\s]function ([^(]++)[^)]++\)\s*+:\s*+([^\n;\{]++)}s', function ($m) {
|
||||
$m[2] = str_replace(' ', '', $m[2]);
|
||||
echo " '$m[1]' => '$m[2]',\n";
|
||||
|
||||
return '';
|
||||
}, $methods);
|
||||
|
||||
echo " ],\n";
|
||||
}
|
||||
}
|
||||
|
||||
echo <<<EOPHP
|
||||
];
|
||||
}
|
||||
|
||||
EOPHP;
|
94
vendor/symfony/error-handler/Resources/bin/patch-type-declarations
vendored
Executable file
@ -0,0 +1,94 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
if (\in_array('-h', $argv) || \in_array('--help', $argv)) {
|
||||
echo implode(PHP_EOL, [
|
||||
' Patches type declarations based on "@return" PHPDoc and triggers deprecations for',
|
||||
' incompatible method declarations.',
|
||||
'',
|
||||
' This assists you to make your package compatible with Symfony 6, but it can be used',
|
||||
' for any class/package.',
|
||||
'',
|
||||
' Available configuration via environment variables:',
|
||||
' SYMFONY_PATCH_TYPE_DECLARATIONS',
|
||||
' An url-encoded string to change the behavior of the script. Available parameters:',
|
||||
' - "force": any value enables deprecation notices - can be any of:',
|
||||
' - "phpdoc" to patch only docblock annotations',
|
||||
' - "2" to add all possible return types',
|
||||
' - "1" to add return types but only to tests/final/internal/private methods',
|
||||
' - "php": the target version of PHP - e.g. "7.1" doesn\'t generate "object" types',
|
||||
' - "deprecations": "1" to trigger a deprecation notice when a child class misses a',
|
||||
' return type while the parent declares an "@return" annotation',
|
||||
'',
|
||||
' SYMFONY_PATCH_TYPE_EXCLUDE',
|
||||
' A regex matched against the full path to the class - any match will be excluded',
|
||||
'',
|
||||
' Example: "SYMFONY_PATCH_TYPE_DECLARATIONS=php=7.4 ./patch-type-declarations"',
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (false === getenv('SYMFONY_PATCH_TYPE_DECLARATIONS')) {
|
||||
putenv('SYMFONY_PATCH_TYPE_DECLARATIONS=force=2');
|
||||
echo 'No SYMFONY_PATCH_TYPE_DECLARATIONS env var set, patching type declarations in all methods (run the command with "-h" for more information).'.PHP_EOL;
|
||||
}
|
||||
|
||||
if (is_file($autoload = __DIR__.'/../../../../autoload.php')) {
|
||||
// noop
|
||||
} elseif (is_file($autoload = __DIR__.'/../../../../../../../autoload.php')) {
|
||||
// noop
|
||||
} else {
|
||||
echo PHP_EOL.' /!\ Cannot find the Composer autoloader, did you forget to run "composer install"?'.PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (is_file($phpunitAutoload = dirname($autoload).'/bin/.phpunit/phpunit/vendor/autoload.php')) {
|
||||
require $phpunitAutoload;
|
||||
}
|
||||
|
||||
$loader = require $autoload;
|
||||
|
||||
Symfony\Component\ErrorHandler\DebugClassLoader::enable();
|
||||
|
||||
$deprecations = [];
|
||||
set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$deprecations) {
|
||||
if (\E_USER_DEPRECATED !== $type) {
|
||||
return;
|
||||
}
|
||||
|
||||
[,,,,, $class,] = explode('"', $msg);
|
||||
$deprecations[$class][] = $msg;
|
||||
});
|
||||
|
||||
$exclude = getenv('SYMFONY_PATCH_TYPE_EXCLUDE') ?: null;
|
||||
foreach ($loader->getClassMap() as $class => $file) {
|
||||
if (false !== strpos($file = realpath($file), \DIRECTORY_SEPARATOR.'vendor'.\DIRECTORY_SEPARATOR)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($exclude && preg_match($exclude, $file)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
class_exists($class);
|
||||
}
|
||||
|
||||
Symfony\Component\ErrorHandler\DebugClassLoader::checkClasses();
|
||||
|
||||
foreach ($deprecations as $class => $classDeprecations) {
|
||||
echo $class.' ('.\count($classDeprecations).')'.PHP_EOL;
|
||||
echo implode(PHP_EOL, $classDeprecations).PHP_EOL.PHP_EOL;
|
||||
}
|
||||
|
||||
if ($deprecations && false !== strpos(getenv('SYMFONY_PATCH_TYPE_DECLARATIONS') ?? '', 'force')) {
|
||||
echo 'These deprecations might be fixed by the patch script, run this again to check for type deprecations.'.PHP_EOL;
|
||||
}
|
20
vendor/symfony/error-handler/Resources/views/error.html.php
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="<?= $this->charset; ?>" />
|
||||
<meta name="robots" content="noindex,nofollow,noarchive" />
|
||||
<title>An Error Occurred: <?= $statusText; ?></title>
|
||||
<style><?= $this->include('assets/css/error.css'); ?></style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Oops! An Error Occurred</h1>
|
||||
<h2>The server returned a "<?= $statusCode; ?> <?= $statusText; ?>".</h2>
|
||||
|
||||
<p>
|
||||
Something is broken. Please let us know what you were doing when this error occurred.
|
||||
We will fix it as soon as possible. Sorry for any inconvenience caused.
|
||||
</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
116
vendor/symfony/error-handler/Resources/views/exception.html.php
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
<div class="exception-summary <?= !$exceptionMessage ? 'exception-without-message' : ''; ?>">
|
||||
<div class="exception-metadata">
|
||||
<div class="container">
|
||||
<h2 class="exception-hierarchy">
|
||||
<?php foreach (array_reverse($exception->getAllPrevious(), true) as $index => $previousException) { ?>
|
||||
<a href="#trace-box-<?= $index + 2; ?>"><?= $this->abbrClass($previousException->getClass()); ?></a>
|
||||
<span class="icon"><?= $this->include('assets/images/chevron-right.svg'); ?></span>
|
||||
<?php } ?>
|
||||
<a href="#trace-box-1"><?= $this->abbrClass($exception->getClass()); ?></a>
|
||||
</h2>
|
||||
<h2 class="exception-http">
|
||||
HTTP <?= $statusCode; ?> <small><?= $statusText; ?></small>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="exception-message-wrapper">
|
||||
<div class="container">
|
||||
<h1 class="break-long-words exception-message<?= mb_strlen($exceptionMessage) > 180 ? ' long' : ''; ?>"><?= $this->formatFileFromText(nl2br($exceptionMessage)); ?></h1>
|
||||
|
||||
<div class="exception-illustration hidden-xs-down">
|
||||
<?= $this->include('assets/images/symfony-ghost.svg.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<div class="sf-tabs">
|
||||
<div class="tab">
|
||||
<?php
|
||||
$exceptionAsArray = $exception->toArray();
|
||||
$exceptionWithUserCode = [];
|
||||
$exceptionAsArrayCount = count($exceptionAsArray);
|
||||
$last = $exceptionAsArrayCount - 1;
|
||||
foreach ($exceptionAsArray as $i => $e) {
|
||||
foreach ($e['trace'] as $trace) {
|
||||
if ($trace['file'] && false === mb_strpos($trace['file'], '/vendor/') && false === mb_strpos($trace['file'], '/var/cache/') && $i < $last) {
|
||||
$exceptionWithUserCode[] = $i;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<h3 class="tab-title">
|
||||
<?php if ($exceptionAsArrayCount > 1) { ?>
|
||||
Exceptions <span class="badge"><?= $exceptionAsArrayCount; ?></span>
|
||||
<?php } else { ?>
|
||||
Exception
|
||||
<?php } ?>
|
||||
</h3>
|
||||
|
||||
<div class="tab-content">
|
||||
<?php
|
||||
foreach ($exceptionAsArray as $i => $e) {
|
||||
echo $this->include('views/traces.html.php', [
|
||||
'exception' => $e,
|
||||
'index' => $i + 1,
|
||||
'expand' => in_array($i, $exceptionWithUserCode, true) || ([] === $exceptionWithUserCode && 0 === $i),
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($logger) { ?>
|
||||
<div class="tab <?= !$logger->getLogs() ? 'disabled' : ''; ?>">
|
||||
<h3 class="tab-title">
|
||||
Logs
|
||||
<?php if ($logger->countErrors()) { ?><span class="badge status-error"><?= $logger->countErrors(); ?></span><?php } ?>
|
||||
</h3>
|
||||
|
||||
<div class="tab-content">
|
||||
<?php if ($logger->getLogs()) { ?>
|
||||
<?= $this->include('views/logs.html.php', ['logs' => $logger->getLogs()]); ?>
|
||||
<?php } else { ?>
|
||||
<div class="empty">
|
||||
<p>No log messages</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="tab">
|
||||
<h3 class="tab-title">
|
||||
<?php if ($exceptionAsArrayCount > 1) { ?>
|
||||
Stack Traces <span class="badge"><?= $exceptionAsArrayCount; ?></span>
|
||||
<?php } else { ?>
|
||||
Stack Trace
|
||||
<?php } ?>
|
||||
</h3>
|
||||
|
||||
<div class="tab-content">
|
||||
<?php
|
||||
foreach ($exceptionAsArray as $i => $e) {
|
||||
echo $this->include('views/traces_text.html.php', [
|
||||
'exception' => $e,
|
||||
'index' => $i + 1,
|
||||
'numExceptions' => $exceptionAsArrayCount,
|
||||
]);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($currentContent) { ?>
|
||||
<div class="tab">
|
||||
<h3 class="tab-title">Output content</h3>
|
||||
|
||||
<div class="tab-content">
|
||||
<?= $currentContent; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
42
vendor/symfony/error-handler/Resources/views/exception_full.html.php
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
<!-- <?= $_message = sprintf('%s (%d %s)', $exceptionMessage, $statusCode, $statusText); ?> -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="<?= $this->charset; ?>" />
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<title><?= $_message; ?></title>
|
||||
<link rel="icon" type="image/png" href="<?= $this->include('assets/images/favicon.png.base64'); ?>">
|
||||
<style><?= $this->include('assets/css/exception.css'); ?></style>
|
||||
<style><?= $this->include('assets/css/exception_full.css'); ?></style>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
document.body.classList.add(
|
||||
localStorage.getItem('symfony/profiler/theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'theme-dark' : 'theme-light')
|
||||
);
|
||||
</script>
|
||||
|
||||
<?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>
|
||||
|
||||
<div class="help-link">
|
||||
<a href="https://symfony.com/doc/<?= Symfony\Component\HttpKernel\Kernel::VERSION; ?>/index.html">
|
||||
<span class="icon"><?= $this->include('assets/images/icon-book.svg'); ?></span>
|
||||
<span class="hidden-xs-down">Symfony</span> Docs
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<?php } ?>
|
||||
|
||||
<?= $this->include('views/exception.html.php', $context); ?>
|
||||
|
||||
<script>
|
||||
<?= $this->include('assets/js/exception.js'); ?>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<!-- <?= $_message; ?> -->
|
45
vendor/symfony/error-handler/Resources/views/logs.html.php
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
<table class="logs" data-filter-level="Emergency,Alert,Critical,Error,Warning,Notice,Info,Debug" data-filters>
|
||||
<?php $channelIsDefined = isset($logs[0]['channel']); ?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-filter="level">Level</th>
|
||||
<?php if ($channelIsDefined) { ?><th data-filter="channel">Channel</th><?php } ?>
|
||||
<th class="full-width">Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($logs as $log) {
|
||||
if ($log['priority'] >= 400) {
|
||||
$status = 'error';
|
||||
} elseif ($log['priority'] >= 300) {
|
||||
$status = 'warning';
|
||||
} else {
|
||||
$severity = 0;
|
||||
if (($exception = $log['context']['exception'] ?? null) instanceof \ErrorException || $exception instanceof \Symfony\Component\ErrorHandler\Exception\SilencedErrorContext) {
|
||||
$severity = $exception->getSeverity();
|
||||
}
|
||||
$status = \E_DEPRECATED === $severity || \E_USER_DEPRECATED === $severity ? 'warning' : 'normal';
|
||||
} ?>
|
||||
<tr class="status-<?= $status; ?>" data-filter-level="<?= strtolower($this->escape($log['priorityName'])); ?>"<?php if ($channelIsDefined) { ?> data-filter-channel="<?= $this->escape($log['channel']); ?>"<?php } ?>>
|
||||
<td class="text-small nowrap">
|
||||
<span class="colored text-bold"><?= $this->escape($log['priorityName']); ?></span>
|
||||
<span class="text-muted newline"><?= date('H:i:s', $log['timestamp']); ?></span>
|
||||
</td>
|
||||
<?php if ($channelIsDefined) { ?>
|
||||
<td class="text-small text-bold nowrap">
|
||||
<?= $this->escape($log['channel']); ?>
|
||||
</td>
|
||||
<?php } ?>
|
||||
<td>
|
||||
<?= $this->formatLogMessage($log['message'], $log['context']); ?>
|
||||
<?php if ($log['context']) { ?>
|
||||
<pre class="text-muted prewrap m-t-5"><?= $this->escape(json_encode($log['context'], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE | \JSON_UNESCAPED_SLASHES)); ?></pre>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
43
vendor/symfony/error-handler/Resources/views/trace.html.php
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<div class="trace-line-header break-long-words <?= $trace['file'] ? 'sf-toggle' : ''; ?>" data-toggle-selector="#trace-html-<?= $prefix; ?>-<?= $i; ?>" data-toggle-initial="<?= 'expanded' === $style ? 'display' : ''; ?>">
|
||||
<?php if ($trace['file']) { ?>
|
||||
<span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square.svg'); ?></span>
|
||||
<span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square.svg'); ?></span>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ('compact' !== $style && $trace['function']) { ?>
|
||||
<span class="trace-class"><?= $this->abbrClass($trace['class']); ?></span><?php if ($trace['type']) { ?><span class="trace-type"><?= $trace['type']; ?></span><?php } ?><span class="trace-method"><?= $trace['function']; ?></span><?php if (isset($trace['args'])) { ?><span class="trace-arguments">(<?= $this->formatArgs($trace['args']); ?>)</span><?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($trace['file']) { ?>
|
||||
<?php
|
||||
$lineNumber = $trace['line'] ?: 1;
|
||||
$fileLink = $this->getFileLink($trace['file'], $lineNumber);
|
||||
$filePath = strtr(strip_tags($this->formatFile($trace['file'], $lineNumber)), [' at line '.$lineNumber => '']);
|
||||
$filePathParts = explode(\DIRECTORY_SEPARATOR, $filePath);
|
||||
?>
|
||||
<span class="block trace-file-path">
|
||||
in
|
||||
<a href="<?= $fileLink; ?>">
|
||||
<?= implode(\DIRECTORY_SEPARATOR, array_slice($filePathParts, 0, -1)).\DIRECTORY_SEPARATOR; ?><strong><?= end($filePathParts); ?></strong>
|
||||
</a>
|
||||
<?php if ('compact' === $style && $trace['function']) { ?>
|
||||
<span class="trace-type"><?= $trace['type']; ?></span>
|
||||
<span class="trace-method"><?= $trace['function']; ?></span>
|
||||
<?php } ?>
|
||||
(line <?= $lineNumber; ?>)
|
||||
<span class="icon icon-copy hidden" data-clipboard-text="<?php echo implode(\DIRECTORY_SEPARATOR, $filePathParts).':'.$lineNumber; ?>">
|
||||
<?php echo $this->include('assets/images/icon-copy.svg'); ?>
|
||||
</span>
|
||||
</span>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php if ($trace['file']) { ?>
|
||||
<div id="trace-html-<?= $prefix.'-'.$i; ?>" class="trace-code sf-toggle-content">
|
||||
<?= strtr($this->fileExcerpt($trace['file'], $trace['line'], 5), [
|
||||
'#DD0000' => 'var(--highlight-string)',
|
||||
'#007700' => 'var(--highlight-keyword)',
|
||||
'#0000BB' => 'var(--highlight-default)',
|
||||
'#FF8000' => 'var(--highlight-comment)',
|
||||
]); ?>
|
||||
</div>
|
||||
<?php } ?>
|
51
vendor/symfony/error-handler/Resources/views/traces.html.php
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
<div class="trace trace-as-html" id="trace-box-<?= $index; ?>">
|
||||
<div class="trace-details">
|
||||
<div class="trace-head">
|
||||
<div class="sf-toggle" data-toggle-selector="#trace-html-<?= $index; ?>" data-toggle-initial="<?= $expand ? 'display' : ''; ?>">
|
||||
<span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.svg'); ?></span>
|
||||
<span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square-o.svg'); ?></span>
|
||||
<?php
|
||||
$separator = strrpos($exception['class'], '\\');
|
||||
$separator = false === $separator ? 0 : $separator + 1;
|
||||
|
||||
$namespace = substr($exception['class'], 0, $separator);
|
||||
$class = substr($exception['class'], $separator);
|
||||
?>
|
||||
<?php if ('' === $class) { ?>
|
||||
</br>
|
||||
<?php } else { ?>
|
||||
<h3 class="trace-class">
|
||||
<?php if ('' !== $namespace) { ?>
|
||||
<span class="trace-namespace"><?= $namespace; ?></span>
|
||||
<?php } ?>
|
||||
<?= $class; ?>
|
||||
</h3>
|
||||
<?php } ?>
|
||||
<?php if ($exception['message'] && $index > 1) { ?>
|
||||
<p class="break-long-words trace-message"><?= $this->escape($exception['message']); ?></p>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="trace-html-<?= $index; ?>" class="sf-toggle-content">
|
||||
<?php
|
||||
$isFirstUserCode = true;
|
||||
foreach ($exception['trace'] as $i => $trace) {
|
||||
$isVendorTrace = $trace['file'] && (false !== mb_strpos($trace['file'], '/vendor/') || false !== mb_strpos($trace['file'], '/var/cache/'));
|
||||
$displayCodeSnippet = $isFirstUserCode && !$isVendorTrace;
|
||||
if ($displayCodeSnippet) {
|
||||
$isFirstUserCode = false;
|
||||
} ?>
|
||||
<div class="trace-line <?= $isVendorTrace ? 'trace-from-vendor' : ''; ?>">
|
||||
<?= $this->include('views/trace.html.php', [
|
||||
'prefix' => $index,
|
||||
'i' => $i,
|
||||
'trace' => $trace,
|
||||
'style' => $isVendorTrace ? 'compact' : ($displayCodeSnippet ? 'expanded' : ''),
|
||||
]); ?>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
43
vendor/symfony/error-handler/Resources/views/traces_text.html.php
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
<table class="trace trace-as-text">
|
||||
<thead class="trace-head">
|
||||
<tr>
|
||||
<th class="sf-toggle" data-toggle-selector="#trace-text-<?= $index; ?>" data-toggle-initial="<?= 1 === $index ? 'display' : ''; ?>">
|
||||
<div class="trace-class">
|
||||
<?php if ($numExceptions > 1) { ?>
|
||||
<span class="text-muted">[<?= $numExceptions - $index + 1; ?>/<?= $numExceptions; ?>]</span>
|
||||
<?php } ?>
|
||||
<?= ($parts = explode('\\', $exception['class'])) ? end($parts) : ''; ?>
|
||||
<span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square-o.svg'); ?></span>
|
||||
<span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square-o.svg'); ?></span>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="trace-text-<?= $index; ?>">
|
||||
<tr>
|
||||
<td>
|
||||
<?php if ($exception['trace']) { ?>
|
||||
<pre class="stacktrace">
|
||||
<?php
|
||||
echo $this->escape($exception['class']).":\n";
|
||||
if ($exception['message']) {
|
||||
echo $this->escape($exception['message'])."\n";
|
||||
}
|
||||
|
||||
foreach ($exception['trace'] as $trace) {
|
||||
echo "\n ";
|
||||
if ($trace['function']) {
|
||||
echo $this->escape('at '.$trace['class'].$trace['type'].$trace['function']).'('.(isset($trace['args']) ? $this->formatArgsAsText($trace['args']) : '').')';
|
||||
}
|
||||
if ($trace['file'] && $trace['line']) {
|
||||
echo($trace['function'] ? "\n (" : 'at ').strtr(strip_tags($this->formatFile($trace['file'], $trace['line'])), [' at line '.$trace['line'] => '']).':'.$trace['line'].($trace['function'] ? ')' : '');
|
||||
}
|
||||
}
|
||||
?>
|
||||
</pre>
|
||||
<?php } ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
40
vendor/symfony/error-handler/ThrowableUtils.php
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\ErrorHandler;
|
||||
|
||||
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
class ThrowableUtils
|
||||
{
|
||||
/**
|
||||
* @param SilencedErrorContext|\Throwable
|
||||
*/
|
||||
public static function getSeverity($throwable): int
|
||||
{
|
||||
if ($throwable instanceof \ErrorException || $throwable instanceof SilencedErrorContext) {
|
||||
return $throwable->getSeverity();
|
||||
}
|
||||
|
||||
if ($throwable instanceof \ParseError) {
|
||||
return \E_PARSE;
|
||||
}
|
||||
|
||||
if ($throwable instanceof \TypeError) {
|
||||
return \E_RECOVERABLE_ERROR;
|
||||
}
|
||||
|
||||
return \E_ERROR;
|
||||
}
|
||||
}
|
38
vendor/symfony/error-handler/composer.json
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "symfony/error-handler",
|
||||
"type": "library",
|
||||
"description": "Provides tools to manage errors and ease debugging PHP code",
|
||||
"keywords": [],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"psr/log": "^1|^2|^3",
|
||||
"symfony/var-dumper": "^4.4|^5.0|^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/http-kernel": "^4.4|^5.0|^6.0",
|
||||
"symfony/serializer": "^4.4|^5.0|^6.0",
|
||||
"symfony/deprecation-contracts": "^2.1|^3"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Component\\ErrorHandler\\": "" },
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"bin": [
|
||||
"Resources/bin/patch-type-declarations"
|
||||
],
|
||||
"minimum-stability": "dev"
|
||||
}
|