upgrading to timber v2
This commit is contained in:
5
vendor/symfony/deprecation-contracts/CHANGELOG.md
vendored
Normal file
5
vendor/symfony/deprecation-contracts/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
The changelog is maintained for all Symfony contracts at the following URL:
|
||||
https://github.com/symfony/contracts/blob/main/CHANGELOG.md
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2014-2020 Fabien Potencier
|
||||
Copyright (c) 2020-present 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
|
||||
26
vendor/symfony/deprecation-contracts/README.md
vendored
Normal file
26
vendor/symfony/deprecation-contracts/README.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
Symfony Deprecation Contracts
|
||||
=============================
|
||||
|
||||
A generic function and convention to trigger deprecation notices.
|
||||
|
||||
This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices.
|
||||
|
||||
By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component,
|
||||
the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments.
|
||||
|
||||
The function requires at least 3 arguments:
|
||||
- the name of the Composer package that is triggering the deprecation
|
||||
- the version of the package that introduced the deprecation
|
||||
- the message of the deprecation
|
||||
- more arguments can be provided: they will be inserted in the message using `printf()` formatting
|
||||
|
||||
Example:
|
||||
```php
|
||||
trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin');
|
||||
```
|
||||
|
||||
This will generate the following message:
|
||||
`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.`
|
||||
|
||||
While not recommended, the deprecation notices can be completely ignored by declaring an empty
|
||||
`function trigger_deprecation() {}` in your application.
|
||||
35
vendor/symfony/deprecation-contracts/composer.json
vendored
Normal file
35
vendor/symfony/deprecation-contracts/composer.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"type": "library",
|
||||
"description": "A generic function and convention to trigger deprecation notices",
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=8.1"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"function.php"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-main": "3.6-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
}
|
||||
}
|
||||
27
vendor/symfony/deprecation-contracts/function.php
vendored
Normal file
27
vendor/symfony/deprecation-contracts/function.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.
|
||||
*/
|
||||
|
||||
if (!function_exists('trigger_deprecation')) {
|
||||
/**
|
||||
* Triggers a silenced deprecation notice.
|
||||
*
|
||||
* @param string $package The name of the Composer package that is triggering the deprecation
|
||||
* @param string $version The version of the package that introduced the deprecation
|
||||
* @param string $message The message of the deprecation
|
||||
* @param mixed ...$args Values to insert in the message using printf() formatting
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void
|
||||
{
|
||||
@trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
|
||||
}
|
||||
}
|
||||
2
vendor/symfony/polyfill-mbstring/LICENSE
vendored
2
vendor/symfony/polyfill-mbstring/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2015-2019 Fabien Potencier
|
||||
Copyright (c) 2015-present 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
|
||||
|
||||
324
vendor/symfony/polyfill-mbstring/Mbstring.php
vendored
324
vendor/symfony/polyfill-mbstring/Mbstring.php
vendored
@@ -48,6 +48,11 @@ namespace Symfony\Polyfill\Mbstring;
|
||||
* - mb_strstr - Finds first occurrence of a string within another
|
||||
* - mb_strwidth - Return width of string
|
||||
* - mb_substr_count - Count the number of substring occurrences
|
||||
* - mb_ucfirst - Make a string's first character uppercase
|
||||
* - mb_lcfirst - Make a string's first character lowercase
|
||||
* - mb_trim - Strip whitespace (or other characters) from the beginning and end of a string
|
||||
* - mb_ltrim - Strip whitespace (or other characters) from the beginning of a string
|
||||
* - mb_rtrim - Strip whitespace (or other characters) from the end of a string
|
||||
*
|
||||
* Not implemented:
|
||||
* - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more)
|
||||
@@ -67,19 +72,29 @@ namespace Symfony\Polyfill\Mbstring;
|
||||
*/
|
||||
final class Mbstring
|
||||
{
|
||||
const MB_CASE_FOLD = PHP_INT_MAX;
|
||||
public const MB_CASE_FOLD = \PHP_INT_MAX;
|
||||
|
||||
private static $encodingList = array('ASCII', 'UTF-8');
|
||||
private const SIMPLE_CASE_FOLD = [
|
||||
['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"],
|
||||
['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'],
|
||||
];
|
||||
|
||||
private static $encodingList = ['ASCII', 'UTF-8'];
|
||||
private static $language = 'neutral';
|
||||
private static $internalEncoding = 'UTF-8';
|
||||
private static $caseFold = array(
|
||||
array('µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"),
|
||||
array('μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'),
|
||||
);
|
||||
|
||||
public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null)
|
||||
{
|
||||
if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) {
|
||||
if (\is_array($s)) {
|
||||
$r = [];
|
||||
foreach ($s as $str) {
|
||||
$r[] = self::mb_convert_encoding($str, $toEncoding, $fromEncoding);
|
||||
}
|
||||
|
||||
return $r;
|
||||
}
|
||||
|
||||
if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) {
|
||||
$fromEncoding = self::mb_detect_encoding($s, $fromEncoding);
|
||||
} else {
|
||||
$fromEncoding = self::getEncoding($fromEncoding);
|
||||
@@ -104,24 +119,22 @@ final class Mbstring
|
||||
$s = iconv($fromEncoding, 'UTF-8//IGNORE', $s);
|
||||
}
|
||||
|
||||
return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s);
|
||||
return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s);
|
||||
}
|
||||
|
||||
if ('HTML-ENTITIES' === $fromEncoding) {
|
||||
$s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
|
||||
$s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8');
|
||||
$fromEncoding = 'UTF-8';
|
||||
}
|
||||
|
||||
return iconv($fromEncoding, $toEncoding.'//IGNORE', $s);
|
||||
}
|
||||
|
||||
public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null)
|
||||
public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars)
|
||||
{
|
||||
$vars = array(&$a, &$b, &$c, &$d, &$e, &$f);
|
||||
|
||||
$ok = true;
|
||||
array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) {
|
||||
if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) {
|
||||
if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) {
|
||||
$ok = false;
|
||||
}
|
||||
});
|
||||
@@ -136,23 +149,23 @@ final class Mbstring
|
||||
|
||||
public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null)
|
||||
{
|
||||
trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING);
|
||||
trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING);
|
||||
}
|
||||
|
||||
public static function mb_decode_numericentity($s, $convmap, $encoding = null)
|
||||
{
|
||||
if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) {
|
||||
trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING);
|
||||
if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
|
||||
trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!\is_array($convmap) || !$convmap) {
|
||||
if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (null !== $encoding && !\is_scalar($encoding)) {
|
||||
trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING);
|
||||
trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
|
||||
|
||||
return ''; // Instead of null (cf. mb_encode_numericentity).
|
||||
}
|
||||
@@ -185,7 +198,7 @@ final class Mbstring
|
||||
$c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1];
|
||||
for ($i = 0; $i < $cnt; $i += 4) {
|
||||
if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) {
|
||||
return Mbstring::mb_chr($c - $convmap[$i + 2]);
|
||||
return self::mb_chr($c - $convmap[$i + 2]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,24 +214,24 @@ final class Mbstring
|
||||
|
||||
public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false)
|
||||
{
|
||||
if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) {
|
||||
trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING);
|
||||
if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) {
|
||||
trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!\is_array($convmap) || !$convmap) {
|
||||
if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (null !== $encoding && !\is_scalar($encoding)) {
|
||||
trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING);
|
||||
trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING);
|
||||
|
||||
return null; // Instead of '' (cf. mb_decode_numericentity).
|
||||
}
|
||||
|
||||
if (null !== $is_hex && !\is_scalar($is_hex)) {
|
||||
trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', E_USER_WARNING);
|
||||
trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -239,7 +252,7 @@ final class Mbstring
|
||||
$s = iconv($encoding, 'UTF-8//IGNORE', $s);
|
||||
}
|
||||
|
||||
static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4);
|
||||
static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
|
||||
|
||||
$cnt = floor(\count($convmap) / 4) * 4;
|
||||
$i = 0;
|
||||
@@ -287,14 +300,14 @@ final class Mbstring
|
||||
$s = iconv($encoding, 'UTF-8//IGNORE', $s);
|
||||
}
|
||||
|
||||
if (MB_CASE_TITLE == $mode) {
|
||||
if (\MB_CASE_TITLE == $mode) {
|
||||
static $titleRegexp = null;
|
||||
if (null === $titleRegexp) {
|
||||
$titleRegexp = self::getData('titleCaseRegexp');
|
||||
}
|
||||
$s = preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s);
|
||||
$s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s);
|
||||
} else {
|
||||
if (MB_CASE_UPPER == $mode) {
|
||||
if (\MB_CASE_UPPER == $mode) {
|
||||
static $upper = null;
|
||||
if (null === $upper) {
|
||||
$upper = self::getData('upperCase');
|
||||
@@ -302,7 +315,11 @@ final class Mbstring
|
||||
$map = $upper;
|
||||
} else {
|
||||
if (self::MB_CASE_FOLD === $mode) {
|
||||
$s = str_replace(self::$caseFold[0], self::$caseFold[1], $s);
|
||||
static $caseFolding = null;
|
||||
if (null === $caseFolding) {
|
||||
$caseFolding = self::getData('caseFolding');
|
||||
}
|
||||
$s = strtr($s, $caseFolding);
|
||||
}
|
||||
|
||||
static $lower = null;
|
||||
@@ -312,7 +329,7 @@ final class Mbstring
|
||||
$map = $lower;
|
||||
}
|
||||
|
||||
static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4);
|
||||
static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
|
||||
|
||||
$i = 0;
|
||||
$len = \strlen($s);
|
||||
@@ -353,15 +370,19 @@ final class Mbstring
|
||||
return self::$internalEncoding;
|
||||
}
|
||||
|
||||
$encoding = self::getEncoding($encoding);
|
||||
$normalizedEncoding = self::getEncoding($encoding);
|
||||
|
||||
if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) {
|
||||
self::$internalEncoding = $encoding;
|
||||
if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) {
|
||||
self::$internalEncoding = $normalizedEncoding;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding));
|
||||
}
|
||||
|
||||
public static function mb_language($lang = null)
|
||||
@@ -370,20 +391,24 @@ final class Mbstring
|
||||
return self::$language;
|
||||
}
|
||||
|
||||
switch ($lang = strtolower($lang)) {
|
||||
switch ($normalizedLang = strtolower($lang)) {
|
||||
case 'uni':
|
||||
case 'neutral':
|
||||
self::$language = $lang;
|
||||
self::$language = $normalizedLang;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang));
|
||||
}
|
||||
|
||||
public static function mb_list_encodings()
|
||||
{
|
||||
return array('UTF-8');
|
||||
return ['UTF-8'];
|
||||
}
|
||||
|
||||
public static function mb_encoding_aliases($encoding)
|
||||
@@ -391,7 +416,7 @@ final class Mbstring
|
||||
switch (strtoupper($encoding)) {
|
||||
case 'UTF8':
|
||||
case 'UTF-8':
|
||||
return array('utf8');
|
||||
return ['utf8'];
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -406,7 +431,20 @@ final class Mbstring
|
||||
$encoding = self::$internalEncoding;
|
||||
}
|
||||
|
||||
return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var);
|
||||
if (!\is_array($var)) {
|
||||
return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var);
|
||||
}
|
||||
|
||||
foreach ($var as $key => $value) {
|
||||
if (!self::mb_check_encoding($key, $encoding)) {
|
||||
return false;
|
||||
}
|
||||
if (!self::mb_check_encoding($value, $encoding)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function mb_detect_encoding($str, $encodingList = null, $strict = false)
|
||||
@@ -493,9 +531,13 @@ final class Mbstring
|
||||
|
||||
$needle = (string) $needle;
|
||||
if ('' === $needle) {
|
||||
trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING);
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING);
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return iconv_strpos($haystack, $needle, $offset, $encoding);
|
||||
@@ -521,23 +563,29 @@ final class Mbstring
|
||||
}
|
||||
}
|
||||
|
||||
$pos = iconv_strrpos($haystack, $needle, $encoding);
|
||||
$pos = '' !== $needle || 80000 > \PHP_VERSION_ID
|
||||
? iconv_strrpos($haystack, $needle, $encoding)
|
||||
: self::mb_strlen($haystack, $encoding);
|
||||
|
||||
return false !== $pos ? $offset + $pos : false;
|
||||
}
|
||||
|
||||
public static function mb_str_split($string, $split_length = 1, $encoding = null)
|
||||
{
|
||||
if (null !== $string && !\is_scalar($string) && !(\is_object($string) && \method_exists($string, '__toString'))) {
|
||||
trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', E_USER_WARNING);
|
||||
if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) {
|
||||
trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (1 > $split_length = (int) $split_length) {
|
||||
trigger_error('The length of each segment must be greater than zero', E_USER_WARNING);
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING);
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new \ValueError('Argument #2 ($length) must be greater than 0');
|
||||
}
|
||||
|
||||
if (null === $encoding) {
|
||||
@@ -552,10 +600,10 @@ final class Mbstring
|
||||
}
|
||||
$rx .= '.{'.$split_length.'})/us';
|
||||
|
||||
return preg_split($rx, $string, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
|
||||
return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
|
||||
}
|
||||
|
||||
$result = array();
|
||||
$result = [];
|
||||
$length = mb_strlen($string, $encoding);
|
||||
|
||||
for ($i = 0; $i < $length; $i += $split_length) {
|
||||
@@ -567,21 +615,30 @@ final class Mbstring
|
||||
|
||||
public static function mb_strtolower($s, $encoding = null)
|
||||
{
|
||||
return self::mb_convert_case($s, MB_CASE_LOWER, $encoding);
|
||||
return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding);
|
||||
}
|
||||
|
||||
public static function mb_strtoupper($s, $encoding = null)
|
||||
{
|
||||
return self::mb_convert_case($s, MB_CASE_UPPER, $encoding);
|
||||
return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding);
|
||||
}
|
||||
|
||||
public static function mb_substitute_character($c = null)
|
||||
{
|
||||
if (null === $c) {
|
||||
return 'none';
|
||||
}
|
||||
if (0 === strcasecmp($c, 'none')) {
|
||||
return true;
|
||||
}
|
||||
if (80000 > \PHP_VERSION_ID) {
|
||||
return false;
|
||||
}
|
||||
if (\is_int($c) || 'long' === $c || 'entity' === $c) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return null !== $c ? false : 'none';
|
||||
throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint');
|
||||
}
|
||||
|
||||
public static function mb_substr($s, $start, $length = null, $encoding = null)
|
||||
@@ -612,8 +669,10 @@ final class Mbstring
|
||||
|
||||
public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null)
|
||||
{
|
||||
$haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
|
||||
$needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
|
||||
[$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [
|
||||
self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding),
|
||||
self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding),
|
||||
]);
|
||||
|
||||
return self::mb_strpos($haystack, $needle, $offset, $encoding);
|
||||
}
|
||||
@@ -629,10 +688,11 @@ final class Mbstring
|
||||
{
|
||||
$encoding = self::getEncoding($encoding);
|
||||
if ('CP850' === $encoding || 'ASCII' === $encoding) {
|
||||
return strrchr($haystack, $needle, $part);
|
||||
$pos = strrpos($haystack, $needle);
|
||||
} else {
|
||||
$needle = self::mb_substr($needle, 0, 1, $encoding);
|
||||
$pos = iconv_strrpos($haystack, $needle, $encoding);
|
||||
}
|
||||
$needle = self::mb_substr($needle, 0, 1, $encoding);
|
||||
$pos = iconv_strrpos($haystack, $needle, $encoding);
|
||||
|
||||
return self::getSubpart($pos, $part, $haystack, $encoding);
|
||||
}
|
||||
@@ -647,8 +707,11 @@ final class Mbstring
|
||||
|
||||
public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null)
|
||||
{
|
||||
$haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding);
|
||||
$needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding);
|
||||
$haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding);
|
||||
$needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding);
|
||||
|
||||
$haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack);
|
||||
$needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle);
|
||||
|
||||
return self::mb_strrpos($haystack, $needle, $offset, $encoding);
|
||||
}
|
||||
@@ -668,7 +731,7 @@ final class Mbstring
|
||||
|
||||
public static function mb_get_info($type = 'all')
|
||||
{
|
||||
$info = array(
|
||||
$info = [
|
||||
'internal_encoding' => self::$internalEncoding,
|
||||
'http_output' => 'pass',
|
||||
'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)',
|
||||
@@ -683,7 +746,7 @@ final class Mbstring
|
||||
'detect_order' => self::$encodingList,
|
||||
'substitute_character' => 'none',
|
||||
'strict_detection' => 'Off',
|
||||
);
|
||||
];
|
||||
|
||||
if ('all' === $type) {
|
||||
return $info;
|
||||
@@ -771,6 +834,69 @@ final class Mbstring
|
||||
return $code;
|
||||
}
|
||||
|
||||
public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, ?string $encoding = null): string
|
||||
{
|
||||
if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) {
|
||||
throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH');
|
||||
}
|
||||
|
||||
if (null === $encoding) {
|
||||
$encoding = self::mb_internal_encoding();
|
||||
} else {
|
||||
self::assertEncoding($encoding, 'mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given');
|
||||
}
|
||||
|
||||
if (self::mb_strlen($pad_string, $encoding) <= 0) {
|
||||
throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string');
|
||||
}
|
||||
|
||||
$paddingRequired = $length - self::mb_strlen($string, $encoding);
|
||||
|
||||
if ($paddingRequired < 1) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
switch ($pad_type) {
|
||||
case \STR_PAD_LEFT:
|
||||
return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string;
|
||||
case \STR_PAD_RIGHT:
|
||||
return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding);
|
||||
default:
|
||||
$leftPaddingLength = floor($paddingRequired / 2);
|
||||
$rightPaddingLength = $paddingRequired - $leftPaddingLength;
|
||||
|
||||
return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding);
|
||||
}
|
||||
}
|
||||
|
||||
public static function mb_ucfirst(string $string, ?string $encoding = null): string
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = self::mb_internal_encoding();
|
||||
} else {
|
||||
self::assertEncoding($encoding, 'mb_ucfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given');
|
||||
}
|
||||
|
||||
$firstChar = mb_substr($string, 0, 1, $encoding);
|
||||
$firstChar = mb_convert_case($firstChar, \MB_CASE_TITLE, $encoding);
|
||||
|
||||
return $firstChar.mb_substr($string, 1, null, $encoding);
|
||||
}
|
||||
|
||||
public static function mb_lcfirst(string $string, ?string $encoding = null): string
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = self::mb_internal_encoding();
|
||||
} else {
|
||||
self::assertEncoding($encoding, 'mb_lcfirst(): Argument #2 ($encoding) must be a valid encoding, "%s" given');
|
||||
}
|
||||
|
||||
$firstChar = mb_substr($string, 0, 1, $encoding);
|
||||
$firstChar = mb_convert_case($firstChar, \MB_CASE_LOWER, $encoding);
|
||||
|
||||
return $firstChar.mb_substr($string, 1, null, $encoding);
|
||||
}
|
||||
|
||||
private static function getSubpart($pos, $part, $haystack, $encoding)
|
||||
{
|
||||
if (false === $pos) {
|
||||
@@ -787,7 +913,7 @@ final class Mbstring
|
||||
{
|
||||
$i = 1;
|
||||
$entities = '';
|
||||
$m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8'));
|
||||
$m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8'));
|
||||
|
||||
while (isset($m[$i])) {
|
||||
if (0x80 > $m[$i]) {
|
||||
@@ -810,7 +936,7 @@ final class Mbstring
|
||||
|
||||
private static function title_case(array $s)
|
||||
{
|
||||
return self::mb_convert_case($s[1], MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], MB_CASE_LOWER, 'UTF-8');
|
||||
return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8');
|
||||
}
|
||||
|
||||
private static function getData($file)
|
||||
@@ -844,4 +970,76 @@ final class Mbstring
|
||||
|
||||
return $encoding;
|
||||
}
|
||||
|
||||
public static function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
{
|
||||
return self::mb_internal_trim('{^[%s]+|[%1$s]+$}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
public static function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
{
|
||||
return self::mb_internal_trim('{^[%s]+}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
public static function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string
|
||||
{
|
||||
return self::mb_internal_trim('{[%s]+$}Du', $string, $characters, $encoding, __FUNCTION__);
|
||||
}
|
||||
|
||||
private static function mb_internal_trim(string $regex, string $string, ?string $characters, ?string $encoding, string $function): string
|
||||
{
|
||||
if (null === $encoding) {
|
||||
$encoding = self::mb_internal_encoding();
|
||||
} else {
|
||||
self::assertEncoding($encoding, $function.'(): Argument #3 ($encoding) must be a valid encoding, "%s" given');
|
||||
}
|
||||
|
||||
if ('' === $characters) {
|
||||
return null === $encoding ? $string : self::mb_convert_encoding($string, $encoding);
|
||||
}
|
||||
|
||||
if ('UTF-8' === $encoding) {
|
||||
$encoding = null;
|
||||
if (!preg_match('//u', $string)) {
|
||||
$string = @iconv('UTF-8', 'UTF-8//IGNORE', $string);
|
||||
}
|
||||
if (null !== $characters && !preg_match('//u', $characters)) {
|
||||
$characters = @iconv('UTF-8', 'UTF-8//IGNORE', $characters);
|
||||
}
|
||||
} else {
|
||||
$string = iconv($encoding, 'UTF-8//IGNORE', $string);
|
||||
|
||||
if (null !== $characters) {
|
||||
$characters = iconv($encoding, 'UTF-8//IGNORE', $characters);
|
||||
}
|
||||
}
|
||||
|
||||
if (null === $characters) {
|
||||
$characters = "\\0 \f\n\r\t\v\u{00A0}\u{1680}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{2028}\u{2029}\u{202F}\u{205F}\u{3000}\u{0085}\u{180E}";
|
||||
} else {
|
||||
$characters = preg_quote($characters);
|
||||
}
|
||||
|
||||
$string = preg_replace(sprintf($regex, $characters), '', $string);
|
||||
|
||||
if (null === $encoding) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
return iconv('UTF-8', $encoding.'//IGNORE', $string);
|
||||
}
|
||||
|
||||
private static function assertEncoding(string $encoding, string $errorFormat): void
|
||||
{
|
||||
try {
|
||||
$validEncoding = @self::mb_check_encoding('', $encoding);
|
||||
} catch (\ValueError $e) {
|
||||
throw new \ValueError(sprintf($errorFormat, $encoding));
|
||||
}
|
||||
|
||||
// BC for PHP 7.3 and lower
|
||||
if (!$validEncoding) {
|
||||
throw new \ValueError(sprintf($errorFormat, $encoding));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
2
vendor/symfony/polyfill-mbstring/README.md
vendored
2
vendor/symfony/polyfill-mbstring/README.md
vendored
@@ -5,7 +5,7 @@ This component provides a partial, native PHP implementation for the
|
||||
[Mbstring](https://php.net/mbstring) extension.
|
||||
|
||||
More information can be found in the
|
||||
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
|
||||
[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
119
vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php
vendored
Normal file
119
vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'İ' => 'i̇',
|
||||
'µ' => 'μ',
|
||||
'ſ' => 's',
|
||||
'ͅ' => 'ι',
|
||||
'ς' => 'σ',
|
||||
'ϐ' => 'β',
|
||||
'ϑ' => 'θ',
|
||||
'ϕ' => 'φ',
|
||||
'ϖ' => 'π',
|
||||
'ϰ' => 'κ',
|
||||
'ϱ' => 'ρ',
|
||||
'ϵ' => 'ε',
|
||||
'ẛ' => 'ṡ',
|
||||
'ι' => 'ι',
|
||||
'ß' => 'ss',
|
||||
'ʼn' => 'ʼn',
|
||||
'ǰ' => 'ǰ',
|
||||
'ΐ' => 'ΐ',
|
||||
'ΰ' => 'ΰ',
|
||||
'և' => 'եւ',
|
||||
'ẖ' => 'ẖ',
|
||||
'ẗ' => 'ẗ',
|
||||
'ẘ' => 'ẘ',
|
||||
'ẙ' => 'ẙ',
|
||||
'ẚ' => 'aʾ',
|
||||
'ẞ' => 'ss',
|
||||
'ὐ' => 'ὐ',
|
||||
'ὒ' => 'ὒ',
|
||||
'ὔ' => 'ὔ',
|
||||
'ὖ' => 'ὖ',
|
||||
'ᾀ' => 'ἀι',
|
||||
'ᾁ' => 'ἁι',
|
||||
'ᾂ' => 'ἂι',
|
||||
'ᾃ' => 'ἃι',
|
||||
'ᾄ' => 'ἄι',
|
||||
'ᾅ' => 'ἅι',
|
||||
'ᾆ' => 'ἆι',
|
||||
'ᾇ' => 'ἇι',
|
||||
'ᾈ' => 'ἀι',
|
||||
'ᾉ' => 'ἁι',
|
||||
'ᾊ' => 'ἂι',
|
||||
'ᾋ' => 'ἃι',
|
||||
'ᾌ' => 'ἄι',
|
||||
'ᾍ' => 'ἅι',
|
||||
'ᾎ' => 'ἆι',
|
||||
'ᾏ' => 'ἇι',
|
||||
'ᾐ' => 'ἠι',
|
||||
'ᾑ' => 'ἡι',
|
||||
'ᾒ' => 'ἢι',
|
||||
'ᾓ' => 'ἣι',
|
||||
'ᾔ' => 'ἤι',
|
||||
'ᾕ' => 'ἥι',
|
||||
'ᾖ' => 'ἦι',
|
||||
'ᾗ' => 'ἧι',
|
||||
'ᾘ' => 'ἠι',
|
||||
'ᾙ' => 'ἡι',
|
||||
'ᾚ' => 'ἢι',
|
||||
'ᾛ' => 'ἣι',
|
||||
'ᾜ' => 'ἤι',
|
||||
'ᾝ' => 'ἥι',
|
||||
'ᾞ' => 'ἦι',
|
||||
'ᾟ' => 'ἧι',
|
||||
'ᾠ' => 'ὠι',
|
||||
'ᾡ' => 'ὡι',
|
||||
'ᾢ' => 'ὢι',
|
||||
'ᾣ' => 'ὣι',
|
||||
'ᾤ' => 'ὤι',
|
||||
'ᾥ' => 'ὥι',
|
||||
'ᾦ' => 'ὦι',
|
||||
'ᾧ' => 'ὧι',
|
||||
'ᾨ' => 'ὠι',
|
||||
'ᾩ' => 'ὡι',
|
||||
'ᾪ' => 'ὢι',
|
||||
'ᾫ' => 'ὣι',
|
||||
'ᾬ' => 'ὤι',
|
||||
'ᾭ' => 'ὥι',
|
||||
'ᾮ' => 'ὦι',
|
||||
'ᾯ' => 'ὧι',
|
||||
'ᾲ' => 'ὰι',
|
||||
'ᾳ' => 'αι',
|
||||
'ᾴ' => 'άι',
|
||||
'ᾶ' => 'ᾶ',
|
||||
'ᾷ' => 'ᾶι',
|
||||
'ᾼ' => 'αι',
|
||||
'ῂ' => 'ὴι',
|
||||
'ῃ' => 'ηι',
|
||||
'ῄ' => 'ήι',
|
||||
'ῆ' => 'ῆ',
|
||||
'ῇ' => 'ῆι',
|
||||
'ῌ' => 'ηι',
|
||||
'ῒ' => 'ῒ',
|
||||
'ῖ' => 'ῖ',
|
||||
'ῗ' => 'ῗ',
|
||||
'ῢ' => 'ῢ',
|
||||
'ῤ' => 'ῤ',
|
||||
'ῦ' => 'ῦ',
|
||||
'ῧ' => 'ῧ',
|
||||
'ῲ' => 'ὼι',
|
||||
'ῳ' => 'ωι',
|
||||
'ῴ' => 'ώι',
|
||||
'ῶ' => 'ῶ',
|
||||
'ῷ' => 'ῶι',
|
||||
'ῼ' => 'ωι',
|
||||
'ff' => 'ff',
|
||||
'fi' => 'fi',
|
||||
'fl' => 'fl',
|
||||
'ffi' => 'ffi',
|
||||
'ffl' => 'ffl',
|
||||
'ſt' => 'st',
|
||||
'st' => 'st',
|
||||
'ﬓ' => 'մն',
|
||||
'ﬔ' => 'մե',
|
||||
'ﬕ' => 'մի',
|
||||
'ﬖ' => 'վն',
|
||||
'ﬗ' => 'մխ',
|
||||
];
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
return array (
|
||||
'A' => 'a',
|
||||
'B' => 'b',
|
||||
'C' => 'c',
|
||||
@@ -81,7 +81,7 @@ return array(
|
||||
'Ī' => 'ī',
|
||||
'Ĭ' => 'ĭ',
|
||||
'Į' => 'į',
|
||||
'İ' => 'i',
|
||||
'İ' => 'i̇',
|
||||
'IJ' => 'ij',
|
||||
'Ĵ' => 'ĵ',
|
||||
'Ķ' => 'ķ',
|
||||
@@ -510,6 +510,138 @@ return array(
|
||||
'Ⴥ' => 'ⴥ',
|
||||
'Ⴧ' => 'ⴧ',
|
||||
'Ⴭ' => 'ⴭ',
|
||||
'Ꭰ' => 'ꭰ',
|
||||
'Ꭱ' => 'ꭱ',
|
||||
'Ꭲ' => 'ꭲ',
|
||||
'Ꭳ' => 'ꭳ',
|
||||
'Ꭴ' => 'ꭴ',
|
||||
'Ꭵ' => 'ꭵ',
|
||||
'Ꭶ' => 'ꭶ',
|
||||
'Ꭷ' => 'ꭷ',
|
||||
'Ꭸ' => 'ꭸ',
|
||||
'Ꭹ' => 'ꭹ',
|
||||
'Ꭺ' => 'ꭺ',
|
||||
'Ꭻ' => 'ꭻ',
|
||||
'Ꭼ' => 'ꭼ',
|
||||
'Ꭽ' => 'ꭽ',
|
||||
'Ꭾ' => 'ꭾ',
|
||||
'Ꭿ' => 'ꭿ',
|
||||
'Ꮀ' => 'ꮀ',
|
||||
'Ꮁ' => 'ꮁ',
|
||||
'Ꮂ' => 'ꮂ',
|
||||
'Ꮃ' => 'ꮃ',
|
||||
'Ꮄ' => 'ꮄ',
|
||||
'Ꮅ' => 'ꮅ',
|
||||
'Ꮆ' => 'ꮆ',
|
||||
'Ꮇ' => 'ꮇ',
|
||||
'Ꮈ' => 'ꮈ',
|
||||
'Ꮉ' => 'ꮉ',
|
||||
'Ꮊ' => 'ꮊ',
|
||||
'Ꮋ' => 'ꮋ',
|
||||
'Ꮌ' => 'ꮌ',
|
||||
'Ꮍ' => 'ꮍ',
|
||||
'Ꮎ' => 'ꮎ',
|
||||
'Ꮏ' => 'ꮏ',
|
||||
'Ꮐ' => 'ꮐ',
|
||||
'Ꮑ' => 'ꮑ',
|
||||
'Ꮒ' => 'ꮒ',
|
||||
'Ꮓ' => 'ꮓ',
|
||||
'Ꮔ' => 'ꮔ',
|
||||
'Ꮕ' => 'ꮕ',
|
||||
'Ꮖ' => 'ꮖ',
|
||||
'Ꮗ' => 'ꮗ',
|
||||
'Ꮘ' => 'ꮘ',
|
||||
'Ꮙ' => 'ꮙ',
|
||||
'Ꮚ' => 'ꮚ',
|
||||
'Ꮛ' => 'ꮛ',
|
||||
'Ꮜ' => 'ꮜ',
|
||||
'Ꮝ' => 'ꮝ',
|
||||
'Ꮞ' => 'ꮞ',
|
||||
'Ꮟ' => 'ꮟ',
|
||||
'Ꮠ' => 'ꮠ',
|
||||
'Ꮡ' => 'ꮡ',
|
||||
'Ꮢ' => 'ꮢ',
|
||||
'Ꮣ' => 'ꮣ',
|
||||
'Ꮤ' => 'ꮤ',
|
||||
'Ꮥ' => 'ꮥ',
|
||||
'Ꮦ' => 'ꮦ',
|
||||
'Ꮧ' => 'ꮧ',
|
||||
'Ꮨ' => 'ꮨ',
|
||||
'Ꮩ' => 'ꮩ',
|
||||
'Ꮪ' => 'ꮪ',
|
||||
'Ꮫ' => 'ꮫ',
|
||||
'Ꮬ' => 'ꮬ',
|
||||
'Ꮭ' => 'ꮭ',
|
||||
'Ꮮ' => 'ꮮ',
|
||||
'Ꮯ' => 'ꮯ',
|
||||
'Ꮰ' => 'ꮰ',
|
||||
'Ꮱ' => 'ꮱ',
|
||||
'Ꮲ' => 'ꮲ',
|
||||
'Ꮳ' => 'ꮳ',
|
||||
'Ꮴ' => 'ꮴ',
|
||||
'Ꮵ' => 'ꮵ',
|
||||
'Ꮶ' => 'ꮶ',
|
||||
'Ꮷ' => 'ꮷ',
|
||||
'Ꮸ' => 'ꮸ',
|
||||
'Ꮹ' => 'ꮹ',
|
||||
'Ꮺ' => 'ꮺ',
|
||||
'Ꮻ' => 'ꮻ',
|
||||
'Ꮼ' => 'ꮼ',
|
||||
'Ꮽ' => 'ꮽ',
|
||||
'Ꮾ' => 'ꮾ',
|
||||
'Ꮿ' => 'ꮿ',
|
||||
'Ᏸ' => 'ᏸ',
|
||||
'Ᏹ' => 'ᏹ',
|
||||
'Ᏺ' => 'ᏺ',
|
||||
'Ᏻ' => 'ᏻ',
|
||||
'Ᏼ' => 'ᏼ',
|
||||
'Ᏽ' => 'ᏽ',
|
||||
'Ა' => 'ა',
|
||||
'Ბ' => 'ბ',
|
||||
'Გ' => 'გ',
|
||||
'Დ' => 'დ',
|
||||
'Ე' => 'ე',
|
||||
'Ვ' => 'ვ',
|
||||
'Ზ' => 'ზ',
|
||||
'Თ' => 'თ',
|
||||
'Ი' => 'ი',
|
||||
'Კ' => 'კ',
|
||||
'Ლ' => 'ლ',
|
||||
'Მ' => 'მ',
|
||||
'Ნ' => 'ნ',
|
||||
'Ო' => 'ო',
|
||||
'Პ' => 'პ',
|
||||
'Ჟ' => 'ჟ',
|
||||
'Რ' => 'რ',
|
||||
'Ს' => 'ს',
|
||||
'Ტ' => 'ტ',
|
||||
'Უ' => 'უ',
|
||||
'Ფ' => 'ფ',
|
||||
'Ქ' => 'ქ',
|
||||
'Ღ' => 'ღ',
|
||||
'Ყ' => 'ყ',
|
||||
'Შ' => 'შ',
|
||||
'Ჩ' => 'ჩ',
|
||||
'Ც' => 'ც',
|
||||
'Ძ' => 'ძ',
|
||||
'Წ' => 'წ',
|
||||
'Ჭ' => 'ჭ',
|
||||
'Ხ' => 'ხ',
|
||||
'Ჯ' => 'ჯ',
|
||||
'Ჰ' => 'ჰ',
|
||||
'Ჱ' => 'ჱ',
|
||||
'Ჲ' => 'ჲ',
|
||||
'Ჳ' => 'ჳ',
|
||||
'Ჴ' => 'ჴ',
|
||||
'Ჵ' => 'ჵ',
|
||||
'Ჶ' => 'ჶ',
|
||||
'Ჷ' => 'ჷ',
|
||||
'Ჸ' => 'ჸ',
|
||||
'Ჹ' => 'ჹ',
|
||||
'Ჺ' => 'ჺ',
|
||||
'Ჽ' => 'ჽ',
|
||||
'Ჾ' => 'ჾ',
|
||||
'Ჿ' => 'ჿ',
|
||||
'Ḁ' => 'ḁ',
|
||||
'Ḃ' => 'ḃ',
|
||||
'Ḅ' => 'ḅ',
|
||||
@@ -993,8 +1125,24 @@ return array(
|
||||
'Ɜ' => 'ɜ',
|
||||
'Ɡ' => 'ɡ',
|
||||
'Ɬ' => 'ɬ',
|
||||
'Ɪ' => 'ɪ',
|
||||
'Ʞ' => 'ʞ',
|
||||
'Ʇ' => 'ʇ',
|
||||
'Ʝ' => 'ʝ',
|
||||
'Ꭓ' => 'ꭓ',
|
||||
'Ꞵ' => 'ꞵ',
|
||||
'Ꞷ' => 'ꞷ',
|
||||
'Ꞹ' => 'ꞹ',
|
||||
'Ꞻ' => 'ꞻ',
|
||||
'Ꞽ' => 'ꞽ',
|
||||
'Ꞿ' => 'ꞿ',
|
||||
'Ꟃ' => 'ꟃ',
|
||||
'Ꞔ' => 'ꞔ',
|
||||
'Ʂ' => 'ʂ',
|
||||
'Ᶎ' => 'ᶎ',
|
||||
'Ꟈ' => 'ꟈ',
|
||||
'Ꟊ' => 'ꟊ',
|
||||
'Ꟶ' => 'ꟶ',
|
||||
'A' => 'a',
|
||||
'B' => 'b',
|
||||
'C' => 'c',
|
||||
@@ -1061,6 +1209,93 @@ return array(
|
||||
'𐐥' => '𐑍',
|
||||
'𐐦' => '𐑎',
|
||||
'𐐧' => '𐑏',
|
||||
'𐒰' => '𐓘',
|
||||
'𐒱' => '𐓙',
|
||||
'𐒲' => '𐓚',
|
||||
'𐒳' => '𐓛',
|
||||
'𐒴' => '𐓜',
|
||||
'𐒵' => '𐓝',
|
||||
'𐒶' => '𐓞',
|
||||
'𐒷' => '𐓟',
|
||||
'𐒸' => '𐓠',
|
||||
'𐒹' => '𐓡',
|
||||
'𐒺' => '𐓢',
|
||||
'𐒻' => '𐓣',
|
||||
'𐒼' => '𐓤',
|
||||
'𐒽' => '𐓥',
|
||||
'𐒾' => '𐓦',
|
||||
'𐒿' => '𐓧',
|
||||
'𐓀' => '𐓨',
|
||||
'𐓁' => '𐓩',
|
||||
'𐓂' => '𐓪',
|
||||
'𐓃' => '𐓫',
|
||||
'𐓄' => '𐓬',
|
||||
'𐓅' => '𐓭',
|
||||
'𐓆' => '𐓮',
|
||||
'𐓇' => '𐓯',
|
||||
'𐓈' => '𐓰',
|
||||
'𐓉' => '𐓱',
|
||||
'𐓊' => '𐓲',
|
||||
'𐓋' => '𐓳',
|
||||
'𐓌' => '𐓴',
|
||||
'𐓍' => '𐓵',
|
||||
'𐓎' => '𐓶',
|
||||
'𐓏' => '𐓷',
|
||||
'𐓐' => '𐓸',
|
||||
'𐓑' => '𐓹',
|
||||
'𐓒' => '𐓺',
|
||||
'𐓓' => '𐓻',
|
||||
'𐲀' => '𐳀',
|
||||
'𐲁' => '𐳁',
|
||||
'𐲂' => '𐳂',
|
||||
'𐲃' => '𐳃',
|
||||
'𐲄' => '𐳄',
|
||||
'𐲅' => '𐳅',
|
||||
'𐲆' => '𐳆',
|
||||
'𐲇' => '𐳇',
|
||||
'𐲈' => '𐳈',
|
||||
'𐲉' => '𐳉',
|
||||
'𐲊' => '𐳊',
|
||||
'𐲋' => '𐳋',
|
||||
'𐲌' => '𐳌',
|
||||
'𐲍' => '𐳍',
|
||||
'𐲎' => '𐳎',
|
||||
'𐲏' => '𐳏',
|
||||
'𐲐' => '𐳐',
|
||||
'𐲑' => '𐳑',
|
||||
'𐲒' => '𐳒',
|
||||
'𐲓' => '𐳓',
|
||||
'𐲔' => '𐳔',
|
||||
'𐲕' => '𐳕',
|
||||
'𐲖' => '𐳖',
|
||||
'𐲗' => '𐳗',
|
||||
'𐲘' => '𐳘',
|
||||
'𐲙' => '𐳙',
|
||||
'𐲚' => '𐳚',
|
||||
'𐲛' => '𐳛',
|
||||
'𐲜' => '𐳜',
|
||||
'𐲝' => '𐳝',
|
||||
'𐲞' => '𐳞',
|
||||
'𐲟' => '𐳟',
|
||||
'𐲠' => '𐳠',
|
||||
'𐲡' => '𐳡',
|
||||
'𐲢' => '𐳢',
|
||||
'𐲣' => '𐳣',
|
||||
'𐲤' => '𐳤',
|
||||
'𐲥' => '𐳥',
|
||||
'𐲦' => '𐳦',
|
||||
'𐲧' => '𐳧',
|
||||
'𐲨' => '𐳨',
|
||||
'𐲩' => '𐳩',
|
||||
'𐲪' => '𐳪',
|
||||
'𐲫' => '𐳫',
|
||||
'𐲬' => '𐳬',
|
||||
'𐲭' => '𐳭',
|
||||
'𐲮' => '𐳮',
|
||||
'𐲯' => '𐳯',
|
||||
'𐲰' => '𐳰',
|
||||
'𐲱' => '𐳱',
|
||||
'𐲲' => '𐳲',
|
||||
'𑢠' => '𑣀',
|
||||
'𑢡' => '𑣁',
|
||||
'𑢢' => '𑣂',
|
||||
@@ -1093,4 +1328,70 @@ return array(
|
||||
'𑢽' => '𑣝',
|
||||
'𑢾' => '𑣞',
|
||||
'𑢿' => '𑣟',
|
||||
'𖹀' => '𖹠',
|
||||
'𖹁' => '𖹡',
|
||||
'𖹂' => '𖹢',
|
||||
'𖹃' => '𖹣',
|
||||
'𖹄' => '𖹤',
|
||||
'𖹅' => '𖹥',
|
||||
'𖹆' => '𖹦',
|
||||
'𖹇' => '𖹧',
|
||||
'𖹈' => '𖹨',
|
||||
'𖹉' => '𖹩',
|
||||
'𖹊' => '𖹪',
|
||||
'𖹋' => '𖹫',
|
||||
'𖹌' => '𖹬',
|
||||
'𖹍' => '𖹭',
|
||||
'𖹎' => '𖹮',
|
||||
'𖹏' => '𖹯',
|
||||
'𖹐' => '𖹰',
|
||||
'𖹑' => '𖹱',
|
||||
'𖹒' => '𖹲',
|
||||
'𖹓' => '𖹳',
|
||||
'𖹔' => '𖹴',
|
||||
'𖹕' => '𖹵',
|
||||
'𖹖' => '𖹶',
|
||||
'𖹗' => '𖹷',
|
||||
'𖹘' => '𖹸',
|
||||
'𖹙' => '𖹹',
|
||||
'𖹚' => '𖹺',
|
||||
'𖹛' => '𖹻',
|
||||
'𖹜' => '𖹼',
|
||||
'𖹝' => '𖹽',
|
||||
'𖹞' => '𖹾',
|
||||
'𖹟' => '𖹿',
|
||||
'𞤀' => '𞤢',
|
||||
'𞤁' => '𞤣',
|
||||
'𞤂' => '𞤤',
|
||||
'𞤃' => '𞤥',
|
||||
'𞤄' => '𞤦',
|
||||
'𞤅' => '𞤧',
|
||||
'𞤆' => '𞤨',
|
||||
'𞤇' => '𞤩',
|
||||
'𞤈' => '𞤪',
|
||||
'𞤉' => '𞤫',
|
||||
'𞤊' => '𞤬',
|
||||
'𞤋' => '𞤭',
|
||||
'𞤌' => '𞤮',
|
||||
'𞤍' => '𞤯',
|
||||
'𞤎' => '𞤰',
|
||||
'𞤏' => '𞤱',
|
||||
'𞤐' => '𞤲',
|
||||
'𞤑' => '𞤳',
|
||||
'𞤒' => '𞤴',
|
||||
'𞤓' => '𞤵',
|
||||
'𞤔' => '𞤶',
|
||||
'𞤕' => '𞤷',
|
||||
'𞤖' => '𞤸',
|
||||
'𞤗' => '𞤹',
|
||||
'𞤘' => '𞤺',
|
||||
'𞤙' => '𞤻',
|
||||
'𞤚' => '𞤼',
|
||||
'𞤛' => '𞤽',
|
||||
'𞤜' => '𞤾',
|
||||
'𞤝' => '𞤿',
|
||||
'𞤞' => '𞥀',
|
||||
'𞤟' => '𞥁',
|
||||
'𞤠' => '𞥂',
|
||||
'𞤡' => '𞥃',
|
||||
);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
return array(
|
||||
return array (
|
||||
'a' => 'A',
|
||||
'b' => 'B',
|
||||
'c' => 'C',
|
||||
@@ -225,6 +225,7 @@ return array(
|
||||
'ɦ' => 'Ɦ',
|
||||
'ɨ' => 'Ɨ',
|
||||
'ɩ' => 'Ɩ',
|
||||
'ɪ' => 'Ɪ',
|
||||
'ɫ' => 'Ɫ',
|
||||
'ɬ' => 'Ɬ',
|
||||
'ɯ' => 'Ɯ',
|
||||
@@ -233,6 +234,7 @@ return array(
|
||||
'ɵ' => 'Ɵ',
|
||||
'ɽ' => 'Ɽ',
|
||||
'ʀ' => 'Ʀ',
|
||||
'ʂ' => 'Ʂ',
|
||||
'ʃ' => 'Ʃ',
|
||||
'ʇ' => 'Ʇ',
|
||||
'ʈ' => 'Ʈ',
|
||||
@@ -241,6 +243,7 @@ return array(
|
||||
'ʋ' => 'Ʋ',
|
||||
'ʌ' => 'Ʌ',
|
||||
'ʒ' => 'Ʒ',
|
||||
'ʝ' => 'Ʝ',
|
||||
'ʞ' => 'Ʞ',
|
||||
'ͅ' => 'Ι',
|
||||
'ͱ' => 'Ͱ',
|
||||
@@ -493,8 +496,70 @@ return array(
|
||||
'ք' => 'Ք',
|
||||
'օ' => 'Օ',
|
||||
'ֆ' => 'Ֆ',
|
||||
'ა' => 'Ა',
|
||||
'ბ' => 'Ბ',
|
||||
'გ' => 'Გ',
|
||||
'დ' => 'Დ',
|
||||
'ე' => 'Ე',
|
||||
'ვ' => 'Ვ',
|
||||
'ზ' => 'Ზ',
|
||||
'თ' => 'Თ',
|
||||
'ი' => 'Ი',
|
||||
'კ' => 'Კ',
|
||||
'ლ' => 'Ლ',
|
||||
'მ' => 'Მ',
|
||||
'ნ' => 'Ნ',
|
||||
'ო' => 'Ო',
|
||||
'პ' => 'Პ',
|
||||
'ჟ' => 'Ჟ',
|
||||
'რ' => 'Რ',
|
||||
'ს' => 'Ს',
|
||||
'ტ' => 'Ტ',
|
||||
'უ' => 'Უ',
|
||||
'ფ' => 'Ფ',
|
||||
'ქ' => 'Ქ',
|
||||
'ღ' => 'Ღ',
|
||||
'ყ' => 'Ყ',
|
||||
'შ' => 'Შ',
|
||||
'ჩ' => 'Ჩ',
|
||||
'ც' => 'Ც',
|
||||
'ძ' => 'Ძ',
|
||||
'წ' => 'Წ',
|
||||
'ჭ' => 'Ჭ',
|
||||
'ხ' => 'Ხ',
|
||||
'ჯ' => 'Ჯ',
|
||||
'ჰ' => 'Ჰ',
|
||||
'ჱ' => 'Ჱ',
|
||||
'ჲ' => 'Ჲ',
|
||||
'ჳ' => 'Ჳ',
|
||||
'ჴ' => 'Ჴ',
|
||||
'ჵ' => 'Ჵ',
|
||||
'ჶ' => 'Ჶ',
|
||||
'ჷ' => 'Ჷ',
|
||||
'ჸ' => 'Ჸ',
|
||||
'ჹ' => 'Ჹ',
|
||||
'ჺ' => 'Ჺ',
|
||||
'ჽ' => 'Ჽ',
|
||||
'ჾ' => 'Ჾ',
|
||||
'ჿ' => 'Ჿ',
|
||||
'ᏸ' => 'Ᏸ',
|
||||
'ᏹ' => 'Ᏹ',
|
||||
'ᏺ' => 'Ᏺ',
|
||||
'ᏻ' => 'Ᏻ',
|
||||
'ᏼ' => 'Ᏼ',
|
||||
'ᏽ' => 'Ᏽ',
|
||||
'ᲀ' => 'В',
|
||||
'ᲁ' => 'Д',
|
||||
'ᲂ' => 'О',
|
||||
'ᲃ' => 'С',
|
||||
'ᲄ' => 'Т',
|
||||
'ᲅ' => 'Т',
|
||||
'ᲆ' => 'Ъ',
|
||||
'ᲇ' => 'Ѣ',
|
||||
'ᲈ' => 'Ꙋ',
|
||||
'ᵹ' => 'Ᵹ',
|
||||
'ᵽ' => 'Ᵽ',
|
||||
'ᶎ' => 'Ᶎ',
|
||||
'ḁ' => 'Ḁ',
|
||||
'ḃ' => 'Ḃ',
|
||||
'ḅ' => 'Ḅ',
|
||||
@@ -681,41 +746,41 @@ return array(
|
||||
'ύ' => 'Ύ',
|
||||
'ὼ' => 'Ὼ',
|
||||
'ώ' => 'Ώ',
|
||||
'ᾀ' => 'ᾈ',
|
||||
'ᾁ' => 'ᾉ',
|
||||
'ᾂ' => 'ᾊ',
|
||||
'ᾃ' => 'ᾋ',
|
||||
'ᾄ' => 'ᾌ',
|
||||
'ᾅ' => 'ᾍ',
|
||||
'ᾆ' => 'ᾎ',
|
||||
'ᾇ' => 'ᾏ',
|
||||
'ᾐ' => 'ᾘ',
|
||||
'ᾑ' => 'ᾙ',
|
||||
'ᾒ' => 'ᾚ',
|
||||
'ᾓ' => 'ᾛ',
|
||||
'ᾔ' => 'ᾜ',
|
||||
'ᾕ' => 'ᾝ',
|
||||
'ᾖ' => 'ᾞ',
|
||||
'ᾗ' => 'ᾟ',
|
||||
'ᾠ' => 'ᾨ',
|
||||
'ᾡ' => 'ᾩ',
|
||||
'ᾢ' => 'ᾪ',
|
||||
'ᾣ' => 'ᾫ',
|
||||
'ᾤ' => 'ᾬ',
|
||||
'ᾥ' => 'ᾭ',
|
||||
'ᾦ' => 'ᾮ',
|
||||
'ᾧ' => 'ᾯ',
|
||||
'ᾀ' => 'ἈΙ',
|
||||
'ᾁ' => 'ἉΙ',
|
||||
'ᾂ' => 'ἊΙ',
|
||||
'ᾃ' => 'ἋΙ',
|
||||
'ᾄ' => 'ἌΙ',
|
||||
'ᾅ' => 'ἍΙ',
|
||||
'ᾆ' => 'ἎΙ',
|
||||
'ᾇ' => 'ἏΙ',
|
||||
'ᾐ' => 'ἨΙ',
|
||||
'ᾑ' => 'ἩΙ',
|
||||
'ᾒ' => 'ἪΙ',
|
||||
'ᾓ' => 'ἫΙ',
|
||||
'ᾔ' => 'ἬΙ',
|
||||
'ᾕ' => 'ἭΙ',
|
||||
'ᾖ' => 'ἮΙ',
|
||||
'ᾗ' => 'ἯΙ',
|
||||
'ᾠ' => 'ὨΙ',
|
||||
'ᾡ' => 'ὩΙ',
|
||||
'ᾢ' => 'ὪΙ',
|
||||
'ᾣ' => 'ὫΙ',
|
||||
'ᾤ' => 'ὬΙ',
|
||||
'ᾥ' => 'ὭΙ',
|
||||
'ᾦ' => 'ὮΙ',
|
||||
'ᾧ' => 'ὯΙ',
|
||||
'ᾰ' => 'Ᾰ',
|
||||
'ᾱ' => 'Ᾱ',
|
||||
'ᾳ' => 'ᾼ',
|
||||
'ᾳ' => 'ΑΙ',
|
||||
'ι' => 'Ι',
|
||||
'ῃ' => 'ῌ',
|
||||
'ῃ' => 'ΗΙ',
|
||||
'ῐ' => 'Ῐ',
|
||||
'ῑ' => 'Ῑ',
|
||||
'ῠ' => 'Ῠ',
|
||||
'ῡ' => 'Ῡ',
|
||||
'ῥ' => 'Ῥ',
|
||||
'ῳ' => 'ῼ',
|
||||
'ῳ' => 'ΩΙ',
|
||||
'ⅎ' => 'Ⅎ',
|
||||
'ⅰ' => 'Ⅰ',
|
||||
'ⅱ' => 'Ⅱ',
|
||||
@@ -993,6 +1058,7 @@ return array(
|
||||
'ꞌ' => 'Ꞌ',
|
||||
'ꞑ' => 'Ꞑ',
|
||||
'ꞓ' => 'Ꞓ',
|
||||
'ꞔ' => 'Ꞔ',
|
||||
'ꞗ' => 'Ꞗ',
|
||||
'ꞙ' => 'Ꞙ',
|
||||
'ꞛ' => 'Ꞛ',
|
||||
@@ -1003,6 +1069,97 @@ return array(
|
||||
'ꞥ' => 'Ꞥ',
|
||||
'ꞧ' => 'Ꞧ',
|
||||
'ꞩ' => 'Ꞩ',
|
||||
'ꞵ' => 'Ꞵ',
|
||||
'ꞷ' => 'Ꞷ',
|
||||
'ꞹ' => 'Ꞹ',
|
||||
'ꞻ' => 'Ꞻ',
|
||||
'ꞽ' => 'Ꞽ',
|
||||
'ꞿ' => 'Ꞿ',
|
||||
'ꟃ' => 'Ꟃ',
|
||||
'ꟈ' => 'Ꟈ',
|
||||
'ꟊ' => 'Ꟊ',
|
||||
'ꟶ' => 'Ꟶ',
|
||||
'ꭓ' => 'Ꭓ',
|
||||
'ꭰ' => 'Ꭰ',
|
||||
'ꭱ' => 'Ꭱ',
|
||||
'ꭲ' => 'Ꭲ',
|
||||
'ꭳ' => 'Ꭳ',
|
||||
'ꭴ' => 'Ꭴ',
|
||||
'ꭵ' => 'Ꭵ',
|
||||
'ꭶ' => 'Ꭶ',
|
||||
'ꭷ' => 'Ꭷ',
|
||||
'ꭸ' => 'Ꭸ',
|
||||
'ꭹ' => 'Ꭹ',
|
||||
'ꭺ' => 'Ꭺ',
|
||||
'ꭻ' => 'Ꭻ',
|
||||
'ꭼ' => 'Ꭼ',
|
||||
'ꭽ' => 'Ꭽ',
|
||||
'ꭾ' => 'Ꭾ',
|
||||
'ꭿ' => 'Ꭿ',
|
||||
'ꮀ' => 'Ꮀ',
|
||||
'ꮁ' => 'Ꮁ',
|
||||
'ꮂ' => 'Ꮂ',
|
||||
'ꮃ' => 'Ꮃ',
|
||||
'ꮄ' => 'Ꮄ',
|
||||
'ꮅ' => 'Ꮅ',
|
||||
'ꮆ' => 'Ꮆ',
|
||||
'ꮇ' => 'Ꮇ',
|
||||
'ꮈ' => 'Ꮈ',
|
||||
'ꮉ' => 'Ꮉ',
|
||||
'ꮊ' => 'Ꮊ',
|
||||
'ꮋ' => 'Ꮋ',
|
||||
'ꮌ' => 'Ꮌ',
|
||||
'ꮍ' => 'Ꮍ',
|
||||
'ꮎ' => 'Ꮎ',
|
||||
'ꮏ' => 'Ꮏ',
|
||||
'ꮐ' => 'Ꮐ',
|
||||
'ꮑ' => 'Ꮑ',
|
||||
'ꮒ' => 'Ꮒ',
|
||||
'ꮓ' => 'Ꮓ',
|
||||
'ꮔ' => 'Ꮔ',
|
||||
'ꮕ' => 'Ꮕ',
|
||||
'ꮖ' => 'Ꮖ',
|
||||
'ꮗ' => 'Ꮗ',
|
||||
'ꮘ' => 'Ꮘ',
|
||||
'ꮙ' => 'Ꮙ',
|
||||
'ꮚ' => 'Ꮚ',
|
||||
'ꮛ' => 'Ꮛ',
|
||||
'ꮜ' => 'Ꮜ',
|
||||
'ꮝ' => 'Ꮝ',
|
||||
'ꮞ' => 'Ꮞ',
|
||||
'ꮟ' => 'Ꮟ',
|
||||
'ꮠ' => 'Ꮠ',
|
||||
'ꮡ' => 'Ꮡ',
|
||||
'ꮢ' => 'Ꮢ',
|
||||
'ꮣ' => 'Ꮣ',
|
||||
'ꮤ' => 'Ꮤ',
|
||||
'ꮥ' => 'Ꮥ',
|
||||
'ꮦ' => 'Ꮦ',
|
||||
'ꮧ' => 'Ꮧ',
|
||||
'ꮨ' => 'Ꮨ',
|
||||
'ꮩ' => 'Ꮩ',
|
||||
'ꮪ' => 'Ꮪ',
|
||||
'ꮫ' => 'Ꮫ',
|
||||
'ꮬ' => 'Ꮬ',
|
||||
'ꮭ' => 'Ꮭ',
|
||||
'ꮮ' => 'Ꮮ',
|
||||
'ꮯ' => 'Ꮯ',
|
||||
'ꮰ' => 'Ꮰ',
|
||||
'ꮱ' => 'Ꮱ',
|
||||
'ꮲ' => 'Ꮲ',
|
||||
'ꮳ' => 'Ꮳ',
|
||||
'ꮴ' => 'Ꮴ',
|
||||
'ꮵ' => 'Ꮵ',
|
||||
'ꮶ' => 'Ꮶ',
|
||||
'ꮷ' => 'Ꮷ',
|
||||
'ꮸ' => 'Ꮸ',
|
||||
'ꮹ' => 'Ꮹ',
|
||||
'ꮺ' => 'Ꮺ',
|
||||
'ꮻ' => 'Ꮻ',
|
||||
'ꮼ' => 'Ꮼ',
|
||||
'ꮽ' => 'Ꮽ',
|
||||
'ꮾ' => 'Ꮾ',
|
||||
'ꮿ' => 'Ꮿ',
|
||||
'a' => 'A',
|
||||
'b' => 'B',
|
||||
'c' => 'C',
|
||||
@@ -1069,6 +1226,93 @@ return array(
|
||||
'𐑍' => '𐐥',
|
||||
'𐑎' => '𐐦',
|
||||
'𐑏' => '𐐧',
|
||||
'𐓘' => '𐒰',
|
||||
'𐓙' => '𐒱',
|
||||
'𐓚' => '𐒲',
|
||||
'𐓛' => '𐒳',
|
||||
'𐓜' => '𐒴',
|
||||
'𐓝' => '𐒵',
|
||||
'𐓞' => '𐒶',
|
||||
'𐓟' => '𐒷',
|
||||
'𐓠' => '𐒸',
|
||||
'𐓡' => '𐒹',
|
||||
'𐓢' => '𐒺',
|
||||
'𐓣' => '𐒻',
|
||||
'𐓤' => '𐒼',
|
||||
'𐓥' => '𐒽',
|
||||
'𐓦' => '𐒾',
|
||||
'𐓧' => '𐒿',
|
||||
'𐓨' => '𐓀',
|
||||
'𐓩' => '𐓁',
|
||||
'𐓪' => '𐓂',
|
||||
'𐓫' => '𐓃',
|
||||
'𐓬' => '𐓄',
|
||||
'𐓭' => '𐓅',
|
||||
'𐓮' => '𐓆',
|
||||
'𐓯' => '𐓇',
|
||||
'𐓰' => '𐓈',
|
||||
'𐓱' => '𐓉',
|
||||
'𐓲' => '𐓊',
|
||||
'𐓳' => '𐓋',
|
||||
'𐓴' => '𐓌',
|
||||
'𐓵' => '𐓍',
|
||||
'𐓶' => '𐓎',
|
||||
'𐓷' => '𐓏',
|
||||
'𐓸' => '𐓐',
|
||||
'𐓹' => '𐓑',
|
||||
'𐓺' => '𐓒',
|
||||
'𐓻' => '𐓓',
|
||||
'𐳀' => '𐲀',
|
||||
'𐳁' => '𐲁',
|
||||
'𐳂' => '𐲂',
|
||||
'𐳃' => '𐲃',
|
||||
'𐳄' => '𐲄',
|
||||
'𐳅' => '𐲅',
|
||||
'𐳆' => '𐲆',
|
||||
'𐳇' => '𐲇',
|
||||
'𐳈' => '𐲈',
|
||||
'𐳉' => '𐲉',
|
||||
'𐳊' => '𐲊',
|
||||
'𐳋' => '𐲋',
|
||||
'𐳌' => '𐲌',
|
||||
'𐳍' => '𐲍',
|
||||
'𐳎' => '𐲎',
|
||||
'𐳏' => '𐲏',
|
||||
'𐳐' => '𐲐',
|
||||
'𐳑' => '𐲑',
|
||||
'𐳒' => '𐲒',
|
||||
'𐳓' => '𐲓',
|
||||
'𐳔' => '𐲔',
|
||||
'𐳕' => '𐲕',
|
||||
'𐳖' => '𐲖',
|
||||
'𐳗' => '𐲗',
|
||||
'𐳘' => '𐲘',
|
||||
'𐳙' => '𐲙',
|
||||
'𐳚' => '𐲚',
|
||||
'𐳛' => '𐲛',
|
||||
'𐳜' => '𐲜',
|
||||
'𐳝' => '𐲝',
|
||||
'𐳞' => '𐲞',
|
||||
'𐳟' => '𐲟',
|
||||
'𐳠' => '𐲠',
|
||||
'𐳡' => '𐲡',
|
||||
'𐳢' => '𐲢',
|
||||
'𐳣' => '𐲣',
|
||||
'𐳤' => '𐲤',
|
||||
'𐳥' => '𐲥',
|
||||
'𐳦' => '𐲦',
|
||||
'𐳧' => '𐲧',
|
||||
'𐳨' => '𐲨',
|
||||
'𐳩' => '𐲩',
|
||||
'𐳪' => '𐲪',
|
||||
'𐳫' => '𐲫',
|
||||
'𐳬' => '𐲬',
|
||||
'𐳭' => '𐲭',
|
||||
'𐳮' => '𐲮',
|
||||
'𐳯' => '𐲯',
|
||||
'𐳰' => '𐲰',
|
||||
'𐳱' => '𐲱',
|
||||
'𐳲' => '𐲲',
|
||||
'𑣀' => '𑢠',
|
||||
'𑣁' => '𑢡',
|
||||
'𑣂' => '𑢢',
|
||||
@@ -1101,4 +1345,145 @@ return array(
|
||||
'𑣝' => '𑢽',
|
||||
'𑣞' => '𑢾',
|
||||
'𑣟' => '𑢿',
|
||||
'𖹠' => '𖹀',
|
||||
'𖹡' => '𖹁',
|
||||
'𖹢' => '𖹂',
|
||||
'𖹣' => '𖹃',
|
||||
'𖹤' => '𖹄',
|
||||
'𖹥' => '𖹅',
|
||||
'𖹦' => '𖹆',
|
||||
'𖹧' => '𖹇',
|
||||
'𖹨' => '𖹈',
|
||||
'𖹩' => '𖹉',
|
||||
'𖹪' => '𖹊',
|
||||
'𖹫' => '𖹋',
|
||||
'𖹬' => '𖹌',
|
||||
'𖹭' => '𖹍',
|
||||
'𖹮' => '𖹎',
|
||||
'𖹯' => '𖹏',
|
||||
'𖹰' => '𖹐',
|
||||
'𖹱' => '𖹑',
|
||||
'𖹲' => '𖹒',
|
||||
'𖹳' => '𖹓',
|
||||
'𖹴' => '𖹔',
|
||||
'𖹵' => '𖹕',
|
||||
'𖹶' => '𖹖',
|
||||
'𖹷' => '𖹗',
|
||||
'𖹸' => '𖹘',
|
||||
'𖹹' => '𖹙',
|
||||
'𖹺' => '𖹚',
|
||||
'𖹻' => '𖹛',
|
||||
'𖹼' => '𖹜',
|
||||
'𖹽' => '𖹝',
|
||||
'𖹾' => '𖹞',
|
||||
'𖹿' => '𖹟',
|
||||
'𞤢' => '𞤀',
|
||||
'𞤣' => '𞤁',
|
||||
'𞤤' => '𞤂',
|
||||
'𞤥' => '𞤃',
|
||||
'𞤦' => '𞤄',
|
||||
'𞤧' => '𞤅',
|
||||
'𞤨' => '𞤆',
|
||||
'𞤩' => '𞤇',
|
||||
'𞤪' => '𞤈',
|
||||
'𞤫' => '𞤉',
|
||||
'𞤬' => '𞤊',
|
||||
'𞤭' => '𞤋',
|
||||
'𞤮' => '𞤌',
|
||||
'𞤯' => '𞤍',
|
||||
'𞤰' => '𞤎',
|
||||
'𞤱' => '𞤏',
|
||||
'𞤲' => '𞤐',
|
||||
'𞤳' => '𞤑',
|
||||
'𞤴' => '𞤒',
|
||||
'𞤵' => '𞤓',
|
||||
'𞤶' => '𞤔',
|
||||
'𞤷' => '𞤕',
|
||||
'𞤸' => '𞤖',
|
||||
'𞤹' => '𞤗',
|
||||
'𞤺' => '𞤘',
|
||||
'𞤻' => '𞤙',
|
||||
'𞤼' => '𞤚',
|
||||
'𞤽' => '𞤛',
|
||||
'𞤾' => '𞤜',
|
||||
'𞤿' => '𞤝',
|
||||
'𞥀' => '𞤞',
|
||||
'𞥁' => '𞤟',
|
||||
'𞥂' => '𞤠',
|
||||
'𞥃' => '𞤡',
|
||||
'ß' => 'SS',
|
||||
'ff' => 'FF',
|
||||
'fi' => 'FI',
|
||||
'fl' => 'FL',
|
||||
'ffi' => 'FFI',
|
||||
'ffl' => 'FFL',
|
||||
'ſt' => 'ST',
|
||||
'st' => 'ST',
|
||||
'և' => 'ԵՒ',
|
||||
'ﬓ' => 'ՄՆ',
|
||||
'ﬔ' => 'ՄԵ',
|
||||
'ﬕ' => 'ՄԻ',
|
||||
'ﬖ' => 'ՎՆ',
|
||||
'ﬗ' => 'ՄԽ',
|
||||
'ʼn' => 'ʼN',
|
||||
'ΐ' => 'Ϊ́',
|
||||
'ΰ' => 'Ϋ́',
|
||||
'ǰ' => 'J̌',
|
||||
'ẖ' => 'H̱',
|
||||
'ẗ' => 'T̈',
|
||||
'ẘ' => 'W̊',
|
||||
'ẙ' => 'Y̊',
|
||||
'ẚ' => 'Aʾ',
|
||||
'ὐ' => 'Υ̓',
|
||||
'ὒ' => 'Υ̓̀',
|
||||
'ὔ' => 'Υ̓́',
|
||||
'ὖ' => 'Υ̓͂',
|
||||
'ᾶ' => 'Α͂',
|
||||
'ῆ' => 'Η͂',
|
||||
'ῒ' => 'Ϊ̀',
|
||||
'ΐ' => 'Ϊ́',
|
||||
'ῖ' => 'Ι͂',
|
||||
'ῗ' => 'Ϊ͂',
|
||||
'ῢ' => 'Ϋ̀',
|
||||
'ΰ' => 'Ϋ́',
|
||||
'ῤ' => 'Ρ̓',
|
||||
'ῦ' => 'Υ͂',
|
||||
'ῧ' => 'Ϋ͂',
|
||||
'ῶ' => 'Ω͂',
|
||||
'ᾈ' => 'ἈΙ',
|
||||
'ᾉ' => 'ἉΙ',
|
||||
'ᾊ' => 'ἊΙ',
|
||||
'ᾋ' => 'ἋΙ',
|
||||
'ᾌ' => 'ἌΙ',
|
||||
'ᾍ' => 'ἍΙ',
|
||||
'ᾎ' => 'ἎΙ',
|
||||
'ᾏ' => 'ἏΙ',
|
||||
'ᾘ' => 'ἨΙ',
|
||||
'ᾙ' => 'ἩΙ',
|
||||
'ᾚ' => 'ἪΙ',
|
||||
'ᾛ' => 'ἫΙ',
|
||||
'ᾜ' => 'ἬΙ',
|
||||
'ᾝ' => 'ἭΙ',
|
||||
'ᾞ' => 'ἮΙ',
|
||||
'ᾟ' => 'ἯΙ',
|
||||
'ᾨ' => 'ὨΙ',
|
||||
'ᾩ' => 'ὩΙ',
|
||||
'ᾪ' => 'ὪΙ',
|
||||
'ᾫ' => 'ὫΙ',
|
||||
'ᾬ' => 'ὬΙ',
|
||||
'ᾭ' => 'ὭΙ',
|
||||
'ᾮ' => 'ὮΙ',
|
||||
'ᾯ' => 'ὯΙ',
|
||||
'ᾼ' => 'ΑΙ',
|
||||
'ῌ' => 'ΗΙ',
|
||||
'ῼ' => 'ΩΙ',
|
||||
'ᾲ' => 'ᾺΙ',
|
||||
'ᾴ' => 'ΆΙ',
|
||||
'ῂ' => 'ῊΙ',
|
||||
'ῄ' => 'ΉΙ',
|
||||
'ῲ' => 'ῺΙ',
|
||||
'ῴ' => 'ΏΙ',
|
||||
'ᾷ' => 'Α͂Ι',
|
||||
'ῇ' => 'Η͂Ι',
|
||||
'ῷ' => 'Ω͂Ι',
|
||||
);
|
||||
|
||||
190
vendor/symfony/polyfill-mbstring/bootstrap.php
vendored
190
vendor/symfony/polyfill-mbstring/bootstrap.php
vendored
@@ -11,54 +11,162 @@
|
||||
|
||||
use Symfony\Polyfill\Mbstring as p;
|
||||
|
||||
if (!defined('MB_CASE_UPPER')) {
|
||||
define('MB_CASE_UPPER', 0);
|
||||
define('MB_CASE_LOWER', 1);
|
||||
define('MB_CASE_TITLE', 2);
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
return require __DIR__.'/bootstrap80.php';
|
||||
}
|
||||
|
||||
if (!function_exists('mb_strlen')) {
|
||||
function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); }
|
||||
function mb_decode_mimeheader($s) { return p\Mbstring::mb_decode_mimeheader($s); }
|
||||
function mb_encode_mimeheader($s, $charset = null, $transferEnc = null, $lf = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($s, $charset, $transferEnc, $lf, $indent); }
|
||||
function mb_decode_numericentity($s, $convmap, $enc = null) { return p\Mbstring::mb_decode_numericentity($s, $convmap, $enc); }
|
||||
function mb_encode_numericentity($s, $convmap, $enc = null, $is_hex = false) { return p\Mbstring::mb_encode_numericentity($s, $convmap, $enc, $is_hex); }
|
||||
function mb_convert_case($s, $mode, $enc = null) { return p\Mbstring::mb_convert_case($s, $mode, $enc); }
|
||||
function mb_internal_encoding($enc = null) { return p\Mbstring::mb_internal_encoding($enc); }
|
||||
function mb_language($lang = null) { return p\Mbstring::mb_language($lang); }
|
||||
if (!function_exists('mb_convert_encoding')) {
|
||||
function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
|
||||
}
|
||||
if (!function_exists('mb_decode_mimeheader')) {
|
||||
function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
|
||||
}
|
||||
if (!function_exists('mb_encode_mimeheader')) {
|
||||
function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
|
||||
}
|
||||
if (!function_exists('mb_decode_numericentity')) {
|
||||
function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_encode_numericentity')) {
|
||||
function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
|
||||
}
|
||||
if (!function_exists('mb_convert_case')) {
|
||||
function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_internal_encoding')) {
|
||||
function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_language')) {
|
||||
function mb_language($language = null) { return p\Mbstring::mb_language($language); }
|
||||
}
|
||||
if (!function_exists('mb_list_encodings')) {
|
||||
function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
|
||||
}
|
||||
if (!function_exists('mb_encoding_aliases')) {
|
||||
function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
|
||||
function mb_check_encoding($var = null, $encoding = null) { return p\Mbstring::mb_check_encoding($var, $encoding); }
|
||||
function mb_detect_encoding($str, $encodingList = null, $strict = false) { return p\Mbstring::mb_detect_encoding($str, $encodingList, $strict); }
|
||||
function mb_detect_order($encodingList = null) { return p\Mbstring::mb_detect_order($encodingList); }
|
||||
function mb_parse_str($s, &$result = array()) { parse_str($s, $result); }
|
||||
function mb_strlen($s, $enc = null) { return p\Mbstring::mb_strlen($s, $enc); }
|
||||
function mb_strpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strpos($s, $needle, $offset, $enc); }
|
||||
function mb_strtolower($s, $enc = null) { return p\Mbstring::mb_strtolower($s, $enc); }
|
||||
function mb_strtoupper($s, $enc = null) { return p\Mbstring::mb_strtoupper($s, $enc); }
|
||||
function mb_substitute_character($char = null) { return p\Mbstring::mb_substitute_character($char); }
|
||||
function mb_substr($s, $start, $length = 2147483647, $enc = null) { return p\Mbstring::mb_substr($s, $start, $length, $enc); }
|
||||
function mb_stripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_stripos($s, $needle, $offset, $enc); }
|
||||
function mb_stristr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_stristr($s, $needle, $part, $enc); }
|
||||
function mb_strrchr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrchr($s, $needle, $part, $enc); }
|
||||
function mb_strrichr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strrichr($s, $needle, $part, $enc); }
|
||||
function mb_strripos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strripos($s, $needle, $offset, $enc); }
|
||||
function mb_strrpos($s, $needle, $offset = 0, $enc = null) { return p\Mbstring::mb_strrpos($s, $needle, $offset, $enc); }
|
||||
function mb_strstr($s, $needle, $part = false, $enc = null) { return p\Mbstring::mb_strstr($s, $needle, $part, $enc); }
|
||||
}
|
||||
if (!function_exists('mb_check_encoding')) {
|
||||
function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_detect_encoding')) {
|
||||
function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
|
||||
}
|
||||
if (!function_exists('mb_detect_order')) {
|
||||
function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_parse_str')) {
|
||||
function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; }
|
||||
}
|
||||
if (!function_exists('mb_strlen')) {
|
||||
function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strpos')) {
|
||||
function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strtolower')) {
|
||||
function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strtoupper')) {
|
||||
function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_substitute_character')) {
|
||||
function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
|
||||
}
|
||||
if (!function_exists('mb_substr')) {
|
||||
function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_stripos')) {
|
||||
function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_stristr')) {
|
||||
function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrchr')) {
|
||||
function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrichr')) {
|
||||
function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strripos')) {
|
||||
function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrpos')) {
|
||||
function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strstr')) {
|
||||
function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_get_info')) {
|
||||
function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
|
||||
function mb_http_output($enc = null) { return p\Mbstring::mb_http_output($enc); }
|
||||
function mb_strwidth($s, $enc = null) { return p\Mbstring::mb_strwidth($s, $enc); }
|
||||
function mb_substr_count($haystack, $needle, $enc = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $enc); }
|
||||
function mb_output_handler($contents, $status) { return p\Mbstring::mb_output_handler($contents, $status); }
|
||||
function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); }
|
||||
function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); }
|
||||
}
|
||||
if (!function_exists('mb_http_output')) {
|
||||
function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strwidth')) {
|
||||
function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_substr_count')) {
|
||||
function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_output_handler')) {
|
||||
function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
|
||||
}
|
||||
if (!function_exists('mb_http_input')) {
|
||||
function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_convert_variables')) {
|
||||
function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ord')) {
|
||||
function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_chr')) {
|
||||
function mb_ord($s, $enc = null) { return p\Mbstring::mb_ord($s, $enc); }
|
||||
function mb_chr($code, $enc = null) { return p\Mbstring::mb_chr($code, $enc); }
|
||||
function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); }
|
||||
function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_scrub')) {
|
||||
function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_str_split')) {
|
||||
function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_str_split')) {
|
||||
function mb_str_split($string, $split_length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $split_length, $encoding); }
|
||||
if (!function_exists('mb_str_pad')) {
|
||||
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ucfirst')) {
|
||||
function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_lcfirst')) {
|
||||
function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_trim')) {
|
||||
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ltrim')) {
|
||||
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_rtrim')) {
|
||||
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!defined('MB_CASE_UPPER')) {
|
||||
define('MB_CASE_UPPER', 0);
|
||||
}
|
||||
if (!defined('MB_CASE_LOWER')) {
|
||||
define('MB_CASE_LOWER', 1);
|
||||
}
|
||||
if (!defined('MB_CASE_TITLE')) {
|
||||
define('MB_CASE_TITLE', 2);
|
||||
}
|
||||
|
||||
167
vendor/symfony/polyfill-mbstring/bootstrap80.php
vendored
Normal file
167
vendor/symfony/polyfill-mbstring/bootstrap80.php
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use Symfony\Polyfill\Mbstring as p;
|
||||
|
||||
if (!function_exists('mb_convert_encoding')) {
|
||||
function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); }
|
||||
}
|
||||
if (!function_exists('mb_decode_mimeheader')) {
|
||||
function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); }
|
||||
}
|
||||
if (!function_exists('mb_encode_mimeheader')) {
|
||||
function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); }
|
||||
}
|
||||
if (!function_exists('mb_decode_numericentity')) {
|
||||
function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_encode_numericentity')) {
|
||||
function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); }
|
||||
}
|
||||
if (!function_exists('mb_convert_case')) {
|
||||
function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_internal_encoding')) {
|
||||
function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_language')) {
|
||||
function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); }
|
||||
}
|
||||
if (!function_exists('mb_list_encodings')) {
|
||||
function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); }
|
||||
}
|
||||
if (!function_exists('mb_encoding_aliases')) {
|
||||
function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_check_encoding')) {
|
||||
function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_detect_encoding')) {
|
||||
function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); }
|
||||
}
|
||||
if (!function_exists('mb_detect_order')) {
|
||||
function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_parse_str')) {
|
||||
function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; }
|
||||
}
|
||||
if (!function_exists('mb_strlen')) {
|
||||
function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strpos')) {
|
||||
function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strtolower')) {
|
||||
function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strtoupper')) {
|
||||
function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_substitute_character')) {
|
||||
function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); }
|
||||
}
|
||||
if (!function_exists('mb_substr')) {
|
||||
function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_stripos')) {
|
||||
function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_stristr')) {
|
||||
function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrchr')) {
|
||||
function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrichr')) {
|
||||
function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strripos')) {
|
||||
function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strrpos')) {
|
||||
function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strstr')) {
|
||||
function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_get_info')) {
|
||||
function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); }
|
||||
}
|
||||
if (!function_exists('mb_http_output')) {
|
||||
function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); }
|
||||
}
|
||||
if (!function_exists('mb_strwidth')) {
|
||||
function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_substr_count')) {
|
||||
function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_output_handler')) {
|
||||
function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); }
|
||||
}
|
||||
if (!function_exists('mb_http_input')) {
|
||||
function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_convert_variables')) {
|
||||
function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ord')) {
|
||||
function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_chr')) {
|
||||
function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_scrub')) {
|
||||
function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); }
|
||||
}
|
||||
if (!function_exists('mb_str_split')) {
|
||||
function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_str_pad')) {
|
||||
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ucfirst')) {
|
||||
function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_lcfirst')) {
|
||||
function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_trim')) {
|
||||
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_ltrim')) {
|
||||
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (!function_exists('mb_rtrim')) {
|
||||
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); }
|
||||
}
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!defined('MB_CASE_UPPER')) {
|
||||
define('MB_CASE_UPPER', 0);
|
||||
}
|
||||
if (!defined('MB_CASE_LOWER')) {
|
||||
define('MB_CASE_LOWER', 1);
|
||||
}
|
||||
if (!defined('MB_CASE_TITLE')) {
|
||||
define('MB_CASE_TITLE', 2);
|
||||
}
|
||||
11
vendor/symfony/polyfill-mbstring/composer.json
vendored
11
vendor/symfony/polyfill-mbstring/composer.json
vendored
@@ -16,7 +16,11 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
"php": ">=7.2",
|
||||
"ext-iconv": "*"
|
||||
},
|
||||
"provide": {
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" },
|
||||
@@ -27,8 +31,9 @@
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.15-dev"
|
||||
"thanks": {
|
||||
"name": "symfony/polyfill",
|
||||
"url": "https://github.com/symfony/polyfill"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
53
vendor/symfony/var-dumper/CHANGELOG.md
vendored
53
vendor/symfony/var-dumper/CHANGELOG.md
vendored
@@ -1,53 +0,0 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
4.4.0
|
||||
-----
|
||||
|
||||
* added `VarDumperTestTrait::setUpVarDumper()` and `VarDumperTestTrait::tearDownVarDumper()`
|
||||
to configure casters & flags to use in tests
|
||||
* added `ImagineCaster` and infrastructure to dump images
|
||||
* added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data
|
||||
* added `UuidCaster`
|
||||
* made all casters final
|
||||
* added support for the `NO_COLOR` env var (https://no-color.org/)
|
||||
|
||||
4.3.0
|
||||
-----
|
||||
|
||||
* added `DsCaster` to support dumping the contents of data structures from the Ds extension
|
||||
|
||||
4.2.0
|
||||
-----
|
||||
|
||||
* support selecting the format to use by setting the environment variable `VAR_DUMPER_FORMAT` to `html` or `cli`
|
||||
|
||||
4.1.0
|
||||
-----
|
||||
|
||||
* added a `ServerDumper` to send serialized Data clones to a server
|
||||
* added a `ServerDumpCommand` and `DumpServer` to run a server collecting
|
||||
and displaying dumps on a single place with multiple formats support
|
||||
* added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support
|
||||
|
||||
4.0.0
|
||||
-----
|
||||
|
||||
* support for passing `\ReflectionClass` instances to the `Caster::castObject()`
|
||||
method has been dropped, pass class names as strings instead
|
||||
* the `Data::getRawData()` method has been removed
|
||||
* the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0`
|
||||
argument and moves `$message = ''` argument at 4th position.
|
||||
* the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0`
|
||||
argument and moves `$message = ''` argument at 4th position.
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
* added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth
|
||||
* deprecated `MongoCaster`
|
||||
|
||||
2.7.0
|
||||
-----
|
||||
|
||||
* deprecated `Cloner\Data::getLimitedClone()`. Use `withMaxDepth`, `withMaxItemsPerDepth` or `withRefHandles` instead.
|
||||
212
vendor/symfony/var-dumper/Caster/AmqpCaster.php
vendored
212
vendor/symfony/var-dumper/Caster/AmqpCaster.php
vendored
@@ -1,212 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts Amqp related classes to array representation.
|
||||
*
|
||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class AmqpCaster
|
||||
{
|
||||
private static $flags = [
|
||||
AMQP_DURABLE => 'AMQP_DURABLE',
|
||||
AMQP_PASSIVE => 'AMQP_PASSIVE',
|
||||
AMQP_EXCLUSIVE => 'AMQP_EXCLUSIVE',
|
||||
AMQP_AUTODELETE => 'AMQP_AUTODELETE',
|
||||
AMQP_INTERNAL => 'AMQP_INTERNAL',
|
||||
AMQP_NOLOCAL => 'AMQP_NOLOCAL',
|
||||
AMQP_AUTOACK => 'AMQP_AUTOACK',
|
||||
AMQP_IFEMPTY => 'AMQP_IFEMPTY',
|
||||
AMQP_IFUNUSED => 'AMQP_IFUNUSED',
|
||||
AMQP_MANDATORY => 'AMQP_MANDATORY',
|
||||
AMQP_IMMEDIATE => 'AMQP_IMMEDIATE',
|
||||
AMQP_MULTIPLE => 'AMQP_MULTIPLE',
|
||||
AMQP_NOWAIT => 'AMQP_NOWAIT',
|
||||
AMQP_REQUEUE => 'AMQP_REQUEUE',
|
||||
];
|
||||
|
||||
private static $exchangeTypes = [
|
||||
AMQP_EX_TYPE_DIRECT => 'AMQP_EX_TYPE_DIRECT',
|
||||
AMQP_EX_TYPE_FANOUT => 'AMQP_EX_TYPE_FANOUT',
|
||||
AMQP_EX_TYPE_TOPIC => 'AMQP_EX_TYPE_TOPIC',
|
||||
AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS',
|
||||
];
|
||||
|
||||
public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a += [
|
||||
$prefix.'is_connected' => $c->isConnected(),
|
||||
];
|
||||
|
||||
// Recent version of the extension already expose private properties
|
||||
if (isset($a["\x00AMQPConnection\x00login"])) {
|
||||
return $a;
|
||||
}
|
||||
|
||||
// BC layer in the amqp lib
|
||||
if (method_exists($c, 'getReadTimeout')) {
|
||||
$timeout = $c->getReadTimeout();
|
||||
} else {
|
||||
$timeout = $c->getTimeout();
|
||||
}
|
||||
|
||||
$a += [
|
||||
$prefix.'is_connected' => $c->isConnected(),
|
||||
$prefix.'login' => $c->getLogin(),
|
||||
$prefix.'password' => $c->getPassword(),
|
||||
$prefix.'host' => $c->getHost(),
|
||||
$prefix.'vhost' => $c->getVhost(),
|
||||
$prefix.'port' => $c->getPort(),
|
||||
$prefix.'read_timeout' => $timeout,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a += [
|
||||
$prefix.'is_connected' => $c->isConnected(),
|
||||
$prefix.'channel_id' => $c->getChannelId(),
|
||||
];
|
||||
|
||||
// Recent version of the extension already expose private properties
|
||||
if (isset($a["\x00AMQPChannel\x00connection"])) {
|
||||
return $a;
|
||||
}
|
||||
|
||||
$a += [
|
||||
$prefix.'connection' => $c->getConnection(),
|
||||
$prefix.'prefetch_size' => $c->getPrefetchSize(),
|
||||
$prefix.'prefetch_count' => $c->getPrefetchCount(),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a += [
|
||||
$prefix.'flags' => self::extractFlags($c->getFlags()),
|
||||
];
|
||||
|
||||
// Recent version of the extension already expose private properties
|
||||
if (isset($a["\x00AMQPQueue\x00name"])) {
|
||||
return $a;
|
||||
}
|
||||
|
||||
$a += [
|
||||
$prefix.'connection' => $c->getConnection(),
|
||||
$prefix.'channel' => $c->getChannel(),
|
||||
$prefix.'name' => $c->getName(),
|
||||
$prefix.'arguments' => $c->getArguments(),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a += [
|
||||
$prefix.'flags' => self::extractFlags($c->getFlags()),
|
||||
];
|
||||
|
||||
$type = isset(self::$exchangeTypes[$c->getType()]) ? new ConstStub(self::$exchangeTypes[$c->getType()], $c->getType()) : $c->getType();
|
||||
|
||||
// Recent version of the extension already expose private properties
|
||||
if (isset($a["\x00AMQPExchange\x00name"])) {
|
||||
$a["\x00AMQPExchange\x00type"] = $type;
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
$a += [
|
||||
$prefix.'connection' => $c->getConnection(),
|
||||
$prefix.'channel' => $c->getChannel(),
|
||||
$prefix.'name' => $c->getName(),
|
||||
$prefix.'type' => $type,
|
||||
$prefix.'arguments' => $c->getArguments(),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$deliveryMode = new ConstStub($c->getDeliveryMode().(2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode());
|
||||
|
||||
// Recent version of the extension already expose private properties
|
||||
if (isset($a["\x00AMQPEnvelope\x00body"])) {
|
||||
$a["\0AMQPEnvelope\0delivery_mode"] = $deliveryMode;
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
if (!($filter & Caster::EXCLUDE_VERBOSE)) {
|
||||
$a += [$prefix.'body' => $c->getBody()];
|
||||
}
|
||||
|
||||
$a += [
|
||||
$prefix.'delivery_tag' => $c->getDeliveryTag(),
|
||||
$prefix.'is_redelivery' => $c->isRedelivery(),
|
||||
$prefix.'exchange_name' => $c->getExchangeName(),
|
||||
$prefix.'routing_key' => $c->getRoutingKey(),
|
||||
$prefix.'content_type' => $c->getContentType(),
|
||||
$prefix.'content_encoding' => $c->getContentEncoding(),
|
||||
$prefix.'headers' => $c->getHeaders(),
|
||||
$prefix.'delivery_mode' => $deliveryMode,
|
||||
$prefix.'priority' => $c->getPriority(),
|
||||
$prefix.'correlation_id' => $c->getCorrelationId(),
|
||||
$prefix.'reply_to' => $c->getReplyTo(),
|
||||
$prefix.'expiration' => $c->getExpiration(),
|
||||
$prefix.'message_id' => $c->getMessageId(),
|
||||
$prefix.'timestamp' => $c->getTimeStamp(),
|
||||
$prefix.'type' => $c->getType(),
|
||||
$prefix.'user_id' => $c->getUserId(),
|
||||
$prefix.'app_id' => $c->getAppId(),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function extractFlags(int $flags): ConstStub
|
||||
{
|
||||
$flagsArray = [];
|
||||
|
||||
foreach (self::$flags as $value => $name) {
|
||||
if ($flags & $value) {
|
||||
$flagsArray[] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$flagsArray) {
|
||||
$flagsArray = ['AMQP_NOPARAM'];
|
||||
}
|
||||
|
||||
return new ConstStub(implode('|', $flagsArray), $flags);
|
||||
}
|
||||
}
|
||||
80
vendor/symfony/var-dumper/Caster/ArgsStub.php
vendored
80
vendor/symfony/var-dumper/Caster/ArgsStub.php
vendored
@@ -1,80 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Represents a list of function arguments.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class ArgsStub extends EnumStub
|
||||
{
|
||||
private static $parameters = [];
|
||||
|
||||
public function __construct(array $args, string $function, ?string $class)
|
||||
{
|
||||
list($variadic, $params) = self::getParameters($function, $class);
|
||||
|
||||
$values = [];
|
||||
foreach ($args as $k => $v) {
|
||||
$values[$k] = !is_scalar($v) && !$v instanceof Stub ? new CutStub($v) : $v;
|
||||
}
|
||||
if (null === $params) {
|
||||
parent::__construct($values, false);
|
||||
|
||||
return;
|
||||
}
|
||||
if (\count($values) < \count($params)) {
|
||||
$params = \array_slice($params, 0, \count($values));
|
||||
} elseif (\count($values) > \count($params)) {
|
||||
$values[] = new EnumStub(array_splice($values, \count($params)), false);
|
||||
$params[] = $variadic;
|
||||
}
|
||||
if (['...'] === $params) {
|
||||
$this->dumpKeys = false;
|
||||
$this->value = $values[0]->value;
|
||||
} else {
|
||||
$this->value = array_combine($params, $values);
|
||||
}
|
||||
}
|
||||
|
||||
private static function getParameters(string $function, ?string $class): array
|
||||
{
|
||||
if (isset(self::$parameters[$k = $class.'::'.$function])) {
|
||||
return self::$parameters[$k];
|
||||
}
|
||||
|
||||
try {
|
||||
$r = null !== $class ? new \ReflectionMethod($class, $function) : new \ReflectionFunction($function);
|
||||
} catch (\ReflectionException $e) {
|
||||
return [null, null];
|
||||
}
|
||||
|
||||
$variadic = '...';
|
||||
$params = [];
|
||||
foreach ($r->getParameters() as $v) {
|
||||
$k = '$'.$v->name;
|
||||
if ($v->isPassedByReference()) {
|
||||
$k = '&'.$k;
|
||||
}
|
||||
if ($v->isVariadic()) {
|
||||
$variadic .= $k;
|
||||
} else {
|
||||
$params[] = $k;
|
||||
}
|
||||
}
|
||||
|
||||
return self::$parameters[$k] = [$variadic, $params];
|
||||
}
|
||||
}
|
||||
170
vendor/symfony/var-dumper/Caster/Caster.php
vendored
170
vendor/symfony/var-dumper/Caster/Caster.php
vendored
@@ -1,170 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Helper for filtering out properties in casters.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class Caster
|
||||
{
|
||||
const EXCLUDE_VERBOSE = 1;
|
||||
const EXCLUDE_VIRTUAL = 2;
|
||||
const EXCLUDE_DYNAMIC = 4;
|
||||
const EXCLUDE_PUBLIC = 8;
|
||||
const EXCLUDE_PROTECTED = 16;
|
||||
const EXCLUDE_PRIVATE = 32;
|
||||
const EXCLUDE_NULL = 64;
|
||||
const EXCLUDE_EMPTY = 128;
|
||||
const EXCLUDE_NOT_IMPORTANT = 256;
|
||||
const EXCLUDE_STRICT = 512;
|
||||
|
||||
const PREFIX_VIRTUAL = "\0~\0";
|
||||
const PREFIX_DYNAMIC = "\0+\0";
|
||||
const PREFIX_PROTECTED = "\0*\0";
|
||||
|
||||
/**
|
||||
* Casts objects to arrays and adds the dynamic property prefix.
|
||||
*
|
||||
* @param bool $hasDebugInfo Whether the __debugInfo method exists on $obj or not
|
||||
*
|
||||
* @return array The array-cast of the object, with prefixed dynamic properties
|
||||
*/
|
||||
public static function castObject(object $obj, string $class, bool $hasDebugInfo = false): array
|
||||
{
|
||||
if ($hasDebugInfo) {
|
||||
try {
|
||||
$debugInfo = $obj->__debugInfo();
|
||||
} catch (\Exception $e) {
|
||||
// ignore failing __debugInfo()
|
||||
$hasDebugInfo = false;
|
||||
}
|
||||
}
|
||||
|
||||
$a = $obj instanceof \Closure ? [] : (array) $obj;
|
||||
|
||||
if ($obj instanceof \__PHP_Incomplete_Class) {
|
||||
return $a;
|
||||
}
|
||||
|
||||
if ($a) {
|
||||
static $publicProperties = [];
|
||||
|
||||
$i = 0;
|
||||
$prefixedKeys = [];
|
||||
foreach ($a as $k => $v) {
|
||||
if ("\0" !== ($k[0] ?? '')) {
|
||||
if (!isset($publicProperties[$class])) {
|
||||
foreach ((new \ReflectionClass($class))->getProperties(\ReflectionProperty::IS_PUBLIC) as $prop) {
|
||||
$publicProperties[$class][$prop->name] = true;
|
||||
}
|
||||
}
|
||||
if (!isset($publicProperties[$class][$k])) {
|
||||
$prefixedKeys[$i] = self::PREFIX_DYNAMIC.$k;
|
||||
}
|
||||
} elseif (isset($k[16]) && "\0" === $k[16] && 0 === strpos($k, "\0class@anonymous\0")) {
|
||||
$prefixedKeys[$i] = "\0".get_parent_class($class).'@anonymous'.strrchr($k, "\0");
|
||||
}
|
||||
++$i;
|
||||
}
|
||||
if ($prefixedKeys) {
|
||||
$keys = array_keys($a);
|
||||
foreach ($prefixedKeys as $i => $k) {
|
||||
$keys[$i] = $k;
|
||||
}
|
||||
$a = array_combine($keys, $a);
|
||||
}
|
||||
}
|
||||
|
||||
if ($hasDebugInfo && \is_array($debugInfo)) {
|
||||
foreach ($debugInfo as $k => $v) {
|
||||
if (!isset($k[0]) || "\0" !== $k[0]) {
|
||||
$k = self::PREFIX_VIRTUAL.$k;
|
||||
}
|
||||
|
||||
unset($a[$k]);
|
||||
$a[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters out the specified properties.
|
||||
*
|
||||
* By default, a single match in the $filter bit field filters properties out, following an "or" logic.
|
||||
* When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed.
|
||||
*
|
||||
* @param array $a The array containing the properties to filter
|
||||
* @param int $filter A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out
|
||||
* @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set
|
||||
* @param int &$count Set to the number of removed properties
|
||||
*
|
||||
* @return array The filtered array
|
||||
*/
|
||||
public static function filter(array $a, int $filter, array $listedProperties = [], ?int &$count = 0): array
|
||||
{
|
||||
$count = 0;
|
||||
|
||||
foreach ($a as $k => $v) {
|
||||
$type = self::EXCLUDE_STRICT & $filter;
|
||||
|
||||
if (null === $v) {
|
||||
$type |= self::EXCLUDE_NULL & $filter;
|
||||
$type |= self::EXCLUDE_EMPTY & $filter;
|
||||
} elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || [] === $v) {
|
||||
$type |= self::EXCLUDE_EMPTY & $filter;
|
||||
}
|
||||
if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !\in_array($k, $listedProperties, true)) {
|
||||
$type |= self::EXCLUDE_NOT_IMPORTANT;
|
||||
}
|
||||
if ((self::EXCLUDE_VERBOSE & $filter) && \in_array($k, $listedProperties, true)) {
|
||||
$type |= self::EXCLUDE_VERBOSE;
|
||||
}
|
||||
|
||||
if (!isset($k[1]) || "\0" !== $k[0]) {
|
||||
$type |= self::EXCLUDE_PUBLIC & $filter;
|
||||
} elseif ('~' === $k[1]) {
|
||||
$type |= self::EXCLUDE_VIRTUAL & $filter;
|
||||
} elseif ('+' === $k[1]) {
|
||||
$type |= self::EXCLUDE_DYNAMIC & $filter;
|
||||
} elseif ('*' === $k[1]) {
|
||||
$type |= self::EXCLUDE_PROTECTED & $filter;
|
||||
} else {
|
||||
$type |= self::EXCLUDE_PRIVATE & $filter;
|
||||
}
|
||||
|
||||
if ((self::EXCLUDE_STRICT & $filter) ? $type === $filter : $type) {
|
||||
unset($a[$k]);
|
||||
++$count;
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
if (isset($a['__PHP_Incomplete_Class_Name'])) {
|
||||
$stub->class .= '('.$a['__PHP_Incomplete_Class_Name'].')';
|
||||
unset($a['__PHP_Incomplete_Class_Name']);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
106
vendor/symfony/var-dumper/Caster/ClassStub.php
vendored
106
vendor/symfony/var-dumper/Caster/ClassStub.php
vendored
@@ -1,106 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Represents a PHP class identifier.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class ClassStub extends ConstStub
|
||||
{
|
||||
/**
|
||||
* @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name
|
||||
* @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier
|
||||
*/
|
||||
public function __construct(string $identifier, $callable = null)
|
||||
{
|
||||
$this->value = $identifier;
|
||||
|
||||
try {
|
||||
if (null !== $callable) {
|
||||
if ($callable instanceof \Closure) {
|
||||
$r = new \ReflectionFunction($callable);
|
||||
} elseif (\is_object($callable)) {
|
||||
$r = [$callable, '__invoke'];
|
||||
} elseif (\is_array($callable)) {
|
||||
$r = $callable;
|
||||
} elseif (false !== $i = strpos($callable, '::')) {
|
||||
$r = [substr($callable, 0, $i), substr($callable, 2 + $i)];
|
||||
} else {
|
||||
$r = new \ReflectionFunction($callable);
|
||||
}
|
||||
} elseif (0 < $i = strpos($identifier, '::') ?: strpos($identifier, '->')) {
|
||||
$r = [substr($identifier, 0, $i), substr($identifier, 2 + $i)];
|
||||
} else {
|
||||
$r = new \ReflectionClass($identifier);
|
||||
}
|
||||
|
||||
if (\is_array($r)) {
|
||||
try {
|
||||
$r = new \ReflectionMethod($r[0], $r[1]);
|
||||
} catch (\ReflectionException $e) {
|
||||
$r = new \ReflectionClass($r[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (false !== strpos($identifier, "class@anonymous\0")) {
|
||||
$this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||
}, $identifier);
|
||||
}
|
||||
|
||||
if (null !== $callable && $r instanceof \ReflectionFunctionAbstract) {
|
||||
$s = ReflectionCaster::castFunctionAbstract($r, [], new Stub(), true, Caster::EXCLUDE_VERBOSE);
|
||||
$s = ReflectionCaster::getSignature($s);
|
||||
|
||||
if ('()' === substr($identifier, -2)) {
|
||||
$this->value = substr_replace($identifier, $s, -2);
|
||||
} else {
|
||||
$this->value .= $s;
|
||||
}
|
||||
}
|
||||
} catch (\ReflectionException $e) {
|
||||
return;
|
||||
} finally {
|
||||
if (0 < $i = strrpos($this->value, '\\')) {
|
||||
$this->attr['ellipsis'] = \strlen($this->value) - $i;
|
||||
$this->attr['ellipsis-type'] = 'class';
|
||||
$this->attr['ellipsis-tail'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($f = $r->getFileName()) {
|
||||
$this->attr['file'] = $f;
|
||||
$this->attr['line'] = $r->getStartLine();
|
||||
}
|
||||
}
|
||||
|
||||
public static function wrapCallable($callable)
|
||||
{
|
||||
if (\is_object($callable) || !\is_callable($callable)) {
|
||||
return $callable;
|
||||
}
|
||||
|
||||
if (!\is_array($callable)) {
|
||||
$callable = new static($callable, $callable);
|
||||
} elseif (\is_string($callable[0])) {
|
||||
$callable[0] = new static($callable[0], $callable);
|
||||
} else {
|
||||
$callable[1] = new static($callable[1], $callable);
|
||||
}
|
||||
|
||||
return $callable;
|
||||
}
|
||||
}
|
||||
36
vendor/symfony/var-dumper/Caster/ConstStub.php
vendored
36
vendor/symfony/var-dumper/Caster/ConstStub.php
vendored
@@ -1,36 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Represents a PHP constant and its value.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class ConstStub extends Stub
|
||||
{
|
||||
public function __construct(string $name, $value = null)
|
||||
{
|
||||
$this->class = $name;
|
||||
$this->value = 1 < \func_num_args() ? $value : $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return (string) $this->value;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
/**
|
||||
* Represents a cut array.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class CutArrayStub extends CutStub
|
||||
{
|
||||
public $preservedSubset;
|
||||
|
||||
public function __construct(array $value, array $preservedKeys)
|
||||
{
|
||||
parent::__construct($value);
|
||||
|
||||
$this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys));
|
||||
$this->cut -= \count($this->preservedSubset);
|
||||
}
|
||||
}
|
||||
64
vendor/symfony/var-dumper/Caster/CutStub.php
vendored
64
vendor/symfony/var-dumper/Caster/CutStub.php
vendored
@@ -1,64 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Represents the main properties of a PHP variable, pre-casted by a caster.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class CutStub extends Stub
|
||||
{
|
||||
public function __construct($value)
|
||||
{
|
||||
$this->value = $value;
|
||||
|
||||
switch (\gettype($value)) {
|
||||
case 'object':
|
||||
$this->type = self::TYPE_OBJECT;
|
||||
$this->class = \get_class($value);
|
||||
|
||||
if ($value instanceof \Closure) {
|
||||
ReflectionCaster::castClosure($value, [], $this, true, Caster::EXCLUDE_VERBOSE);
|
||||
}
|
||||
|
||||
$this->cut = -1;
|
||||
break;
|
||||
|
||||
case 'array':
|
||||
$this->type = self::TYPE_ARRAY;
|
||||
$this->class = self::ARRAY_ASSOC;
|
||||
$this->cut = $this->value = \count($value);
|
||||
break;
|
||||
|
||||
case 'resource':
|
||||
case 'unknown type':
|
||||
case 'resource (closed)':
|
||||
$this->type = self::TYPE_RESOURCE;
|
||||
$this->handle = (int) $value;
|
||||
if ('Unknown' === $this->class = @get_resource_type($value)) {
|
||||
$this->class = 'Closed';
|
||||
}
|
||||
$this->cut = -1;
|
||||
break;
|
||||
|
||||
case 'string':
|
||||
$this->type = self::TYPE_STRING;
|
||||
$this->class = preg_match('//u', $value) ? self::STRING_UTF8 : self::STRING_BINARY;
|
||||
$this->cut = self::STRING_BINARY === $this->class ? \strlen($value) : mb_strlen($value, 'UTF-8');
|
||||
$this->value = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
304
vendor/symfony/var-dumper/Caster/DOMCaster.php
vendored
304
vendor/symfony/var-dumper/Caster/DOMCaster.php
vendored
@@ -1,304 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts DOM related classes to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DOMCaster
|
||||
{
|
||||
private static $errorCodes = [
|
||||
DOM_PHP_ERR => 'DOM_PHP_ERR',
|
||||
DOM_INDEX_SIZE_ERR => 'DOM_INDEX_SIZE_ERR',
|
||||
DOMSTRING_SIZE_ERR => 'DOMSTRING_SIZE_ERR',
|
||||
DOM_HIERARCHY_REQUEST_ERR => 'DOM_HIERARCHY_REQUEST_ERR',
|
||||
DOM_WRONG_DOCUMENT_ERR => 'DOM_WRONG_DOCUMENT_ERR',
|
||||
DOM_INVALID_CHARACTER_ERR => 'DOM_INVALID_CHARACTER_ERR',
|
||||
DOM_NO_DATA_ALLOWED_ERR => 'DOM_NO_DATA_ALLOWED_ERR',
|
||||
DOM_NO_MODIFICATION_ALLOWED_ERR => 'DOM_NO_MODIFICATION_ALLOWED_ERR',
|
||||
DOM_NOT_FOUND_ERR => 'DOM_NOT_FOUND_ERR',
|
||||
DOM_NOT_SUPPORTED_ERR => 'DOM_NOT_SUPPORTED_ERR',
|
||||
DOM_INUSE_ATTRIBUTE_ERR => 'DOM_INUSE_ATTRIBUTE_ERR',
|
||||
DOM_INVALID_STATE_ERR => 'DOM_INVALID_STATE_ERR',
|
||||
DOM_SYNTAX_ERR => 'DOM_SYNTAX_ERR',
|
||||
DOM_INVALID_MODIFICATION_ERR => 'DOM_INVALID_MODIFICATION_ERR',
|
||||
DOM_NAMESPACE_ERR => 'DOM_NAMESPACE_ERR',
|
||||
DOM_INVALID_ACCESS_ERR => 'DOM_INVALID_ACCESS_ERR',
|
||||
DOM_VALIDATION_ERR => 'DOM_VALIDATION_ERR',
|
||||
];
|
||||
|
||||
private static $nodeTypes = [
|
||||
XML_ELEMENT_NODE => 'XML_ELEMENT_NODE',
|
||||
XML_ATTRIBUTE_NODE => 'XML_ATTRIBUTE_NODE',
|
||||
XML_TEXT_NODE => 'XML_TEXT_NODE',
|
||||
XML_CDATA_SECTION_NODE => 'XML_CDATA_SECTION_NODE',
|
||||
XML_ENTITY_REF_NODE => 'XML_ENTITY_REF_NODE',
|
||||
XML_ENTITY_NODE => 'XML_ENTITY_NODE',
|
||||
XML_PI_NODE => 'XML_PI_NODE',
|
||||
XML_COMMENT_NODE => 'XML_COMMENT_NODE',
|
||||
XML_DOCUMENT_NODE => 'XML_DOCUMENT_NODE',
|
||||
XML_DOCUMENT_TYPE_NODE => 'XML_DOCUMENT_TYPE_NODE',
|
||||
XML_DOCUMENT_FRAG_NODE => 'XML_DOCUMENT_FRAG_NODE',
|
||||
XML_NOTATION_NODE => 'XML_NOTATION_NODE',
|
||||
XML_HTML_DOCUMENT_NODE => 'XML_HTML_DOCUMENT_NODE',
|
||||
XML_DTD_NODE => 'XML_DTD_NODE',
|
||||
XML_ELEMENT_DECL_NODE => 'XML_ELEMENT_DECL_NODE',
|
||||
XML_ATTRIBUTE_DECL_NODE => 'XML_ATTRIBUTE_DECL_NODE',
|
||||
XML_ENTITY_DECL_NODE => 'XML_ENTITY_DECL_NODE',
|
||||
XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE',
|
||||
];
|
||||
|
||||
public static function castException(\DOMException $e, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$k = Caster::PREFIX_PROTECTED.'code';
|
||||
if (isset($a[$k], self::$errorCodes[$a[$k]])) {
|
||||
$a[$k] = new ConstStub(self::$errorCodes[$a[$k]], $a[$k]);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castLength($dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'length' => $dom->length,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castImplementation($dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'Core' => '1.0',
|
||||
Caster::PREFIX_VIRTUAL.'XML' => '2.0',
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'nodeName' => $dom->nodeName,
|
||||
'nodeValue' => new CutStub($dom->nodeValue),
|
||||
'nodeType' => new ConstStub(self::$nodeTypes[$dom->nodeType], $dom->nodeType),
|
||||
'parentNode' => new CutStub($dom->parentNode),
|
||||
'childNodes' => $dom->childNodes,
|
||||
'firstChild' => new CutStub($dom->firstChild),
|
||||
'lastChild' => new CutStub($dom->lastChild),
|
||||
'previousSibling' => new CutStub($dom->previousSibling),
|
||||
'nextSibling' => new CutStub($dom->nextSibling),
|
||||
'attributes' => $dom->attributes,
|
||||
'ownerDocument' => new CutStub($dom->ownerDocument),
|
||||
'namespaceURI' => $dom->namespaceURI,
|
||||
'prefix' => $dom->prefix,
|
||||
'localName' => $dom->localName,
|
||||
'baseURI' => $dom->baseURI ? new LinkStub($dom->baseURI) : $dom->baseURI,
|
||||
'textContent' => new CutStub($dom->textContent),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'nodeName' => $dom->nodeName,
|
||||
'nodeValue' => new CutStub($dom->nodeValue),
|
||||
'nodeType' => new ConstStub(self::$nodeTypes[$dom->nodeType], $dom->nodeType),
|
||||
'prefix' => $dom->prefix,
|
||||
'localName' => $dom->localName,
|
||||
'namespaceURI' => $dom->namespaceURI,
|
||||
'ownerDocument' => new CutStub($dom->ownerDocument),
|
||||
'parentNode' => new CutStub($dom->parentNode),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$a += [
|
||||
'doctype' => $dom->doctype,
|
||||
'implementation' => $dom->implementation,
|
||||
'documentElement' => new CutStub($dom->documentElement),
|
||||
'actualEncoding' => $dom->actualEncoding,
|
||||
'encoding' => $dom->encoding,
|
||||
'xmlEncoding' => $dom->xmlEncoding,
|
||||
'standalone' => $dom->standalone,
|
||||
'xmlStandalone' => $dom->xmlStandalone,
|
||||
'version' => $dom->version,
|
||||
'xmlVersion' => $dom->xmlVersion,
|
||||
'strictErrorChecking' => $dom->strictErrorChecking,
|
||||
'documentURI' => $dom->documentURI ? new LinkStub($dom->documentURI) : $dom->documentURI,
|
||||
'config' => $dom->config,
|
||||
'formatOutput' => $dom->formatOutput,
|
||||
'validateOnParse' => $dom->validateOnParse,
|
||||
'resolveExternals' => $dom->resolveExternals,
|
||||
'preserveWhiteSpace' => $dom->preserveWhiteSpace,
|
||||
'recover' => $dom->recover,
|
||||
'substituteEntities' => $dom->substituteEntities,
|
||||
];
|
||||
|
||||
if (!($filter & Caster::EXCLUDE_VERBOSE)) {
|
||||
$formatOutput = $dom->formatOutput;
|
||||
$dom->formatOutput = true;
|
||||
$a += [Caster::PREFIX_VIRTUAL.'xml' => $dom->saveXML()];
|
||||
$dom->formatOutput = $formatOutput;
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'data' => $dom->data,
|
||||
'length' => $dom->length,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'name' => $dom->name,
|
||||
'specified' => $dom->specified,
|
||||
'value' => $dom->value,
|
||||
'ownerElement' => $dom->ownerElement,
|
||||
'schemaTypeInfo' => $dom->schemaTypeInfo,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'tagName' => $dom->tagName,
|
||||
'schemaTypeInfo' => $dom->schemaTypeInfo,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'wholeText' => $dom->wholeText,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castTypeinfo(\DOMTypeinfo $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'typeName' => $dom->typeName,
|
||||
'typeNamespace' => $dom->typeNamespace,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castDomError(\DOMDomError $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'severity' => $dom->severity,
|
||||
'message' => $dom->message,
|
||||
'type' => $dom->type,
|
||||
'relatedException' => $dom->relatedException,
|
||||
'related_data' => $dom->related_data,
|
||||
'location' => $dom->location,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castLocator(\DOMLocator $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'lineNumber' => $dom->lineNumber,
|
||||
'columnNumber' => $dom->columnNumber,
|
||||
'offset' => $dom->offset,
|
||||
'relatedNode' => $dom->relatedNode,
|
||||
'uri' => $dom->uri ? new LinkStub($dom->uri, $dom->lineNumber) : $dom->uri,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'name' => $dom->name,
|
||||
'entities' => $dom->entities,
|
||||
'notations' => $dom->notations,
|
||||
'publicId' => $dom->publicId,
|
||||
'systemId' => $dom->systemId,
|
||||
'internalSubset' => $dom->internalSubset,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'publicId' => $dom->publicId,
|
||||
'systemId' => $dom->systemId,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'publicId' => $dom->publicId,
|
||||
'systemId' => $dom->systemId,
|
||||
'notationName' => $dom->notationName,
|
||||
'actualEncoding' => $dom->actualEncoding,
|
||||
'encoding' => $dom->encoding,
|
||||
'version' => $dom->version,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'target' => $dom->target,
|
||||
'data' => $dom->data,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
'document' => $dom->document,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
126
vendor/symfony/var-dumper/Caster/DateCaster.php
vendored
126
vendor/symfony/var-dumper/Caster/DateCaster.php
vendored
@@ -1,126 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts DateTimeInterface related classes to array representation.
|
||||
*
|
||||
* @author Dany Maillard <danymaillard93b@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DateCaster
|
||||
{
|
||||
private const PERIOD_LIMIT = 3;
|
||||
|
||||
public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$location = $d->getTimezone()->getLocation();
|
||||
$fromNow = (new \DateTime())->diff($d);
|
||||
|
||||
$title = $d->format('l, F j, Y')
|
||||
."\n".self::formatInterval($fromNow).' from now'
|
||||
.($location ? ($d->format('I') ? "\nDST On" : "\nDST Off") : '')
|
||||
;
|
||||
|
||||
unset(
|
||||
$a[Caster::PREFIX_DYNAMIC.'date'],
|
||||
$a[Caster::PREFIX_DYNAMIC.'timezone'],
|
||||
$a[Caster::PREFIX_DYNAMIC.'timezone_type']
|
||||
);
|
||||
$a[$prefix.'date'] = new ConstStub(self::formatDateTime($d, $location ? ' e (P)' : ' P'), $title);
|
||||
|
||||
$stub->class .= $d->format(' @U');
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter)
|
||||
{
|
||||
$now = new \DateTimeImmutable();
|
||||
$numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp();
|
||||
$title = number_format($numberOfSeconds, 0, '.', ' ').'s';
|
||||
|
||||
$i = [Caster::PREFIX_VIRTUAL.'interval' => new ConstStub(self::formatInterval($interval), $title)];
|
||||
|
||||
return $filter & Caster::EXCLUDE_VERBOSE ? $i : $i + $a;
|
||||
}
|
||||
|
||||
private static function formatInterval(\DateInterval $i): string
|
||||
{
|
||||
$format = '%R ';
|
||||
|
||||
if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) {
|
||||
$i = date_diff($d = new \DateTime(), date_add(clone $d, $i)); // recalculate carry over points
|
||||
$format .= 0 < $i->days ? '%ad ' : '';
|
||||
} else {
|
||||
$format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : '');
|
||||
}
|
||||
|
||||
$format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : '';
|
||||
$format = '%R ' === $format ? '0s' : $format;
|
||||
|
||||
return $i->format(rtrim($format));
|
||||
}
|
||||
|
||||
public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, bool $isNested, int $filter)
|
||||
{
|
||||
$location = $timeZone->getLocation();
|
||||
$formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P');
|
||||
$title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : '';
|
||||
|
||||
$z = [Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title)];
|
||||
|
||||
return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a;
|
||||
}
|
||||
|
||||
public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, bool $isNested, int $filter)
|
||||
{
|
||||
$dates = [];
|
||||
foreach (clone $p as $i => $d) {
|
||||
if (self::PERIOD_LIMIT === $i) {
|
||||
$now = new \DateTimeImmutable();
|
||||
$dates[] = sprintf('%s more', ($end = $p->getEndDate())
|
||||
? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u')))
|
||||
: $p->recurrences - $i
|
||||
);
|
||||
break;
|
||||
}
|
||||
$dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d));
|
||||
}
|
||||
|
||||
$period = sprintf(
|
||||
'every %s, from %s (%s) %s',
|
||||
self::formatInterval($p->getDateInterval()),
|
||||
self::formatDateTime($p->getStartDate()),
|
||||
$p->include_start_date ? 'included' : 'excluded',
|
||||
($end = $p->getEndDate()) ? 'to '.self::formatDateTime($end) : 'recurring '.$p->recurrences.' time/s'
|
||||
);
|
||||
|
||||
$p = [Caster::PREFIX_VIRTUAL.'period' => new ConstStub($period, implode("\n", $dates))];
|
||||
|
||||
return $filter & Caster::EXCLUDE_VERBOSE ? $p : $p + $a;
|
||||
}
|
||||
|
||||
private static function formatDateTime(\DateTimeInterface $d, string $extra = ''): string
|
||||
{
|
||||
return $d->format('Y-m-d H:i:'.self::formatSeconds($d->format('s'), $d->format('u')).$extra);
|
||||
}
|
||||
|
||||
private static function formatSeconds(string $s, string $us): string
|
||||
{
|
||||
return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us));
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Doctrine\Common\Proxy\Proxy as CommonProxy;
|
||||
use Doctrine\ORM\PersistentCollection;
|
||||
use Doctrine\ORM\Proxy\Proxy as OrmProxy;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts Doctrine related classes to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DoctrineCaster
|
||||
{
|
||||
public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
foreach (['__cloner__', '__initializer__'] as $k) {
|
||||
if (\array_key_exists($k, $a)) {
|
||||
unset($a[$k]);
|
||||
++$stub->cut;
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
foreach (['_entityPersister', '_identifier'] as $k) {
|
||||
if (\array_key_exists($k = "\0Doctrine\\ORM\\Proxy\\Proxy\0".$k, $a)) {
|
||||
unset($a[$k]);
|
||||
++$stub->cut;
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
foreach (['snapshot', 'association', 'typeClass'] as $k) {
|
||||
if (\array_key_exists($k = "\0Doctrine\\ORM\\PersistentCollection\0".$k, $a)) {
|
||||
$a[$k] = new CutStub($a[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
70
vendor/symfony/var-dumper/Caster/DsCaster.php
vendored
70
vendor/symfony/var-dumper/Caster/DsCaster.php
vendored
@@ -1,70 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Ds\Collection;
|
||||
use Ds\Map;
|
||||
use Ds\Pair;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts Ds extension classes to array representation.
|
||||
*
|
||||
* @author Jáchym Toušek <enumag@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DsCaster
|
||||
{
|
||||
public static function castCollection(Collection $c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
$a[Caster::PREFIX_VIRTUAL.'count'] = $c->count();
|
||||
$a[Caster::PREFIX_VIRTUAL.'capacity'] = $c->capacity();
|
||||
|
||||
if (!$c instanceof Map) {
|
||||
$a += $c->toArray();
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castMap(Map $c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
foreach ($c as $k => $v) {
|
||||
$a[] = new DsPairStub($k, $v);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castPair(Pair $c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
foreach ($c->toArray() as $k => $v) {
|
||||
$a[Caster::PREFIX_VIRTUAL.$k] = $v;
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castPairStub(DsPairStub $c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
if ($isNested) {
|
||||
$stub->class = Pair::class;
|
||||
$stub->value = null;
|
||||
$stub->handle = 0;
|
||||
|
||||
$a = $c->value;
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
28
vendor/symfony/var-dumper/Caster/DsPairStub.php
vendored
28
vendor/symfony/var-dumper/Caster/DsPairStub.php
vendored
@@ -1,28 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class DsPairStub extends Stub
|
||||
{
|
||||
public function __construct($key, $value)
|
||||
{
|
||||
$this->value = [
|
||||
Caster::PREFIX_VIRTUAL.'key' => $key,
|
||||
Caster::PREFIX_VIRTUAL.'value' => $value,
|
||||
];
|
||||
}
|
||||
}
|
||||
30
vendor/symfony/var-dumper/Caster/EnumStub.php
vendored
30
vendor/symfony/var-dumper/Caster/EnumStub.php
vendored
@@ -1,30 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Represents an enumeration of values.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class EnumStub extends Stub
|
||||
{
|
||||
public $dumpKeys = true;
|
||||
|
||||
public function __construct(array $values, bool $dumpKeys = true)
|
||||
{
|
||||
$this->value = $values;
|
||||
$this->dumpKeys = $dumpKeys;
|
||||
}
|
||||
}
|
||||
383
vendor/symfony/var-dumper/Caster/ExceptionCaster.php
vendored
383
vendor/symfony/var-dumper/Caster/ExceptionCaster.php
vendored
@@ -1,383 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\ErrorHandler\Exception\SilencedErrorContext;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
|
||||
|
||||
/**
|
||||
* Casts common Exception classes to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class ExceptionCaster
|
||||
{
|
||||
public static $srcContext = 1;
|
||||
public static $traceArgs = true;
|
||||
public static $errorTypes = [
|
||||
E_DEPRECATED => 'E_DEPRECATED',
|
||||
E_USER_DEPRECATED => 'E_USER_DEPRECATED',
|
||||
E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
|
||||
E_ERROR => 'E_ERROR',
|
||||
E_WARNING => 'E_WARNING',
|
||||
E_PARSE => 'E_PARSE',
|
||||
E_NOTICE => 'E_NOTICE',
|
||||
E_CORE_ERROR => 'E_CORE_ERROR',
|
||||
E_CORE_WARNING => 'E_CORE_WARNING',
|
||||
E_COMPILE_ERROR => 'E_COMPILE_ERROR',
|
||||
E_COMPILE_WARNING => 'E_COMPILE_WARNING',
|
||||
E_USER_ERROR => 'E_USER_ERROR',
|
||||
E_USER_WARNING => 'E_USER_WARNING',
|
||||
E_USER_NOTICE => 'E_USER_NOTICE',
|
||||
E_STRICT => 'E_STRICT',
|
||||
];
|
||||
|
||||
private static $framesCache = [];
|
||||
|
||||
public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter);
|
||||
}
|
||||
|
||||
public static function castException(\Exception $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter);
|
||||
}
|
||||
|
||||
public static function castErrorException(\ErrorException $e, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
if (isset($a[$s = Caster::PREFIX_PROTECTED.'severity'], self::$errorTypes[$a[$s]])) {
|
||||
$a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$trace = Caster::PREFIX_VIRTUAL.'trace';
|
||||
$prefix = Caster::PREFIX_PROTECTED;
|
||||
$xPrefix = "\0Exception\0";
|
||||
|
||||
if (isset($a[$xPrefix.'previous'], $a[$trace]) && $a[$xPrefix.'previous'] instanceof \Exception) {
|
||||
$b = (array) $a[$xPrefix.'previous'];
|
||||
$class = \get_class($a[$xPrefix.'previous']);
|
||||
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
|
||||
self::traceUnshift($b[$xPrefix.'trace'], $class, $b[$prefix.'file'], $b[$prefix.'line']);
|
||||
$a[$trace] = new TraceStub($b[$xPrefix.'trace'], false, 0, -\count($a[$trace]->value));
|
||||
}
|
||||
|
||||
unset($a[$xPrefix.'previous'], $a[$prefix.'code'], $a[$prefix.'file'], $a[$prefix.'line']);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$sPrefix = "\0".SilencedErrorContext::class."\0";
|
||||
|
||||
if (!isset($a[$s = $sPrefix.'severity'])) {
|
||||
return $a;
|
||||
}
|
||||
|
||||
if (isset(self::$errorTypes[$a[$s]])) {
|
||||
$a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
|
||||
}
|
||||
|
||||
$trace = [[
|
||||
'file' => $a[$sPrefix.'file'],
|
||||
'line' => $a[$sPrefix.'line'],
|
||||
]];
|
||||
|
||||
if (isset($a[$sPrefix.'trace'])) {
|
||||
$trace = array_merge($trace, $a[$sPrefix.'trace']);
|
||||
}
|
||||
|
||||
unset($a[$sPrefix.'file'], $a[$sPrefix.'line'], $a[$sPrefix.'trace']);
|
||||
$a[Caster::PREFIX_VIRTUAL.'trace'] = new TraceStub($trace, self::$traceArgs);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
if (!$isNested) {
|
||||
return $a;
|
||||
}
|
||||
$stub->class = '';
|
||||
$stub->handle = 0;
|
||||
$frames = $trace->value;
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a = [];
|
||||
$j = \count($frames);
|
||||
if (0 > $i = $trace->sliceOffset) {
|
||||
$i = max(0, $j + $i);
|
||||
}
|
||||
if (!isset($trace->value[$i])) {
|
||||
return [];
|
||||
}
|
||||
$lastCall = isset($frames[$i]['function']) ? (isset($frames[$i]['class']) ? $frames[0]['class'].$frames[$i]['type'] : '').$frames[$i]['function'].'()' : '';
|
||||
$frames[] = ['function' => ''];
|
||||
$collapse = false;
|
||||
|
||||
for ($j += $trace->numberingOffset - $i++; isset($frames[$i]); ++$i, --$j) {
|
||||
$f = $frames[$i];
|
||||
$call = isset($f['function']) ? (isset($f['class']) ? $f['class'].$f['type'] : '').$f['function'] : '???';
|
||||
|
||||
$frame = new FrameStub(
|
||||
[
|
||||
'object' => isset($f['object']) ? $f['object'] : null,
|
||||
'class' => isset($f['class']) ? $f['class'] : null,
|
||||
'type' => isset($f['type']) ? $f['type'] : null,
|
||||
'function' => isset($f['function']) ? $f['function'] : null,
|
||||
] + $frames[$i - 1],
|
||||
false,
|
||||
true
|
||||
);
|
||||
$f = self::castFrameStub($frame, [], $frame, true);
|
||||
if (isset($f[$prefix.'src'])) {
|
||||
foreach ($f[$prefix.'src']->value as $label => $frame) {
|
||||
if (0 === strpos($label, "\0~collapse=0")) {
|
||||
if ($collapse) {
|
||||
$label = substr_replace($label, '1', 11, 1);
|
||||
} else {
|
||||
$collapse = true;
|
||||
}
|
||||
}
|
||||
$label = substr_replace($label, "title=Stack level $j.&", 2, 0);
|
||||
}
|
||||
$f = $frames[$i - 1];
|
||||
if ($trace->keepArgs && !empty($f['args']) && $frame instanceof EnumStub) {
|
||||
$frame->value['arguments'] = new ArgsStub($f['args'], isset($f['function']) ? $f['function'] : null, isset($f['class']) ? $f['class'] : null);
|
||||
}
|
||||
} elseif ('???' !== $lastCall) {
|
||||
$label = new ClassStub($lastCall);
|
||||
if (isset($label->attr['ellipsis'])) {
|
||||
$label->attr['ellipsis'] += 2;
|
||||
$label = substr_replace($prefix, "ellipsis-type=class&ellipsis={$label->attr['ellipsis']}&ellipsis-tail=1&title=Stack level $j.", 2, 0).$label->value.'()';
|
||||
} else {
|
||||
$label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$label->value.'()';
|
||||
}
|
||||
} else {
|
||||
$label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$lastCall;
|
||||
}
|
||||
$a[substr_replace($label, sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame;
|
||||
|
||||
$lastCall = $call;
|
||||
}
|
||||
if (null !== $trace->sliceLength) {
|
||||
$a = \array_slice($a, 0, $trace->sliceLength, true);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
if (!$isNested) {
|
||||
return $a;
|
||||
}
|
||||
$f = $frame->value;
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
if (isset($f['file'], $f['line'])) {
|
||||
$cacheKey = $f;
|
||||
unset($cacheKey['object'], $cacheKey['args']);
|
||||
$cacheKey[] = self::$srcContext;
|
||||
$cacheKey = implode('-', $cacheKey);
|
||||
|
||||
if (isset(self::$framesCache[$cacheKey])) {
|
||||
$a[$prefix.'src'] = self::$framesCache[$cacheKey];
|
||||
} else {
|
||||
if (preg_match('/\((\d+)\)(?:\([\da-f]{32}\))? : (?:eval\(\)\'d code|runtime-created function)$/', $f['file'], $match)) {
|
||||
$f['file'] = substr($f['file'], 0, -\strlen($match[0]));
|
||||
$f['line'] = (int) $match[1];
|
||||
}
|
||||
$src = $f['line'];
|
||||
$srcKey = $f['file'];
|
||||
$ellipsis = new LinkStub($srcKey, 0);
|
||||
$srcAttr = 'collapse='.(int) $ellipsis->inVendor;
|
||||
$ellipsisTail = isset($ellipsis->attr['ellipsis-tail']) ? $ellipsis->attr['ellipsis-tail'] : 0;
|
||||
$ellipsis = isset($ellipsis->attr['ellipsis']) ? $ellipsis->attr['ellipsis'] : 0;
|
||||
|
||||
if (file_exists($f['file']) && 0 <= self::$srcContext) {
|
||||
if (!empty($f['class']) && (is_subclass_of($f['class'], 'Twig\Template') || is_subclass_of($f['class'], 'Twig_Template')) && method_exists($f['class'], 'getDebugInfo')) {
|
||||
$template = isset($f['object']) ? $f['object'] : unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class']));
|
||||
|
||||
$ellipsis = 0;
|
||||
$templateSrc = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : '');
|
||||
$templateInfo = $template->getDebugInfo();
|
||||
if (isset($templateInfo[$f['line']])) {
|
||||
if (!method_exists($template, 'getSourceContext') || !file_exists($templatePath = $template->getSourceContext()->getPath())) {
|
||||
$templatePath = null;
|
||||
}
|
||||
if ($templateSrc) {
|
||||
$src = self::extractSource($templateSrc, $templateInfo[$f['line']], self::$srcContext, 'twig', $templatePath, $f);
|
||||
$srcKey = ($templatePath ?: $template->getTemplateName()).':'.$templateInfo[$f['line']];
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($srcKey == $f['file']) {
|
||||
$src = self::extractSource(file_get_contents($f['file']), $f['line'], self::$srcContext, 'php', $f['file'], $f);
|
||||
$srcKey .= ':'.$f['line'];
|
||||
if ($ellipsis) {
|
||||
$ellipsis += 1 + \strlen($f['line']);
|
||||
}
|
||||
}
|
||||
$srcAttr .= sprintf('&separator= &file=%s&line=%d', rawurlencode($f['file']), $f['line']);
|
||||
} else {
|
||||
$srcAttr .= '&separator=:';
|
||||
}
|
||||
$srcAttr .= $ellipsis ? '&ellipsis-type=path&ellipsis='.$ellipsis.'&ellipsis-tail='.$ellipsisTail : '';
|
||||
self::$framesCache[$cacheKey] = $a[$prefix.'src'] = new EnumStub(["\0~$srcAttr\0$srcKey" => $src]);
|
||||
}
|
||||
}
|
||||
|
||||
unset($a[$prefix.'args'], $a[$prefix.'line'], $a[$prefix.'file']);
|
||||
if ($frame->inTraceStub) {
|
||||
unset($a[$prefix.'class'], $a[$prefix.'type'], $a[$prefix.'function']);
|
||||
}
|
||||
foreach ($a as $k => $v) {
|
||||
if (!$v) {
|
||||
unset($a[$k]);
|
||||
}
|
||||
}
|
||||
if ($frame->keepArgs && !empty($f['args'])) {
|
||||
$a[$prefix.'arguments'] = new ArgsStub($f['args'], $f['function'], $f['class']);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function filterExceptionArray(string $xClass, array $a, string $xPrefix, int $filter): array
|
||||
{
|
||||
if (isset($a[$xPrefix.'trace'])) {
|
||||
$trace = $a[$xPrefix.'trace'];
|
||||
unset($a[$xPrefix.'trace']); // Ensures the trace is always last
|
||||
} else {
|
||||
$trace = [];
|
||||
}
|
||||
|
||||
if (!($filter & Caster::EXCLUDE_VERBOSE) && $trace) {
|
||||
if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) {
|
||||
self::traceUnshift($trace, $xClass, $a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']);
|
||||
}
|
||||
$a[Caster::PREFIX_VIRTUAL.'trace'] = new TraceStub($trace, self::$traceArgs);
|
||||
}
|
||||
if (empty($a[$xPrefix.'previous'])) {
|
||||
unset($a[$xPrefix.'previous']);
|
||||
}
|
||||
unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']);
|
||||
|
||||
if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "class@anonymous\0")) {
|
||||
$a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||
}, $a[Caster::PREFIX_PROTECTED.'message']);
|
||||
}
|
||||
|
||||
if (isset($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line'])) {
|
||||
$a[Caster::PREFIX_PROTECTED.'file'] = new LinkStub($a[Caster::PREFIX_PROTECTED.'file'], $a[Caster::PREFIX_PROTECTED.'line']);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function traceUnshift(array &$trace, ?string $class, string $file, int $line): void
|
||||
{
|
||||
if (isset($trace[0]['file'], $trace[0]['line']) && $trace[0]['file'] === $file && $trace[0]['line'] === $line) {
|
||||
return;
|
||||
}
|
||||
array_unshift($trace, [
|
||||
'function' => $class ? 'new '.$class : null,
|
||||
'file' => $file,
|
||||
'line' => $line,
|
||||
]);
|
||||
}
|
||||
|
||||
private static function extractSource(string $srcLines, int $line, int $srcContext, string $lang, ?string $file, array $frame): EnumStub
|
||||
{
|
||||
$srcLines = explode("\n", $srcLines);
|
||||
$src = [];
|
||||
|
||||
for ($i = $line - 1 - $srcContext; $i <= $line - 1 + $srcContext; ++$i) {
|
||||
$src[] = (isset($srcLines[$i]) ? $srcLines[$i] : '')."\n";
|
||||
}
|
||||
|
||||
if ($frame['function'] ?? false) {
|
||||
$stub = new CutStub(new \stdClass());
|
||||
$stub->class = (isset($frame['class']) ? $frame['class'].$frame['type'] : '').$frame['function'];
|
||||
$stub->type = Stub::TYPE_OBJECT;
|
||||
$stub->attr['cut_hash'] = true;
|
||||
$stub->attr['file'] = $frame['file'];
|
||||
$stub->attr['line'] = $frame['line'];
|
||||
|
||||
try {
|
||||
$caller = isset($frame['class']) ? new \ReflectionMethod($frame['class'], $frame['function']) : new \ReflectionFunction($frame['function']);
|
||||
$stub->class .= ReflectionCaster::getSignature(ReflectionCaster::castFunctionAbstract($caller, [], $stub, true, Caster::EXCLUDE_VERBOSE));
|
||||
|
||||
if ($f = $caller->getFileName()) {
|
||||
$stub->attr['file'] = $f;
|
||||
$stub->attr['line'] = $caller->getStartLine();
|
||||
}
|
||||
} catch (\ReflectionException $e) {
|
||||
// ignore fake class/function
|
||||
}
|
||||
|
||||
$srcLines = ["\0~separator=\0" => $stub];
|
||||
} else {
|
||||
$stub = null;
|
||||
$srcLines = [];
|
||||
}
|
||||
|
||||
$ltrim = 0;
|
||||
do {
|
||||
$pad = null;
|
||||
for ($i = $srcContext << 1; $i >= 0; --$i) {
|
||||
if (isset($src[$i][$ltrim]) && "\r" !== ($c = $src[$i][$ltrim]) && "\n" !== $c) {
|
||||
if (null === $pad) {
|
||||
$pad = $c;
|
||||
}
|
||||
if ((' ' !== $c && "\t" !== $c) || $pad !== $c) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
++$ltrim;
|
||||
} while (0 > $i && null !== $pad);
|
||||
|
||||
--$ltrim;
|
||||
|
||||
foreach ($src as $i => $c) {
|
||||
if ($ltrim) {
|
||||
$c = isset($c[$ltrim]) && "\r" !== $c[$ltrim] ? substr($c, $ltrim) : ltrim($c, " \t");
|
||||
}
|
||||
$c = substr($c, 0, -1);
|
||||
if ($i !== $srcContext) {
|
||||
$c = new ConstStub('default', $c);
|
||||
} else {
|
||||
$c = new ConstStub($c, $stub ? 'in '.$stub->class : '');
|
||||
if (null !== $file) {
|
||||
$c->attr['file'] = $file;
|
||||
$c->attr['line'] = $line;
|
||||
}
|
||||
}
|
||||
$c->attr['lang'] = $lang;
|
||||
$srcLines[sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c;
|
||||
}
|
||||
|
||||
return new EnumStub($srcLines);
|
||||
}
|
||||
}
|
||||
30
vendor/symfony/var-dumper/Caster/FrameStub.php
vendored
30
vendor/symfony/var-dumper/Caster/FrameStub.php
vendored
@@ -1,30 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
/**
|
||||
* Represents a single backtrace frame as returned by debug_backtrace() or Exception->getTrace().
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class FrameStub extends EnumStub
|
||||
{
|
||||
public $keepArgs;
|
||||
public $inTraceStub;
|
||||
|
||||
public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false)
|
||||
{
|
||||
$this->value = $frame;
|
||||
$this->keepArgs = $keepArgs;
|
||||
$this->inTraceStub = $inTraceStub;
|
||||
}
|
||||
}
|
||||
32
vendor/symfony/var-dumper/Caster/GmpCaster.php
vendored
32
vendor/symfony/var-dumper/Caster/GmpCaster.php
vendored
@@ -1,32 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts GMP objects to array representation.
|
||||
*
|
||||
* @author Hamza Amrouche <hamza.simperfit@gmail.com>
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class GmpCaster
|
||||
{
|
||||
public static function castGmp(\GMP $gmp, array $a, Stub $stub, bool $isNested, int $filter): array
|
||||
{
|
||||
$a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp));
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Imagine\Image\ImageInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||
*/
|
||||
final class ImagineCaster
|
||||
{
|
||||
public static function castImage(ImageInterface $c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
$imgData = $c->get('png');
|
||||
if (\strlen($imgData) > 1 * 1000 * 1000) {
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'image' => new ConstStub($c->getSize()),
|
||||
];
|
||||
} else {
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'image' => new ImgStub($imgData, 'image/png', $c->getSize()),
|
||||
];
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
26
vendor/symfony/var-dumper/Caster/ImgStub.php
vendored
26
vendor/symfony/var-dumper/Caster/ImgStub.php
vendored
@@ -1,26 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
/**
|
||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||
*/
|
||||
class ImgStub extends ConstStub
|
||||
{
|
||||
public function __construct(string $data, string $contentType, string $size)
|
||||
{
|
||||
$this->value = '';
|
||||
$this->attr['img-data'] = $data;
|
||||
$this->attr['img-size'] = $size;
|
||||
$this->attr['content-type'] = $contentType;
|
||||
}
|
||||
}
|
||||
172
vendor/symfony/var-dumper/Caster/IntlCaster.php
vendored
172
vendor/symfony/var-dumper/Caster/IntlCaster.php
vendored
@@ -1,172 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
* @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class IntlCaster
|
||||
{
|
||||
public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
||||
Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
||||
Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
|
||||
];
|
||||
|
||||
if ($filter & Caster::EXCLUDE_VERBOSE) {
|
||||
$stub->cut += 3;
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'attributes' => new EnumStub(
|
||||
[
|
||||
'PARSE_INT_ONLY' => $c->getAttribute(\NumberFormatter::PARSE_INT_ONLY),
|
||||
'GROUPING_USED' => $c->getAttribute(\NumberFormatter::GROUPING_USED),
|
||||
'DECIMAL_ALWAYS_SHOWN' => $c->getAttribute(\NumberFormatter::DECIMAL_ALWAYS_SHOWN),
|
||||
'MAX_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_INTEGER_DIGITS),
|
||||
'MIN_INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_INTEGER_DIGITS),
|
||||
'INTEGER_DIGITS' => $c->getAttribute(\NumberFormatter::INTEGER_DIGITS),
|
||||
'MAX_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_FRACTION_DIGITS),
|
||||
'MIN_FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_FRACTION_DIGITS),
|
||||
'FRACTION_DIGITS' => $c->getAttribute(\NumberFormatter::FRACTION_DIGITS),
|
||||
'MULTIPLIER' => $c->getAttribute(\NumberFormatter::MULTIPLIER),
|
||||
'GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::GROUPING_SIZE),
|
||||
'ROUNDING_MODE' => $c->getAttribute(\NumberFormatter::ROUNDING_MODE),
|
||||
'ROUNDING_INCREMENT' => $c->getAttribute(\NumberFormatter::ROUNDING_INCREMENT),
|
||||
'FORMAT_WIDTH' => $c->getAttribute(\NumberFormatter::FORMAT_WIDTH),
|
||||
'PADDING_POSITION' => $c->getAttribute(\NumberFormatter::PADDING_POSITION),
|
||||
'SECONDARY_GROUPING_SIZE' => $c->getAttribute(\NumberFormatter::SECONDARY_GROUPING_SIZE),
|
||||
'SIGNIFICANT_DIGITS_USED' => $c->getAttribute(\NumberFormatter::SIGNIFICANT_DIGITS_USED),
|
||||
'MIN_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MIN_SIGNIFICANT_DIGITS),
|
||||
'MAX_SIGNIFICANT_DIGITS' => $c->getAttribute(\NumberFormatter::MAX_SIGNIFICANT_DIGITS),
|
||||
'LENIENT_PARSE' => $c->getAttribute(\NumberFormatter::LENIENT_PARSE),
|
||||
]
|
||||
),
|
||||
Caster::PREFIX_VIRTUAL.'text_attributes' => new EnumStub(
|
||||
[
|
||||
'POSITIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_PREFIX),
|
||||
'POSITIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::POSITIVE_SUFFIX),
|
||||
'NEGATIVE_PREFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_PREFIX),
|
||||
'NEGATIVE_SUFFIX' => $c->getTextAttribute(\NumberFormatter::NEGATIVE_SUFFIX),
|
||||
'PADDING_CHARACTER' => $c->getTextAttribute(\NumberFormatter::PADDING_CHARACTER),
|
||||
'CURRENCY_CODE' => $c->getTextAttribute(\NumberFormatter::CURRENCY_CODE),
|
||||
'DEFAULT_RULESET' => $c->getTextAttribute(\NumberFormatter::DEFAULT_RULESET),
|
||||
'PUBLIC_RULESETS' => $c->getTextAttribute(\NumberFormatter::PUBLIC_RULESETS),
|
||||
]
|
||||
),
|
||||
Caster::PREFIX_VIRTUAL.'symbols' => new EnumStub(
|
||||
[
|
||||
'DECIMAL_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::DECIMAL_SEPARATOR_SYMBOL),
|
||||
'GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::GROUPING_SEPARATOR_SYMBOL),
|
||||
'PATTERN_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::PATTERN_SEPARATOR_SYMBOL),
|
||||
'PERCENT_SYMBOL' => $c->getSymbol(\NumberFormatter::PERCENT_SYMBOL),
|
||||
'ZERO_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::ZERO_DIGIT_SYMBOL),
|
||||
'DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::DIGIT_SYMBOL),
|
||||
'MINUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::MINUS_SIGN_SYMBOL),
|
||||
'PLUS_SIGN_SYMBOL' => $c->getSymbol(\NumberFormatter::PLUS_SIGN_SYMBOL),
|
||||
'CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::CURRENCY_SYMBOL),
|
||||
'INTL_CURRENCY_SYMBOL' => $c->getSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL),
|
||||
'MONETARY_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_SEPARATOR_SYMBOL),
|
||||
'EXPONENTIAL_SYMBOL' => $c->getSymbol(\NumberFormatter::EXPONENTIAL_SYMBOL),
|
||||
'PERMILL_SYMBOL' => $c->getSymbol(\NumberFormatter::PERMILL_SYMBOL),
|
||||
'PAD_ESCAPE_SYMBOL' => $c->getSymbol(\NumberFormatter::PAD_ESCAPE_SYMBOL),
|
||||
'INFINITY_SYMBOL' => $c->getSymbol(\NumberFormatter::INFINITY_SYMBOL),
|
||||
'NAN_SYMBOL' => $c->getSymbol(\NumberFormatter::NAN_SYMBOL),
|
||||
'SIGNIFICANT_DIGIT_SYMBOL' => $c->getSymbol(\NumberFormatter::SIGNIFICANT_DIGIT_SYMBOL),
|
||||
'MONETARY_GROUPING_SEPARATOR_SYMBOL' => $c->getSymbol(\NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL),
|
||||
]
|
||||
),
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'display_name' => $c->getDisplayName(),
|
||||
Caster::PREFIX_VIRTUAL.'id' => $c->getID(),
|
||||
Caster::PREFIX_VIRTUAL.'raw_offset' => $c->getRawOffset(),
|
||||
];
|
||||
|
||||
if ($c->useDaylightTime()) {
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'dst_savings' => $c->getDSTSavings(),
|
||||
];
|
||||
}
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'type' => $c->getType(),
|
||||
Caster::PREFIX_VIRTUAL.'first_day_of_week' => $c->getFirstDayOfWeek(),
|
||||
Caster::PREFIX_VIRTUAL.'minimal_days_in_first_week' => $c->getMinimalDaysInFirstWeek(),
|
||||
Caster::PREFIX_VIRTUAL.'repeated_wall_time_option' => $c->getRepeatedWallTimeOption(),
|
||||
Caster::PREFIX_VIRTUAL.'skipped_wall_time_option' => $c->getSkippedWallTimeOption(),
|
||||
Caster::PREFIX_VIRTUAL.'time' => $c->getTime(),
|
||||
Caster::PREFIX_VIRTUAL.'in_daylight_time' => $c->inDaylightTime(),
|
||||
Caster::PREFIX_VIRTUAL.'is_lenient' => $c->isLenient(),
|
||||
Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(),
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'locale' => $c->getLocale(),
|
||||
Caster::PREFIX_VIRTUAL.'pattern' => $c->getPattern(),
|
||||
Caster::PREFIX_VIRTUAL.'calendar' => $c->getCalendar(),
|
||||
Caster::PREFIX_VIRTUAL.'time_zone_id' => $c->getTimeZoneId(),
|
||||
Caster::PREFIX_VIRTUAL.'time_type' => $c->getTimeType(),
|
||||
Caster::PREFIX_VIRTUAL.'date_type' => $c->getDateType(),
|
||||
Caster::PREFIX_VIRTUAL.'calendar_object' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getCalendarObject()) : $c->getCalendarObject(),
|
||||
Caster::PREFIX_VIRTUAL.'time_zone' => ($filter & Caster::EXCLUDE_VERBOSE) ? new CutStub($c->getTimeZone()) : $c->getTimeZone(),
|
||||
];
|
||||
|
||||
return self::castError($c, $a);
|
||||
}
|
||||
|
||||
private static function castError(object $c, array $a): array
|
||||
{
|
||||
if ($errorCode = $c->getErrorCode()) {
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'error_code' => $errorCode,
|
||||
Caster::PREFIX_VIRTUAL.'error_message' => $c->getErrorMessage(),
|
||||
];
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
108
vendor/symfony/var-dumper/Caster/LinkStub.php
vendored
108
vendor/symfony/var-dumper/Caster/LinkStub.php
vendored
@@ -1,108 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
/**
|
||||
* Represents a file or a URL.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class LinkStub extends ConstStub
|
||||
{
|
||||
public $inVendor = false;
|
||||
|
||||
private static $vendorRoots;
|
||||
private static $composerRoots;
|
||||
|
||||
public function __construct($label, int $line = 0, $href = null)
|
||||
{
|
||||
$this->value = $label;
|
||||
|
||||
if (null === $href) {
|
||||
$href = $label;
|
||||
}
|
||||
if (!\is_string($href)) {
|
||||
return;
|
||||
}
|
||||
if (0 === strpos($href, 'file://')) {
|
||||
if ($href === $label) {
|
||||
$label = substr($label, 7);
|
||||
}
|
||||
$href = substr($href, 7);
|
||||
} elseif (false !== strpos($href, '://')) {
|
||||
$this->attr['href'] = $href;
|
||||
|
||||
return;
|
||||
}
|
||||
if (!file_exists($href)) {
|
||||
return;
|
||||
}
|
||||
if ($line) {
|
||||
$this->attr['line'] = $line;
|
||||
}
|
||||
if ($label !== $this->attr['file'] = realpath($href) ?: $href) {
|
||||
return;
|
||||
}
|
||||
if ($composerRoot = $this->getComposerRoot($href, $this->inVendor)) {
|
||||
$this->attr['ellipsis'] = \strlen($href) - \strlen($composerRoot) + 1;
|
||||
$this->attr['ellipsis-type'] = 'path';
|
||||
$this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + \strlen(implode('', \array_slice(explode(\DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0);
|
||||
} elseif (3 < \count($ellipsis = explode(\DIRECTORY_SEPARATOR, $href))) {
|
||||
$this->attr['ellipsis'] = 2 + \strlen(implode('', \array_slice($ellipsis, -2)));
|
||||
$this->attr['ellipsis-type'] = 'path';
|
||||
$this->attr['ellipsis-tail'] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
private function getComposerRoot(string $file, bool &$inVendor)
|
||||
{
|
||||
if (null === self::$vendorRoots) {
|
||||
self::$vendorRoots = [];
|
||||
|
||||
foreach (get_declared_classes() as $class) {
|
||||
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
|
||||
$r = new \ReflectionClass($class);
|
||||
$v = \dirname($r->getFileName(), 2);
|
||||
if (file_exists($v.'/composer/installed.json')) {
|
||||
self::$vendorRoots[] = $v.\DIRECTORY_SEPARATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$inVendor = false;
|
||||
|
||||
if (isset(self::$composerRoots[$dir = \dirname($file)])) {
|
||||
return self::$composerRoots[$dir];
|
||||
}
|
||||
|
||||
foreach (self::$vendorRoots as $root) {
|
||||
if ($inVendor = 0 === strpos($file, $root)) {
|
||||
return $root;
|
||||
}
|
||||
}
|
||||
|
||||
$parent = $dir;
|
||||
while (!@file_exists($parent.'/composer.json')) {
|
||||
if (!@file_exists($parent)) {
|
||||
// open_basedir restriction in effect
|
||||
break;
|
||||
}
|
||||
if ($parent === \dirname($parent)) {
|
||||
return self::$composerRoots[$dir] = false;
|
||||
}
|
||||
|
||||
$parent = \dirname($parent);
|
||||
}
|
||||
|
||||
return self::$composerRoots[$dir] = $parent.\DIRECTORY_SEPARATOR;
|
||||
}
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class MemcachedCaster
|
||||
{
|
||||
private static $optionConstants;
|
||||
private static $defaultOptions;
|
||||
|
||||
public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'servers' => $c->getServerList(),
|
||||
Caster::PREFIX_VIRTUAL.'options' => new EnumStub(
|
||||
self::getNonDefaultOptions($c)
|
||||
),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function getNonDefaultOptions(\Memcached $c): array
|
||||
{
|
||||
self::$defaultOptions = self::$defaultOptions ?? self::discoverDefaultOptions();
|
||||
self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
|
||||
|
||||
$nonDefaultOptions = [];
|
||||
foreach (self::$optionConstants as $constantKey => $value) {
|
||||
if (self::$defaultOptions[$constantKey] !== $option = $c->getOption($value)) {
|
||||
$nonDefaultOptions[$constantKey] = $option;
|
||||
}
|
||||
}
|
||||
|
||||
return $nonDefaultOptions;
|
||||
}
|
||||
|
||||
private static function discoverDefaultOptions(): array
|
||||
{
|
||||
$defaultMemcached = new \Memcached();
|
||||
$defaultMemcached->addServer('127.0.0.1', 11211);
|
||||
|
||||
$defaultOptions = [];
|
||||
self::$optionConstants = self::$optionConstants ?? self::getOptionConstants();
|
||||
|
||||
foreach (self::$optionConstants as $constantKey => $value) {
|
||||
$defaultOptions[$constantKey] = $defaultMemcached->getOption($value);
|
||||
}
|
||||
|
||||
return $defaultOptions;
|
||||
}
|
||||
|
||||
private static function getOptionConstants(): array
|
||||
{
|
||||
$reflectedMemcached = new \ReflectionClass(\Memcached::class);
|
||||
|
||||
$optionConstants = [];
|
||||
foreach ($reflectedMemcached->getConstants() as $constantKey => $value) {
|
||||
if (0 === strpos($constantKey, 'OPT_')) {
|
||||
$optionConstants[$constantKey] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return $optionConstants;
|
||||
}
|
||||
}
|
||||
122
vendor/symfony/var-dumper/Caster/PdoCaster.php
vendored
122
vendor/symfony/var-dumper/Caster/PdoCaster.php
vendored
@@ -1,122 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts PDO related classes to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class PdoCaster
|
||||
{
|
||||
private static $pdoAttributes = [
|
||||
'CASE' => [
|
||||
\PDO::CASE_LOWER => 'LOWER',
|
||||
\PDO::CASE_NATURAL => 'NATURAL',
|
||||
\PDO::CASE_UPPER => 'UPPER',
|
||||
],
|
||||
'ERRMODE' => [
|
||||
\PDO::ERRMODE_SILENT => 'SILENT',
|
||||
\PDO::ERRMODE_WARNING => 'WARNING',
|
||||
\PDO::ERRMODE_EXCEPTION => 'EXCEPTION',
|
||||
],
|
||||
'TIMEOUT',
|
||||
'PREFETCH',
|
||||
'AUTOCOMMIT',
|
||||
'PERSISTENT',
|
||||
'DRIVER_NAME',
|
||||
'SERVER_INFO',
|
||||
'ORACLE_NULLS' => [
|
||||
\PDO::NULL_NATURAL => 'NATURAL',
|
||||
\PDO::NULL_EMPTY_STRING => 'EMPTY_STRING',
|
||||
\PDO::NULL_TO_STRING => 'TO_STRING',
|
||||
],
|
||||
'CLIENT_VERSION',
|
||||
'SERVER_VERSION',
|
||||
'STATEMENT_CLASS',
|
||||
'EMULATE_PREPARES',
|
||||
'CONNECTION_STATUS',
|
||||
'STRINGIFY_FETCHES',
|
||||
'DEFAULT_FETCH_MODE' => [
|
||||
\PDO::FETCH_ASSOC => 'ASSOC',
|
||||
\PDO::FETCH_BOTH => 'BOTH',
|
||||
\PDO::FETCH_LAZY => 'LAZY',
|
||||
\PDO::FETCH_NUM => 'NUM',
|
||||
\PDO::FETCH_OBJ => 'OBJ',
|
||||
],
|
||||
];
|
||||
|
||||
public static function castPdo(\PDO $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$attr = [];
|
||||
$errmode = $c->getAttribute(\PDO::ATTR_ERRMODE);
|
||||
$c->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
foreach (self::$pdoAttributes as $k => $v) {
|
||||
if (!isset($k[0])) {
|
||||
$k = $v;
|
||||
$v = [];
|
||||
}
|
||||
|
||||
try {
|
||||
$attr[$k] = 'ERRMODE' === $k ? $errmode : $c->getAttribute(\constant('PDO::ATTR_'.$k));
|
||||
if ($v && isset($v[$attr[$k]])) {
|
||||
$attr[$k] = new ConstStub($v[$attr[$k]], $attr[$k]);
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
if (isset($attr[$k = 'STATEMENT_CLASS'][1])) {
|
||||
if ($attr[$k][1]) {
|
||||
$attr[$k][1] = new ArgsStub($attr[$k][1], '__construct', $attr[$k][0]);
|
||||
}
|
||||
$attr[$k][0] = new ClassStub($attr[$k][0]);
|
||||
}
|
||||
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$a += [
|
||||
$prefix.'inTransaction' => method_exists($c, 'inTransaction'),
|
||||
$prefix.'errorInfo' => $c->errorInfo(),
|
||||
$prefix.'attributes' => new EnumStub($attr),
|
||||
];
|
||||
|
||||
if ($a[$prefix.'inTransaction']) {
|
||||
$a[$prefix.'inTransaction'] = $c->inTransaction();
|
||||
} else {
|
||||
unset($a[$prefix.'inTransaction']);
|
||||
}
|
||||
|
||||
if (!isset($a[$prefix.'errorInfo'][1], $a[$prefix.'errorInfo'][2])) {
|
||||
unset($a[$prefix.'errorInfo']);
|
||||
}
|
||||
|
||||
$c->setAttribute(\PDO::ATTR_ERRMODE, $errmode);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castPdoStatement(\PDOStatement $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$a[$prefix.'errorInfo'] = $c->errorInfo();
|
||||
|
||||
if (!isset($a[$prefix.'errorInfo'][1], $a[$prefix.'errorInfo'][2])) {
|
||||
unset($a[$prefix.'errorInfo']);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
156
vendor/symfony/var-dumper/Caster/PgSqlCaster.php
vendored
156
vendor/symfony/var-dumper/Caster/PgSqlCaster.php
vendored
@@ -1,156 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts pqsql resources to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class PgSqlCaster
|
||||
{
|
||||
private static $paramCodes = [
|
||||
'server_encoding',
|
||||
'client_encoding',
|
||||
'is_superuser',
|
||||
'session_authorization',
|
||||
'DateStyle',
|
||||
'TimeZone',
|
||||
'IntervalStyle',
|
||||
'integer_datetimes',
|
||||
'application_name',
|
||||
'standard_conforming_strings',
|
||||
];
|
||||
|
||||
private static $transactionStatus = [
|
||||
PGSQL_TRANSACTION_IDLE => 'PGSQL_TRANSACTION_IDLE',
|
||||
PGSQL_TRANSACTION_ACTIVE => 'PGSQL_TRANSACTION_ACTIVE',
|
||||
PGSQL_TRANSACTION_INTRANS => 'PGSQL_TRANSACTION_INTRANS',
|
||||
PGSQL_TRANSACTION_INERROR => 'PGSQL_TRANSACTION_INERROR',
|
||||
PGSQL_TRANSACTION_UNKNOWN => 'PGSQL_TRANSACTION_UNKNOWN',
|
||||
];
|
||||
|
||||
private static $resultStatus = [
|
||||
PGSQL_EMPTY_QUERY => 'PGSQL_EMPTY_QUERY',
|
||||
PGSQL_COMMAND_OK => 'PGSQL_COMMAND_OK',
|
||||
PGSQL_TUPLES_OK => 'PGSQL_TUPLES_OK',
|
||||
PGSQL_COPY_OUT => 'PGSQL_COPY_OUT',
|
||||
PGSQL_COPY_IN => 'PGSQL_COPY_IN',
|
||||
PGSQL_BAD_RESPONSE => 'PGSQL_BAD_RESPONSE',
|
||||
PGSQL_NONFATAL_ERROR => 'PGSQL_NONFATAL_ERROR',
|
||||
PGSQL_FATAL_ERROR => 'PGSQL_FATAL_ERROR',
|
||||
];
|
||||
|
||||
private static $diagCodes = [
|
||||
'severity' => PGSQL_DIAG_SEVERITY,
|
||||
'sqlstate' => PGSQL_DIAG_SQLSTATE,
|
||||
'message' => PGSQL_DIAG_MESSAGE_PRIMARY,
|
||||
'detail' => PGSQL_DIAG_MESSAGE_DETAIL,
|
||||
'hint' => PGSQL_DIAG_MESSAGE_HINT,
|
||||
'statement position' => PGSQL_DIAG_STATEMENT_POSITION,
|
||||
'internal position' => PGSQL_DIAG_INTERNAL_POSITION,
|
||||
'internal query' => PGSQL_DIAG_INTERNAL_QUERY,
|
||||
'context' => PGSQL_DIAG_CONTEXT,
|
||||
'file' => PGSQL_DIAG_SOURCE_FILE,
|
||||
'line' => PGSQL_DIAG_SOURCE_LINE,
|
||||
'function' => PGSQL_DIAG_SOURCE_FUNCTION,
|
||||
];
|
||||
|
||||
public static function castLargeObject($lo, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a['seek position'] = pg_lo_tell($lo);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castLink($link, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a['status'] = pg_connection_status($link);
|
||||
$a['status'] = new ConstStub(PGSQL_CONNECTION_OK === $a['status'] ? 'PGSQL_CONNECTION_OK' : 'PGSQL_CONNECTION_BAD', $a['status']);
|
||||
$a['busy'] = pg_connection_busy($link);
|
||||
|
||||
$a['transaction'] = pg_transaction_status($link);
|
||||
if (isset(self::$transactionStatus[$a['transaction']])) {
|
||||
$a['transaction'] = new ConstStub(self::$transactionStatus[$a['transaction']], $a['transaction']);
|
||||
}
|
||||
|
||||
$a['pid'] = pg_get_pid($link);
|
||||
$a['last error'] = pg_last_error($link);
|
||||
$a['last notice'] = pg_last_notice($link);
|
||||
$a['host'] = pg_host($link);
|
||||
$a['port'] = pg_port($link);
|
||||
$a['dbname'] = pg_dbname($link);
|
||||
$a['options'] = pg_options($link);
|
||||
$a['version'] = pg_version($link);
|
||||
|
||||
foreach (self::$paramCodes as $v) {
|
||||
if (false !== $s = pg_parameter_status($link, $v)) {
|
||||
$a['param'][$v] = $s;
|
||||
}
|
||||
}
|
||||
|
||||
$a['param']['client_encoding'] = pg_client_encoding($link);
|
||||
$a['param'] = new EnumStub($a['param']);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castResult($result, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a['num rows'] = pg_num_rows($result);
|
||||
$a['status'] = pg_result_status($result);
|
||||
if (isset(self::$resultStatus[$a['status']])) {
|
||||
$a['status'] = new ConstStub(self::$resultStatus[$a['status']], $a['status']);
|
||||
}
|
||||
$a['command-completion tag'] = pg_result_status($result, PGSQL_STATUS_STRING);
|
||||
|
||||
if (-1 === $a['num rows']) {
|
||||
foreach (self::$diagCodes as $k => $v) {
|
||||
$a['error'][$k] = pg_result_error_field($result, $v);
|
||||
}
|
||||
}
|
||||
|
||||
$a['affected rows'] = pg_affected_rows($result);
|
||||
$a['last OID'] = pg_last_oid($result);
|
||||
|
||||
$fields = pg_num_fields($result);
|
||||
|
||||
for ($i = 0; $i < $fields; ++$i) {
|
||||
$field = [
|
||||
'name' => pg_field_name($result, $i),
|
||||
'table' => sprintf('%s (OID: %s)', pg_field_table($result, $i), pg_field_table($result, $i, true)),
|
||||
'type' => sprintf('%s (OID: %s)', pg_field_type($result, $i), pg_field_type_oid($result, $i)),
|
||||
'nullable' => (bool) pg_field_is_null($result, $i),
|
||||
'storage' => pg_field_size($result, $i).' bytes',
|
||||
'display' => pg_field_prtlen($result, $i).' chars',
|
||||
];
|
||||
if (' (OID: )' === $field['table']) {
|
||||
$field['table'] = null;
|
||||
}
|
||||
if ('-1 bytes' === $field['storage']) {
|
||||
$field['storage'] = 'variable size';
|
||||
} elseif ('1 bytes' === $field['storage']) {
|
||||
$field['storage'] = '1 byte';
|
||||
}
|
||||
if ('1 chars' === $field['display']) {
|
||||
$field['display'] = '1 char';
|
||||
}
|
||||
$a['fields'][] = new EnumStub($field);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use ProxyManager\Proxy\ProxyInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class ProxyManagerCaster
|
||||
{
|
||||
public static function castProxy(ProxyInterface $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
if ($parent = get_parent_class($c)) {
|
||||
$stub->class .= ' - '.$parent;
|
||||
}
|
||||
$stub->class .= '@proxy';
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
152
vendor/symfony/var-dumper/Caster/RedisCaster.php
vendored
152
vendor/symfony/var-dumper/Caster/RedisCaster.php
vendored
@@ -1,152 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts Redis class from ext-redis to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class RedisCaster
|
||||
{
|
||||
private static $serializer = [
|
||||
\Redis::SERIALIZER_NONE => 'NONE',
|
||||
\Redis::SERIALIZER_PHP => 'PHP',
|
||||
2 => 'IGBINARY', // Optional Redis::SERIALIZER_IGBINARY
|
||||
];
|
||||
|
||||
private static $mode = [
|
||||
\Redis::ATOMIC => 'ATOMIC',
|
||||
\Redis::MULTI => 'MULTI',
|
||||
\Redis::PIPELINE => 'PIPELINE',
|
||||
];
|
||||
|
||||
private static $compression = [
|
||||
0 => 'NONE', // Redis::COMPRESSION_NONE
|
||||
1 => 'LZF', // Redis::COMPRESSION_LZF
|
||||
];
|
||||
|
||||
private static $failover = [
|
||||
\RedisCluster::FAILOVER_NONE => 'NONE',
|
||||
\RedisCluster::FAILOVER_ERROR => 'ERROR',
|
||||
\RedisCluster::FAILOVER_DISTRIBUTE => 'DISTRIBUTE',
|
||||
\RedisCluster::FAILOVER_DISTRIBUTE_SLAVES => 'DISTRIBUTE_SLAVES',
|
||||
];
|
||||
|
||||
public static function castRedis(\Redis $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
if (!$connected = $c->isConnected()) {
|
||||
return $a + [
|
||||
$prefix.'isConnected' => $connected,
|
||||
];
|
||||
}
|
||||
|
||||
$mode = $c->getMode();
|
||||
|
||||
return $a + [
|
||||
$prefix.'isConnected' => $connected,
|
||||
$prefix.'host' => $c->getHost(),
|
||||
$prefix.'port' => $c->getPort(),
|
||||
$prefix.'auth' => $c->getAuth(),
|
||||
$prefix.'mode' => isset(self::$mode[$mode]) ? new ConstStub(self::$mode[$mode], $mode) : $mode,
|
||||
$prefix.'dbNum' => $c->getDbNum(),
|
||||
$prefix.'timeout' => $c->getTimeout(),
|
||||
$prefix.'lastError' => $c->getLastError(),
|
||||
$prefix.'persistentId' => $c->getPersistentID(),
|
||||
$prefix.'options' => self::getRedisOptions($c),
|
||||
];
|
||||
}
|
||||
|
||||
public static function castRedisArray(\RedisArray $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
return $a + [
|
||||
$prefix.'hosts' => $c->_hosts(),
|
||||
$prefix.'function' => ClassStub::wrapCallable($c->_function()),
|
||||
$prefix.'lastError' => $c->getLastError(),
|
||||
$prefix.'options' => self::getRedisOptions($c),
|
||||
];
|
||||
}
|
||||
|
||||
public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$failover = $c->getOption(\RedisCluster::OPT_SLAVE_FAILOVER);
|
||||
|
||||
$a += [
|
||||
$prefix.'_masters' => $c->_masters(),
|
||||
$prefix.'_redir' => $c->_redir(),
|
||||
$prefix.'mode' => new ConstStub($c->getMode() ? 'MULTI' : 'ATOMIC', $c->getMode()),
|
||||
$prefix.'lastError' => $c->getLastError(),
|
||||
$prefix.'options' => self::getRedisOptions($c, [
|
||||
'SLAVE_FAILOVER' => isset(self::$failover[$failover]) ? new ConstStub(self::$failover[$failover], $failover) : $failover,
|
||||
]),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Redis|\RedisArray|\RedisCluster $redis
|
||||
*/
|
||||
private static function getRedisOptions($redis, array $options = []): EnumStub
|
||||
{
|
||||
$serializer = $redis->getOption(\Redis::OPT_SERIALIZER);
|
||||
if (\is_array($serializer)) {
|
||||
foreach ($serializer as &$v) {
|
||||
if (isset(self::$serializer[$v])) {
|
||||
$v = new ConstStub(self::$serializer[$v], $v);
|
||||
}
|
||||
}
|
||||
} elseif (isset(self::$serializer[$serializer])) {
|
||||
$serializer = new ConstStub(self::$serializer[$serializer], $serializer);
|
||||
}
|
||||
|
||||
$compression = \defined('Redis::OPT_COMPRESSION') ? $redis->getOption(\Redis::OPT_COMPRESSION) : 0;
|
||||
if (\is_array($compression)) {
|
||||
foreach ($compression as &$v) {
|
||||
if (isset(self::$compression[$v])) {
|
||||
$v = new ConstStub(self::$compression[$v], $v);
|
||||
}
|
||||
}
|
||||
} elseif (isset(self::$compression[$compression])) {
|
||||
$compression = new ConstStub(self::$compression[$compression], $compression);
|
||||
}
|
||||
|
||||
$retry = \defined('Redis::OPT_SCAN') ? $redis->getOption(\Redis::OPT_SCAN) : 0;
|
||||
if (\is_array($retry)) {
|
||||
foreach ($retry as &$v) {
|
||||
$v = new ConstStub($v ? 'RETRY' : 'NORETRY', $v);
|
||||
}
|
||||
} else {
|
||||
$retry = new ConstStub($retry ? 'RETRY' : 'NORETRY', $retry);
|
||||
}
|
||||
|
||||
$options += [
|
||||
'TCP_KEEPALIVE' => \defined('Redis::OPT_TCP_KEEPALIVE') ? $redis->getOption(\Redis::OPT_TCP_KEEPALIVE) : 0,
|
||||
'READ_TIMEOUT' => $redis->getOption(\Redis::OPT_READ_TIMEOUT),
|
||||
'COMPRESSION' => $compression,
|
||||
'SERIALIZER' => $serializer,
|
||||
'PREFIX' => $redis->getOption(\Redis::OPT_PREFIX),
|
||||
'SCAN' => $retry,
|
||||
];
|
||||
|
||||
return new EnumStub($options);
|
||||
}
|
||||
}
|
||||
@@ -1,384 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts Reflector related classes to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class ReflectionCaster
|
||||
{
|
||||
const UNSET_CLOSURE_FILE_INFO = ['Closure' => __CLASS__.'::unsetClosureFileInfo'];
|
||||
|
||||
private static $extraMap = [
|
||||
'docComment' => 'getDocComment',
|
||||
'extension' => 'getExtensionName',
|
||||
'isDisabled' => 'isDisabled',
|
||||
'isDeprecated' => 'isDeprecated',
|
||||
'isInternal' => 'isInternal',
|
||||
'isUserDefined' => 'isUserDefined',
|
||||
'isGenerator' => 'isGenerator',
|
||||
'isVariadic' => 'isVariadic',
|
||||
];
|
||||
|
||||
public static function castClosure(\Closure $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$c = new \ReflectionFunction($c);
|
||||
|
||||
$a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
|
||||
|
||||
if (false === strpos($c->name, '{closure}')) {
|
||||
$stub->class = isset($a[$prefix.'class']) ? $a[$prefix.'class']->value.'::'.$c->name : $c->name;
|
||||
unset($a[$prefix.'class']);
|
||||
}
|
||||
unset($a[$prefix.'extra']);
|
||||
|
||||
$stub->class .= self::getSignature($a);
|
||||
|
||||
if ($f = $c->getFileName()) {
|
||||
$stub->attr['file'] = $f;
|
||||
$stub->attr['line'] = $c->getStartLine();
|
||||
}
|
||||
|
||||
unset($a[$prefix.'parameters']);
|
||||
|
||||
if ($filter & Caster::EXCLUDE_VERBOSE) {
|
||||
$stub->cut += ($c->getFileName() ? 2 : 0) + \count($a);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
if ($f) {
|
||||
$a[$prefix.'file'] = new LinkStub($f, $c->getStartLine());
|
||||
$a[$prefix.'line'] = $c->getStartLine().' to '.$c->getEndLine();
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function unsetClosureFileInfo(\Closure $c, array $a)
|
||||
{
|
||||
unset($a[Caster::PREFIX_VIRTUAL.'file'], $a[Caster::PREFIX_VIRTUAL.'line']);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castGenerator(\Generator $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
// Cannot create ReflectionGenerator based on a terminated Generator
|
||||
try {
|
||||
$reflectionGenerator = new \ReflectionGenerator($c);
|
||||
} catch (\Exception $e) {
|
||||
$a[Caster::PREFIX_VIRTUAL.'closed'] = true;
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
return self::castReflectionGenerator($reflectionGenerator, $a, $stub, $isNested);
|
||||
}
|
||||
|
||||
public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a += [
|
||||
$prefix.'name' => $c->getName(),
|
||||
$prefix.'allowsNull' => $c->allowsNull(),
|
||||
$prefix.'isBuiltin' => $c->isBuiltin(),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castReflectionGenerator(\ReflectionGenerator $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
if ($c->getThis()) {
|
||||
$a[$prefix.'this'] = new CutStub($c->getThis());
|
||||
}
|
||||
$function = $c->getFunction();
|
||||
$frame = [
|
||||
'class' => isset($function->class) ? $function->class : null,
|
||||
'type' => isset($function->class) ? ($function->isStatic() ? '::' : '->') : null,
|
||||
'function' => $function->name,
|
||||
'file' => $c->getExecutingFile(),
|
||||
'line' => $c->getExecutingLine(),
|
||||
];
|
||||
if ($trace = $c->getTrace(DEBUG_BACKTRACE_IGNORE_ARGS)) {
|
||||
$function = new \ReflectionGenerator($c->getExecutingGenerator());
|
||||
array_unshift($trace, [
|
||||
'function' => 'yield',
|
||||
'file' => $function->getExecutingFile(),
|
||||
'line' => $function->getExecutingLine() - 1,
|
||||
]);
|
||||
$trace[] = $frame;
|
||||
$a[$prefix.'trace'] = new TraceStub($trace, false, 0, -1, -1);
|
||||
} else {
|
||||
$function = new FrameStub($frame, false, true);
|
||||
$function = ExceptionCaster::castFrameStub($function, [], $function, true);
|
||||
$a[$prefix.'executing'] = $function[$prefix.'src'];
|
||||
}
|
||||
|
||||
$a[Caster::PREFIX_VIRTUAL.'closed'] = false;
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castClass(\ReflectionClass $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
if ($n = \Reflection::getModifierNames($c->getModifiers())) {
|
||||
$a[$prefix.'modifiers'] = implode(' ', $n);
|
||||
}
|
||||
|
||||
self::addMap($a, $c, [
|
||||
'extends' => 'getParentClass',
|
||||
'implements' => 'getInterfaceNames',
|
||||
'constants' => 'getConstants',
|
||||
]);
|
||||
|
||||
foreach ($c->getProperties() as $n) {
|
||||
$a[$prefix.'properties'][$n->name] = $n;
|
||||
}
|
||||
|
||||
foreach ($c->getMethods() as $n) {
|
||||
$a[$prefix.'methods'][$n->name] = $n;
|
||||
}
|
||||
|
||||
if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) {
|
||||
self::addExtra($a, $c);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castFunctionAbstract(\ReflectionFunctionAbstract $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
self::addMap($a, $c, [
|
||||
'returnsReference' => 'returnsReference',
|
||||
'returnType' => 'getReturnType',
|
||||
'class' => 'getClosureScopeClass',
|
||||
'this' => 'getClosureThis',
|
||||
]);
|
||||
|
||||
if (isset($a[$prefix.'returnType'])) {
|
||||
$v = $a[$prefix.'returnType'];
|
||||
$v = $v->getName();
|
||||
$a[$prefix.'returnType'] = new ClassStub($a[$prefix.'returnType']->allowsNull() ? '?'.$v : $v, [class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '']);
|
||||
}
|
||||
if (isset($a[$prefix.'class'])) {
|
||||
$a[$prefix.'class'] = new ClassStub($a[$prefix.'class']);
|
||||
}
|
||||
if (isset($a[$prefix.'this'])) {
|
||||
$a[$prefix.'this'] = new CutStub($a[$prefix.'this']);
|
||||
}
|
||||
|
||||
foreach ($c->getParameters() as $v) {
|
||||
$k = '$'.$v->name;
|
||||
if ($v->isVariadic()) {
|
||||
$k = '...'.$k;
|
||||
}
|
||||
if ($v->isPassedByReference()) {
|
||||
$k = '&'.$k;
|
||||
}
|
||||
$a[$prefix.'parameters'][$k] = $v;
|
||||
}
|
||||
if (isset($a[$prefix.'parameters'])) {
|
||||
$a[$prefix.'parameters'] = new EnumStub($a[$prefix.'parameters']);
|
||||
}
|
||||
|
||||
if (!($filter & Caster::EXCLUDE_VERBOSE) && $v = $c->getStaticVariables()) {
|
||||
foreach ($v as $k => &$v) {
|
||||
if (\is_object($v)) {
|
||||
$a[$prefix.'use']['$'.$k] = new CutStub($v);
|
||||
} else {
|
||||
$a[$prefix.'use']['$'.$k] = &$v;
|
||||
}
|
||||
}
|
||||
unset($v);
|
||||
$a[$prefix.'use'] = new EnumStub($a[$prefix.'use']);
|
||||
}
|
||||
|
||||
if (!($filter & Caster::EXCLUDE_VERBOSE) && !$isNested) {
|
||||
self::addExtra($a, $c);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castMethod(\ReflectionMethod $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers()));
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castParameter(\ReflectionParameter $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
self::addMap($a, $c, [
|
||||
'position' => 'getPosition',
|
||||
'isVariadic' => 'isVariadic',
|
||||
'byReference' => 'isPassedByReference',
|
||||
'allowsNull' => 'allowsNull',
|
||||
]);
|
||||
|
||||
if ($v = $c->getType()) {
|
||||
$a[$prefix.'typeHint'] = $v->getName();
|
||||
}
|
||||
|
||||
if (isset($a[$prefix.'typeHint'])) {
|
||||
$v = $a[$prefix.'typeHint'];
|
||||
$a[$prefix.'typeHint'] = new ClassStub($v, [class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '']);
|
||||
} else {
|
||||
unset($a[$prefix.'allowsNull']);
|
||||
}
|
||||
|
||||
try {
|
||||
$a[$prefix.'default'] = $v = $c->getDefaultValue();
|
||||
if ($c->isDefaultValueConstant()) {
|
||||
$a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v);
|
||||
}
|
||||
if (null === $v) {
|
||||
unset($a[$prefix.'allowsNull']);
|
||||
}
|
||||
} catch (\ReflectionException $e) {
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castProperty(\ReflectionProperty $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a[Caster::PREFIX_VIRTUAL.'modifiers'] = implode(' ', \Reflection::getModifierNames($c->getModifiers()));
|
||||
self::addExtra($a, $c);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castReference(\ReflectionReference $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a[Caster::PREFIX_VIRTUAL.'id'] = $c->getId();
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castExtension(\ReflectionExtension $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
self::addMap($a, $c, [
|
||||
'version' => 'getVersion',
|
||||
'dependencies' => 'getDependencies',
|
||||
'iniEntries' => 'getIniEntries',
|
||||
'isPersistent' => 'isPersistent',
|
||||
'isTemporary' => 'isTemporary',
|
||||
'constants' => 'getConstants',
|
||||
'functions' => 'getFunctions',
|
||||
'classes' => 'getClasses',
|
||||
]);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castZendExtension(\ReflectionZendExtension $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
self::addMap($a, $c, [
|
||||
'version' => 'getVersion',
|
||||
'author' => 'getAuthor',
|
||||
'copyright' => 'getCopyright',
|
||||
'url' => 'getURL',
|
||||
]);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function getSignature(array $a)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$signature = '';
|
||||
|
||||
if (isset($a[$prefix.'parameters'])) {
|
||||
foreach ($a[$prefix.'parameters']->value as $k => $param) {
|
||||
$signature .= ', ';
|
||||
if ($type = $param->getType()) {
|
||||
if (!$param->isOptional() && $param->allowsNull()) {
|
||||
$signature .= '?';
|
||||
}
|
||||
$signature .= substr(strrchr('\\'.$type->getName(), '\\'), 1).' ';
|
||||
}
|
||||
$signature .= $k;
|
||||
|
||||
if (!$param->isDefaultValueAvailable()) {
|
||||
continue;
|
||||
}
|
||||
$v = $param->getDefaultValue();
|
||||
$signature .= ' = ';
|
||||
|
||||
if ($param->isDefaultValueConstant()) {
|
||||
$signature .= substr(strrchr('\\'.$param->getDefaultValueConstantName(), '\\'), 1);
|
||||
} elseif (null === $v) {
|
||||
$signature .= 'null';
|
||||
} elseif (\is_array($v)) {
|
||||
$signature .= $v ? '[…'.\count($v).']' : '[]';
|
||||
} elseif (\is_string($v)) {
|
||||
$signature .= 10 > \strlen($v) && false === strpos($v, '\\') ? "'{$v}'" : "'…".\strlen($v)."'";
|
||||
} elseif (\is_bool($v)) {
|
||||
$signature .= $v ? 'true' : 'false';
|
||||
} else {
|
||||
$signature .= $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
$signature = (empty($a[$prefix.'returnsReference']) ? '' : '&').'('.substr($signature, 2).')';
|
||||
|
||||
if (isset($a[$prefix.'returnType'])) {
|
||||
$signature .= ': '.substr(strrchr('\\'.$a[$prefix.'returnType'], '\\'), 1);
|
||||
}
|
||||
|
||||
return $signature;
|
||||
}
|
||||
|
||||
private static function addExtra(array &$a, \Reflector $c)
|
||||
{
|
||||
$x = isset($a[Caster::PREFIX_VIRTUAL.'extra']) ? $a[Caster::PREFIX_VIRTUAL.'extra']->value : [];
|
||||
|
||||
if (method_exists($c, 'getFileName') && $m = $c->getFileName()) {
|
||||
$x['file'] = new LinkStub($m, $c->getStartLine());
|
||||
$x['line'] = $c->getStartLine().' to '.$c->getEndLine();
|
||||
}
|
||||
|
||||
self::addMap($x, $c, self::$extraMap, '');
|
||||
|
||||
if ($x) {
|
||||
$a[Caster::PREFIX_VIRTUAL.'extra'] = new EnumStub($x);
|
||||
}
|
||||
}
|
||||
|
||||
private static function addMap(array &$a, \Reflector $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL)
|
||||
{
|
||||
foreach ($map as $k => $m) {
|
||||
if (method_exists($c, $m) && false !== ($m = $c->$m()) && null !== $m) {
|
||||
$a[$prefix.$k] = $m instanceof \Reflector ? $m->name : $m;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
100
vendor/symfony/var-dumper/Caster/ResourceCaster.php
vendored
100
vendor/symfony/var-dumper/Caster/ResourceCaster.php
vendored
@@ -1,100 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts common resource types to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class ResourceCaster
|
||||
{
|
||||
public static function castCurl($h, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
return curl_getinfo($h);
|
||||
}
|
||||
|
||||
public static function castDba($dba, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$list = dba_list();
|
||||
$a['file'] = $list[(int) $dba];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castProcess($process, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
return proc_get_status($process);
|
||||
}
|
||||
|
||||
public static function castStream($stream, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested);
|
||||
if (isset($a['uri'])) {
|
||||
$a['uri'] = new LinkStub($a['uri']);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castStreamContext($stream, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
return @stream_context_get_params($stream) ?: $a;
|
||||
}
|
||||
|
||||
public static function castGd($gd, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$a['size'] = imagesx($gd).'x'.imagesy($gd);
|
||||
$a['trueColor'] = imageistruecolor($gd);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castMysqlLink($h, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a['host'] = mysql_get_host_info($h);
|
||||
$a['protocol'] = mysql_get_proto_info($h);
|
||||
$a['server'] = mysql_get_server_info($h);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castOpensslX509($h, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$stub->cut = -1;
|
||||
$info = openssl_x509_parse($h, false);
|
||||
|
||||
$pin = openssl_pkey_get_public($h);
|
||||
$pin = openssl_pkey_get_details($pin)['key'];
|
||||
$pin = \array_slice(explode("\n", $pin), 1, -2);
|
||||
$pin = base64_decode(implode('', $pin));
|
||||
$pin = base64_encode(hash('sha256', $pin, true));
|
||||
|
||||
$a += [
|
||||
'subject' => new EnumStub(array_intersect_key($info['subject'], ['organizationName' => true, 'commonName' => true])),
|
||||
'issuer' => new EnumStub(array_intersect_key($info['issuer'], ['organizationName' => true, 'commonName' => true])),
|
||||
'expiry' => new ConstStub(date(\DateTime::ISO8601, $info['validTo_time_t']), $info['validTo_time_t']),
|
||||
'fingerprint' => new EnumStub([
|
||||
'md5' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'md5')), 2, ':', true)),
|
||||
'sha1' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha1')), 2, ':', true)),
|
||||
'sha256' => new ConstStub(wordwrap(strtoupper(openssl_x509_fingerprint($h, 'sha256')), 2, ':', true)),
|
||||
'pin-sha256' => new ConstStub($pin),
|
||||
]),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
228
vendor/symfony/var-dumper/Caster/SplCaster.php
vendored
228
vendor/symfony/var-dumper/Caster/SplCaster.php
vendored
@@ -1,228 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts SPL related classes to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class SplCaster
|
||||
{
|
||||
private static $splFileObjectFlags = [
|
||||
\SplFileObject::DROP_NEW_LINE => 'DROP_NEW_LINE',
|
||||
\SplFileObject::READ_AHEAD => 'READ_AHEAD',
|
||||
\SplFileObject::SKIP_EMPTY => 'SKIP_EMPTY',
|
||||
\SplFileObject::READ_CSV => 'READ_CSV',
|
||||
];
|
||||
|
||||
public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
return self::castSplArray($c, $a, $stub, $isNested);
|
||||
}
|
||||
|
||||
public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
return self::castSplArray($c, $a, $stub, $isNested);
|
||||
}
|
||||
|
||||
public static function castHeap(\Iterator $c, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castDoublyLinkedList(\SplDoublyLinkedList $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$mode = $c->getIteratorMode();
|
||||
$c->setIteratorMode(\SplDoublyLinkedList::IT_MODE_KEEP | $mode & ~\SplDoublyLinkedList::IT_MODE_DELETE);
|
||||
|
||||
$a += [
|
||||
$prefix.'mode' => new ConstStub((($mode & \SplDoublyLinkedList::IT_MODE_LIFO) ? 'IT_MODE_LIFO' : 'IT_MODE_FIFO').' | '.(($mode & \SplDoublyLinkedList::IT_MODE_DELETE) ? 'IT_MODE_DELETE' : 'IT_MODE_KEEP'), $mode),
|
||||
$prefix.'dllist' => iterator_to_array($c),
|
||||
];
|
||||
$c->setIteratorMode($mode);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
static $map = [
|
||||
'path' => 'getPath',
|
||||
'filename' => 'getFilename',
|
||||
'basename' => 'getBasename',
|
||||
'pathname' => 'getPathname',
|
||||
'extension' => 'getExtension',
|
||||
'realPath' => 'getRealPath',
|
||||
'aTime' => 'getATime',
|
||||
'mTime' => 'getMTime',
|
||||
'cTime' => 'getCTime',
|
||||
'inode' => 'getInode',
|
||||
'size' => 'getSize',
|
||||
'perms' => 'getPerms',
|
||||
'owner' => 'getOwner',
|
||||
'group' => 'getGroup',
|
||||
'type' => 'getType',
|
||||
'writable' => 'isWritable',
|
||||
'readable' => 'isReadable',
|
||||
'executable' => 'isExecutable',
|
||||
'file' => 'isFile',
|
||||
'dir' => 'isDir',
|
||||
'link' => 'isLink',
|
||||
'linkTarget' => 'getLinkTarget',
|
||||
];
|
||||
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
if (false === $c->getPathname()) {
|
||||
$a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state';
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
foreach ($map as $key => $accessor) {
|
||||
try {
|
||||
$a[$prefix.$key] = $c->$accessor();
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($a[$prefix.'realPath'])) {
|
||||
$a[$prefix.'realPath'] = new LinkStub($a[$prefix.'realPath']);
|
||||
}
|
||||
|
||||
if (isset($a[$prefix.'perms'])) {
|
||||
$a[$prefix.'perms'] = new ConstStub(sprintf('0%o', $a[$prefix.'perms']), $a[$prefix.'perms']);
|
||||
}
|
||||
|
||||
static $mapDate = ['aTime', 'mTime', 'cTime'];
|
||||
foreach ($mapDate as $key) {
|
||||
if (isset($a[$prefix.$key])) {
|
||||
$a[$prefix.$key] = new ConstStub(date('Y-m-d H:i:s', $a[$prefix.$key]), $a[$prefix.$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
static $map = [
|
||||
'csvControl' => 'getCsvControl',
|
||||
'flags' => 'getFlags',
|
||||
'maxLineLen' => 'getMaxLineLen',
|
||||
'fstat' => 'fstat',
|
||||
'eof' => 'eof',
|
||||
'key' => 'key',
|
||||
];
|
||||
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
foreach ($map as $key => $accessor) {
|
||||
try {
|
||||
$a[$prefix.$key] = $c->$accessor();
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($a[$prefix.'flags'])) {
|
||||
$flagsArray = [];
|
||||
foreach (self::$splFileObjectFlags as $value => $name) {
|
||||
if ($a[$prefix.'flags'] & $value) {
|
||||
$flagsArray[] = $name;
|
||||
}
|
||||
}
|
||||
$a[$prefix.'flags'] = new ConstStub(implode('|', $flagsArray), $a[$prefix.'flags']);
|
||||
}
|
||||
|
||||
if (isset($a[$prefix.'fstat'])) {
|
||||
$a[$prefix.'fstat'] = new CutArrayStub($a[$prefix.'fstat'], ['dev', 'ino', 'nlink', 'rdev', 'blksize', 'blocks']);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castFixedArray(\SplFixedArray $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'storage' => $c->toArray(),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$storage = [];
|
||||
unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967
|
||||
|
||||
$clone = clone $c;
|
||||
foreach ($clone as $obj) {
|
||||
$storage[] = [
|
||||
'object' => $obj,
|
||||
'info' => $clone->getInfo(),
|
||||
];
|
||||
}
|
||||
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'storage' => $storage,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castOuterIterator(\OuterIterator $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a[Caster::PREFIX_VIRTUAL.'innerIterator'] = $c->getInnerIterator();
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castWeakReference(\WeakReference $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a[Caster::PREFIX_VIRTUAL.'object'] = $c->get();
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function castSplArray($c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$class = $stub->class;
|
||||
$flags = $c->getFlags();
|
||||
|
||||
if (!($flags & \ArrayObject::STD_PROP_LIST)) {
|
||||
$c->setFlags(\ArrayObject::STD_PROP_LIST);
|
||||
$a = Caster::castObject($c, $class);
|
||||
$c->setFlags($flags);
|
||||
}
|
||||
$a += [
|
||||
$prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST),
|
||||
$prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS),
|
||||
];
|
||||
if ($c instanceof \ArrayObject) {
|
||||
$a[$prefix.'iteratorClass'] = new ClassStub($c->getIteratorClass());
|
||||
}
|
||||
$a[$prefix.'storage'] = $c->getArrayCopy();
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
84
vendor/symfony/var-dumper/Caster/StubCaster.php
vendored
84
vendor/symfony/var-dumper/Caster/StubCaster.php
vendored
@@ -1,84 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts a caster's Stub.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class StubCaster
|
||||
{
|
||||
public static function castStub(Stub $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
if ($isNested) {
|
||||
$stub->type = $c->type;
|
||||
$stub->class = $c->class;
|
||||
$stub->value = $c->value;
|
||||
$stub->handle = $c->handle;
|
||||
$stub->cut = $c->cut;
|
||||
$stub->attr = $c->attr;
|
||||
|
||||
if (Stub::TYPE_REF === $c->type && !$c->class && \is_string($c->value) && !preg_match('//u', $c->value)) {
|
||||
$stub->type = Stub::TYPE_STRING;
|
||||
$stub->class = Stub::STRING_BINARY;
|
||||
}
|
||||
|
||||
$a = [];
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castCutArray(CutArrayStub $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
return $isNested ? $c->preservedSubset : $a;
|
||||
}
|
||||
|
||||
public static function cutInternals($obj, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
if ($isNested) {
|
||||
$stub->cut += \count($a);
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castEnum(EnumStub $c, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
if ($isNested) {
|
||||
$stub->class = $c->dumpKeys ? '' : null;
|
||||
$stub->handle = 0;
|
||||
$stub->value = null;
|
||||
$stub->cut = $c->cut;
|
||||
$stub->attr = $c->attr;
|
||||
|
||||
$a = [];
|
||||
|
||||
if ($c->value) {
|
||||
foreach (array_keys($c->value) as $k) {
|
||||
$keys[] = !isset($k[0]) || "\0" !== $k[0] ? Caster::PREFIX_VIRTUAL.$k : $k;
|
||||
}
|
||||
// Preserve references with array_combine()
|
||||
$a = array_combine($keys, $c->value);
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* @final
|
||||
*/
|
||||
class SymfonyCaster
|
||||
{
|
||||
private static $requestGetters = [
|
||||
'pathInfo' => 'getPathInfo',
|
||||
'requestUri' => 'getRequestUri',
|
||||
'baseUrl' => 'getBaseUrl',
|
||||
'basePath' => 'getBasePath',
|
||||
'method' => 'getMethod',
|
||||
'format' => 'getRequestFormat',
|
||||
];
|
||||
|
||||
public static function castRequest(Request $request, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$clone = null;
|
||||
|
||||
foreach (self::$requestGetters as $prop => $getter) {
|
||||
$key = Caster::PREFIX_PROTECTED.$prop;
|
||||
if (\array_key_exists($key, $a) && null === $a[$key]) {
|
||||
if (null === $clone) {
|
||||
$clone = clone $request;
|
||||
}
|
||||
$a[Caster::PREFIX_VIRTUAL.$prop] = $clone->{$getter}();
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castHttpClient($client, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$multiKey = sprintf("\0%s\0multi", \get_class($client));
|
||||
if (isset($a[$multiKey])) {
|
||||
$a[$multiKey] = new CutStub($a[$multiKey]);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castHttpClientResponse($response, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$stub->cut += \count($a);
|
||||
$a = [];
|
||||
|
||||
foreach ($response->getInfo() as $k => $v) {
|
||||
$a[Caster::PREFIX_VIRTUAL.$k] = $v;
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
36
vendor/symfony/var-dumper/Caster/TraceStub.php
vendored
36
vendor/symfony/var-dumper/Caster/TraceStub.php
vendored
@@ -1,36 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Represents a backtrace as returned by debug_backtrace() or Exception->getTrace().
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class TraceStub extends Stub
|
||||
{
|
||||
public $keepArgs;
|
||||
public $sliceOffset;
|
||||
public $sliceLength;
|
||||
public $numberingOffset;
|
||||
|
||||
public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0)
|
||||
{
|
||||
$this->value = $trace;
|
||||
$this->keepArgs = $keepArgs;
|
||||
$this->sliceOffset = $sliceOffset;
|
||||
$this->sliceLength = $sliceLength;
|
||||
$this->numberingOffset = $numberingOffset;
|
||||
}
|
||||
}
|
||||
30
vendor/symfony/var-dumper/Caster/UuidCaster.php
vendored
30
vendor/symfony/var-dumper/Caster/UuidCaster.php
vendored
@@ -1,30 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Ramsey\Uuid\UuidInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||
*/
|
||||
final class UuidCaster
|
||||
{
|
||||
public static function castRamseyUuid(UuidInterface $c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'uuid' => (string) $c,
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts XmlReader class to array representation.
|
||||
*
|
||||
* @author Baptiste Clavié <clavie.b@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class XmlReaderCaster
|
||||
{
|
||||
private static $nodeTypes = [
|
||||
\XMLReader::NONE => 'NONE',
|
||||
\XMLReader::ELEMENT => 'ELEMENT',
|
||||
\XMLReader::ATTRIBUTE => 'ATTRIBUTE',
|
||||
\XMLReader::TEXT => 'TEXT',
|
||||
\XMLReader::CDATA => 'CDATA',
|
||||
\XMLReader::ENTITY_REF => 'ENTITY_REF',
|
||||
\XMLReader::ENTITY => 'ENTITY',
|
||||
\XMLReader::PI => 'PI (Processing Instruction)',
|
||||
\XMLReader::COMMENT => 'COMMENT',
|
||||
\XMLReader::DOC => 'DOC',
|
||||
\XMLReader::DOC_TYPE => 'DOC_TYPE',
|
||||
\XMLReader::DOC_FRAGMENT => 'DOC_FRAGMENT',
|
||||
\XMLReader::NOTATION => 'NOTATION',
|
||||
\XMLReader::WHITESPACE => 'WHITESPACE',
|
||||
\XMLReader::SIGNIFICANT_WHITESPACE => 'SIGNIFICANT_WHITESPACE',
|
||||
\XMLReader::END_ELEMENT => 'END_ELEMENT',
|
||||
\XMLReader::END_ENTITY => 'END_ENTITY',
|
||||
\XMLReader::XML_DECLARATION => 'XML_DECLARATION',
|
||||
];
|
||||
|
||||
public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$props = Caster::PREFIX_VIRTUAL.'parserProperties';
|
||||
$info = [
|
||||
'localName' => $reader->localName,
|
||||
'prefix' => $reader->prefix,
|
||||
'nodeType' => new ConstStub(self::$nodeTypes[$reader->nodeType], $reader->nodeType),
|
||||
'depth' => $reader->depth,
|
||||
'isDefault' => $reader->isDefault,
|
||||
'isEmptyElement' => \XMLReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement,
|
||||
'xmlLang' => $reader->xmlLang,
|
||||
'attributeCount' => $reader->attributeCount,
|
||||
'value' => $reader->value,
|
||||
'namespaceURI' => $reader->namespaceURI,
|
||||
'baseURI' => $reader->baseURI ? new LinkStub($reader->baseURI) : $reader->baseURI,
|
||||
$props => [
|
||||
'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD),
|
||||
'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS),
|
||||
'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE),
|
||||
'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES),
|
||||
],
|
||||
];
|
||||
|
||||
if ($info[$props] = Caster::filter($info[$props], Caster::EXCLUDE_EMPTY, [], $count)) {
|
||||
$info[$props] = new EnumStub($info[$props]);
|
||||
$info[$props]->cut = $count;
|
||||
}
|
||||
|
||||
$info = Caster::filter($info, Caster::EXCLUDE_EMPTY, [], $count);
|
||||
// +2 because hasValue and hasAttributes are always filtered
|
||||
$stub->cut += $count + 2;
|
||||
|
||||
return $a + $info;
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<?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\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts XML resources to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class XmlResourceCaster
|
||||
{
|
||||
private static $xmlErrors = [
|
||||
XML_ERROR_NONE => 'XML_ERROR_NONE',
|
||||
XML_ERROR_NO_MEMORY => 'XML_ERROR_NO_MEMORY',
|
||||
XML_ERROR_SYNTAX => 'XML_ERROR_SYNTAX',
|
||||
XML_ERROR_NO_ELEMENTS => 'XML_ERROR_NO_ELEMENTS',
|
||||
XML_ERROR_INVALID_TOKEN => 'XML_ERROR_INVALID_TOKEN',
|
||||
XML_ERROR_UNCLOSED_TOKEN => 'XML_ERROR_UNCLOSED_TOKEN',
|
||||
XML_ERROR_PARTIAL_CHAR => 'XML_ERROR_PARTIAL_CHAR',
|
||||
XML_ERROR_TAG_MISMATCH => 'XML_ERROR_TAG_MISMATCH',
|
||||
XML_ERROR_DUPLICATE_ATTRIBUTE => 'XML_ERROR_DUPLICATE_ATTRIBUTE',
|
||||
XML_ERROR_JUNK_AFTER_DOC_ELEMENT => 'XML_ERROR_JUNK_AFTER_DOC_ELEMENT',
|
||||
XML_ERROR_PARAM_ENTITY_REF => 'XML_ERROR_PARAM_ENTITY_REF',
|
||||
XML_ERROR_UNDEFINED_ENTITY => 'XML_ERROR_UNDEFINED_ENTITY',
|
||||
XML_ERROR_RECURSIVE_ENTITY_REF => 'XML_ERROR_RECURSIVE_ENTITY_REF',
|
||||
XML_ERROR_ASYNC_ENTITY => 'XML_ERROR_ASYNC_ENTITY',
|
||||
XML_ERROR_BAD_CHAR_REF => 'XML_ERROR_BAD_CHAR_REF',
|
||||
XML_ERROR_BINARY_ENTITY_REF => 'XML_ERROR_BINARY_ENTITY_REF',
|
||||
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF => 'XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF',
|
||||
XML_ERROR_MISPLACED_XML_PI => 'XML_ERROR_MISPLACED_XML_PI',
|
||||
XML_ERROR_UNKNOWN_ENCODING => 'XML_ERROR_UNKNOWN_ENCODING',
|
||||
XML_ERROR_INCORRECT_ENCODING => 'XML_ERROR_INCORRECT_ENCODING',
|
||||
XML_ERROR_UNCLOSED_CDATA_SECTION => 'XML_ERROR_UNCLOSED_CDATA_SECTION',
|
||||
XML_ERROR_EXTERNAL_ENTITY_HANDLING => 'XML_ERROR_EXTERNAL_ENTITY_HANDLING',
|
||||
];
|
||||
|
||||
public static function castXml($h, array $a, Stub $stub, bool $isNested)
|
||||
{
|
||||
$a['current_byte_index'] = xml_get_current_byte_index($h);
|
||||
$a['current_column_number'] = xml_get_current_column_number($h);
|
||||
$a['current_line_number'] = xml_get_current_line_number($h);
|
||||
$a['error_code'] = xml_get_error_code($h);
|
||||
|
||||
if (isset(self::$xmlErrors[$a['error_code']])) {
|
||||
$a['error_code'] = new ConstStub(self::$xmlErrors[$a['error_code']], $a['error_code']);
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
360
vendor/symfony/var-dumper/Cloner/AbstractCloner.php
vendored
360
vendor/symfony/var-dumper/Cloner/AbstractCloner.php
vendored
@@ -1,360 +0,0 @@
|
||||
<?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\VarDumper\Cloner;
|
||||
|
||||
use Symfony\Component\VarDumper\Caster\Caster;
|
||||
use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
|
||||
|
||||
/**
|
||||
* AbstractCloner implements a generic caster mechanism for objects and resources.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
abstract class AbstractCloner implements ClonerInterface
|
||||
{
|
||||
public static $defaultCasters = [
|
||||
'__PHP_Incomplete_Class' => ['Symfony\Component\VarDumper\Caster\Caster', 'castPhpIncompleteClass'],
|
||||
|
||||
'Symfony\Component\VarDumper\Caster\CutStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'],
|
||||
'Symfony\Component\VarDumper\Caster\CutArrayStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castCutArray'],
|
||||
'Symfony\Component\VarDumper\Caster\ConstStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castStub'],
|
||||
'Symfony\Component\VarDumper\Caster\EnumStub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'castEnum'],
|
||||
|
||||
'Closure' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClosure'],
|
||||
'Generator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castGenerator'],
|
||||
'ReflectionType' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castType'],
|
||||
'ReflectionGenerator' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReflectionGenerator'],
|
||||
'ReflectionClass' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castClass'],
|
||||
'ReflectionFunctionAbstract' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castFunctionAbstract'],
|
||||
'ReflectionMethod' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castMethod'],
|
||||
'ReflectionParameter' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castParameter'],
|
||||
'ReflectionProperty' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castProperty'],
|
||||
'ReflectionReference' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castReference'],
|
||||
'ReflectionExtension' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castExtension'],
|
||||
'ReflectionZendExtension' => ['Symfony\Component\VarDumper\Caster\ReflectionCaster', 'castZendExtension'],
|
||||
|
||||
'Doctrine\Common\Persistence\ObjectManager' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
'Doctrine\Common\Proxy\Proxy' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castCommonProxy'],
|
||||
'Doctrine\ORM\Proxy\Proxy' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castOrmProxy'],
|
||||
'Doctrine\ORM\PersistentCollection' => ['Symfony\Component\VarDumper\Caster\DoctrineCaster', 'castPersistentCollection'],
|
||||
'Doctrine\Persistence\ObjectManager' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
|
||||
'DOMException' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castException'],
|
||||
'DOMStringList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
|
||||
'DOMNameList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
|
||||
'DOMImplementation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castImplementation'],
|
||||
'DOMImplementationList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
|
||||
'DOMNode' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNode'],
|
||||
'DOMNameSpaceNode' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNameSpaceNode'],
|
||||
'DOMDocument' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocument'],
|
||||
'DOMNodeList' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
|
||||
'DOMNamedNodeMap' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLength'],
|
||||
'DOMCharacterData' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castCharacterData'],
|
||||
'DOMAttr' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castAttr'],
|
||||
'DOMElement' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castElement'],
|
||||
'DOMText' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castText'],
|
||||
'DOMTypeinfo' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castTypeinfo'],
|
||||
'DOMDomError' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDomError'],
|
||||
'DOMLocator' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castLocator'],
|
||||
'DOMDocumentType' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castDocumentType'],
|
||||
'DOMNotation' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castNotation'],
|
||||
'DOMEntity' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castEntity'],
|
||||
'DOMProcessingInstruction' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castProcessingInstruction'],
|
||||
'DOMXPath' => ['Symfony\Component\VarDumper\Caster\DOMCaster', 'castXPath'],
|
||||
|
||||
'XMLReader' => ['Symfony\Component\VarDumper\Caster\XmlReaderCaster', 'castXmlReader'],
|
||||
|
||||
'ErrorException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castErrorException'],
|
||||
'Exception' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castException'],
|
||||
'Error' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castError'],
|
||||
'Symfony\Component\DependencyInjection\ContainerInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
'Symfony\Component\EventDispatcher\EventDispatcherInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
'Symfony\Component\HttpClient\CurlHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'],
|
||||
'Symfony\Component\HttpClient\NativeHttpClient' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClient'],
|
||||
'Symfony\Component\HttpClient\Response\CurlResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'],
|
||||
'Symfony\Component\HttpClient\Response\NativeResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'],
|
||||
'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'],
|
||||
'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'],
|
||||
'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'],
|
||||
'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'],
|
||||
'Symfony\Component\VarDumper\Cloner\AbstractCloner' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
'Symfony\Component\ErrorHandler\Exception\SilencedErrorContext' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castSilencedErrorContext'],
|
||||
|
||||
'Imagine\Image\ImageInterface' => ['Symfony\Component\VarDumper\Caster\ImagineCaster', 'castImage'],
|
||||
|
||||
'Ramsey\Uuid\UuidInterface' => ['Symfony\Component\VarDumper\Caster\UuidCaster', 'castRamseyUuid'],
|
||||
|
||||
'ProxyManager\Proxy\ProxyInterface' => ['Symfony\Component\VarDumper\Caster\ProxyManagerCaster', 'castProxy'],
|
||||
'PHPUnit_Framework_MockObject_MockObject' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
'PHPUnit\Framework\MockObject\MockObject' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
'PHPUnit\Framework\MockObject\Stub' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
'Prophecy\Prophecy\ProphecySubjectInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
'Mockery\MockInterface' => ['Symfony\Component\VarDumper\Caster\StubCaster', 'cutInternals'],
|
||||
|
||||
'PDO' => ['Symfony\Component\VarDumper\Caster\PdoCaster', 'castPdo'],
|
||||
'PDOStatement' => ['Symfony\Component\VarDumper\Caster\PdoCaster', 'castPdoStatement'],
|
||||
|
||||
'AMQPConnection' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castConnection'],
|
||||
'AMQPChannel' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castChannel'],
|
||||
'AMQPQueue' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castQueue'],
|
||||
'AMQPExchange' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castExchange'],
|
||||
'AMQPEnvelope' => ['Symfony\Component\VarDumper\Caster\AmqpCaster', 'castEnvelope'],
|
||||
|
||||
'ArrayObject' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castArrayObject'],
|
||||
'ArrayIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castArrayIterator'],
|
||||
'SplDoublyLinkedList' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castDoublyLinkedList'],
|
||||
'SplFileInfo' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFileInfo'],
|
||||
'SplFileObject' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFileObject'],
|
||||
'SplFixedArray' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFixedArray'],
|
||||
'SplHeap' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'],
|
||||
'SplObjectStorage' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castObjectStorage'],
|
||||
'SplPriorityQueue' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'],
|
||||
'OuterIterator' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castOuterIterator'],
|
||||
'WeakReference' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castWeakReference'],
|
||||
|
||||
'Redis' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'],
|
||||
'RedisArray' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'],
|
||||
'RedisCluster' => ['Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisCluster'],
|
||||
|
||||
'DateTimeInterface' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castDateTime'],
|
||||
'DateInterval' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castInterval'],
|
||||
'DateTimeZone' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castTimeZone'],
|
||||
'DatePeriod' => ['Symfony\Component\VarDumper\Caster\DateCaster', 'castPeriod'],
|
||||
|
||||
'GMP' => ['Symfony\Component\VarDumper\Caster\GmpCaster', 'castGmp'],
|
||||
|
||||
'MessageFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castMessageFormatter'],
|
||||
'NumberFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castNumberFormatter'],
|
||||
'IntlTimeZone' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlTimeZone'],
|
||||
'IntlCalendar' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlCalendar'],
|
||||
'IntlDateFormatter' => ['Symfony\Component\VarDumper\Caster\IntlCaster', 'castIntlDateFormatter'],
|
||||
|
||||
'Memcached' => ['Symfony\Component\VarDumper\Caster\MemcachedCaster', 'castMemcached'],
|
||||
|
||||
'Ds\Collection' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castCollection'],
|
||||
'Ds\Map' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castMap'],
|
||||
'Ds\Pair' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPair'],
|
||||
'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'],
|
||||
|
||||
':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],
|
||||
':dba' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'],
|
||||
':dba persistent' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'],
|
||||
':gd' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castGd'],
|
||||
':mysql link' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castMysqlLink'],
|
||||
':pgsql large object' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLargeObject'],
|
||||
':pgsql link' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'],
|
||||
':pgsql link persistent' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castLink'],
|
||||
':pgsql result' => ['Symfony\Component\VarDumper\Caster\PgSqlCaster', 'castResult'],
|
||||
':process' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castProcess'],
|
||||
':stream' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStream'],
|
||||
':OpenSSL X.509' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castOpensslX509'],
|
||||
':persistent stream' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStream'],
|
||||
':stream-context' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castStreamContext'],
|
||||
':xml' => ['Symfony\Component\VarDumper\Caster\XmlResourceCaster', 'castXml'],
|
||||
];
|
||||
|
||||
protected $maxItems = 2500;
|
||||
protected $maxString = -1;
|
||||
protected $minDepth = 1;
|
||||
|
||||
private $casters = [];
|
||||
private $prevErrorHandler;
|
||||
private $classInfo = [];
|
||||
private $filter = 0;
|
||||
|
||||
/**
|
||||
* @param callable[]|null $casters A map of casters
|
||||
*
|
||||
* @see addCasters
|
||||
*/
|
||||
public function __construct(array $casters = null)
|
||||
{
|
||||
if (null === $casters) {
|
||||
$casters = static::$defaultCasters;
|
||||
}
|
||||
$this->addCasters($casters);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds casters for resources and objects.
|
||||
*
|
||||
* Maps resources or objects types to a callback.
|
||||
* Types are in the key, with a callable caster for value.
|
||||
* Resource types are to be prefixed with a `:`,
|
||||
* see e.g. static::$defaultCasters.
|
||||
*
|
||||
* @param callable[] $casters A map of casters
|
||||
*/
|
||||
public function addCasters(array $casters)
|
||||
{
|
||||
foreach ($casters as $type => $callback) {
|
||||
$this->casters[$type][] = $callback;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum number of items to clone past the minimum depth in nested structures.
|
||||
*/
|
||||
public function setMaxItems(int $maxItems)
|
||||
{
|
||||
$this->maxItems = $maxItems;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum cloned length for strings.
|
||||
*/
|
||||
public function setMaxString(int $maxString)
|
||||
{
|
||||
$this->maxString = $maxString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the minimum tree depth where we are guaranteed to clone all the items. After this
|
||||
* depth is reached, only setMaxItems items will be cloned.
|
||||
*/
|
||||
public function setMinDepth(int $minDepth)
|
||||
{
|
||||
$this->minDepth = $minDepth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clones a PHP variable.
|
||||
*
|
||||
* @param mixed $var Any PHP variable
|
||||
* @param int $filter A bit field of Caster::EXCLUDE_* constants
|
||||
*
|
||||
* @return Data The cloned variable represented by a Data object
|
||||
*/
|
||||
public function cloneVar($var, int $filter = 0)
|
||||
{
|
||||
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) {
|
||||
if (E_RECOVERABLE_ERROR === $type || E_USER_ERROR === $type) {
|
||||
// Cloner never dies
|
||||
throw new \ErrorException($msg, 0, $type, $file, $line);
|
||||
}
|
||||
|
||||
if ($this->prevErrorHandler) {
|
||||
return ($this->prevErrorHandler)($type, $msg, $file, $line, $context);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
$this->filter = $filter;
|
||||
|
||||
if ($gc = gc_enabled()) {
|
||||
gc_disable();
|
||||
}
|
||||
try {
|
||||
return new Data($this->doClone($var));
|
||||
} finally {
|
||||
if ($gc) {
|
||||
gc_enable();
|
||||
}
|
||||
restore_error_handler();
|
||||
$this->prevErrorHandler = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Effectively clones the PHP variable.
|
||||
*
|
||||
* @param mixed $var Any PHP variable
|
||||
*
|
||||
* @return array The cloned variable represented in an array
|
||||
*/
|
||||
abstract protected function doClone($var);
|
||||
|
||||
/**
|
||||
* Casts an object to an array representation.
|
||||
*
|
||||
* @param bool $isNested True if the object is nested in the dumped structure
|
||||
*
|
||||
* @return array The object casted as array
|
||||
*/
|
||||
protected function castObject(Stub $stub, bool $isNested)
|
||||
{
|
||||
$obj = $stub->value;
|
||||
$class = $stub->class;
|
||||
|
||||
if (isset($class[15]) && "\0" === $class[15] && 0 === strpos($class, "class@anonymous\x00")) {
|
||||
$stub->class = get_parent_class($class).'@anonymous';
|
||||
}
|
||||
if (isset($this->classInfo[$class])) {
|
||||
list($i, $parents, $hasDebugInfo, $fileInfo) = $this->classInfo[$class];
|
||||
} else {
|
||||
$i = 2;
|
||||
$parents = [$class];
|
||||
$hasDebugInfo = method_exists($class, '__debugInfo');
|
||||
|
||||
foreach (class_parents($class) as $p) {
|
||||
$parents[] = $p;
|
||||
++$i;
|
||||
}
|
||||
foreach (class_implements($class) as $p) {
|
||||
$parents[] = $p;
|
||||
++$i;
|
||||
}
|
||||
$parents[] = '*';
|
||||
|
||||
$r = new \ReflectionClass($class);
|
||||
$fileInfo = $r->isInternal() || $r->isSubclassOf(Stub::class) ? [] : [
|
||||
'file' => $r->getFileName(),
|
||||
'line' => $r->getStartLine(),
|
||||
];
|
||||
|
||||
$this->classInfo[$class] = [$i, $parents, $hasDebugInfo, $fileInfo];
|
||||
}
|
||||
|
||||
$stub->attr += $fileInfo;
|
||||
$a = Caster::castObject($obj, $class, $hasDebugInfo);
|
||||
|
||||
try {
|
||||
while ($i--) {
|
||||
if (!empty($this->casters[$p = $parents[$i]])) {
|
||||
foreach ($this->casters[$p] as $callback) {
|
||||
$a = $callback($obj, $a, $stub, $isNested, $this->filter);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠' => new ThrowingCasterException($e)] + $a;
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Casts a resource to an array representation.
|
||||
*
|
||||
* @param bool $isNested True if the object is nested in the dumped structure
|
||||
*
|
||||
* @return array The resource casted as array
|
||||
*/
|
||||
protected function castResource(Stub $stub, bool $isNested)
|
||||
{
|
||||
$a = [];
|
||||
$res = $stub->value;
|
||||
$type = $stub->class;
|
||||
|
||||
try {
|
||||
if (!empty($this->casters[':'.$type])) {
|
||||
foreach ($this->casters[':'.$type] as $callback) {
|
||||
$a = $callback($res, $a, $stub, $isNested, $this->filter);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$a = [(Stub::TYPE_OBJECT === $stub->type ? Caster::PREFIX_VIRTUAL : '').'⚠' => new ThrowingCasterException($e)] + $a;
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
<?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\VarDumper\Cloner;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
interface ClonerInterface
|
||||
{
|
||||
/**
|
||||
* Clones a PHP variable.
|
||||
*
|
||||
* @param mixed $var Any PHP variable
|
||||
*
|
||||
* @return Data The cloned variable represented by a Data object
|
||||
*/
|
||||
public function cloneVar($var);
|
||||
}
|
||||
43
vendor/symfony/var-dumper/Cloner/Cursor.php
vendored
43
vendor/symfony/var-dumper/Cloner/Cursor.php
vendored
@@ -1,43 +0,0 @@
|
||||
<?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\VarDumper\Cloner;
|
||||
|
||||
/**
|
||||
* Represents the current state of a dumper while dumping.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class Cursor
|
||||
{
|
||||
const HASH_INDEXED = Stub::ARRAY_INDEXED;
|
||||
const HASH_ASSOC = Stub::ARRAY_ASSOC;
|
||||
const HASH_OBJECT = Stub::TYPE_OBJECT;
|
||||
const HASH_RESOURCE = Stub::TYPE_RESOURCE;
|
||||
|
||||
public $depth = 0;
|
||||
public $refIndex = 0;
|
||||
public $softRefTo = 0;
|
||||
public $softRefCount = 0;
|
||||
public $softRefHandle = 0;
|
||||
public $hardRefTo = 0;
|
||||
public $hardRefCount = 0;
|
||||
public $hardRefHandle = 0;
|
||||
public $hashType;
|
||||
public $hashKey;
|
||||
public $hashKeyIsBinary;
|
||||
public $hashIndex = 0;
|
||||
public $hashLength = 0;
|
||||
public $hashCut = 0;
|
||||
public $stop = false;
|
||||
public $attr = [];
|
||||
public $skipChildren = false;
|
||||
}
|
||||
451
vendor/symfony/var-dumper/Cloner/Data.php
vendored
451
vendor/symfony/var-dumper/Cloner/Data.php
vendored
@@ -1,451 +0,0 @@
|
||||
<?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\VarDumper\Cloner;
|
||||
|
||||
use Symfony\Component\VarDumper\Caster\Caster;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
{
|
||||
private $data;
|
||||
private $position = 0;
|
||||
private $key = 0;
|
||||
private $maxDepth = 20;
|
||||
private $maxItemsPerDepth = -1;
|
||||
private $useRefHandles = -1;
|
||||
private $context = [];
|
||||
|
||||
/**
|
||||
* @param array $data An array as returned by ClonerInterface::cloneVar()
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string|null The type of the value
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
$item = $this->data[$this->position][$this->key];
|
||||
|
||||
if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
|
||||
$item = $item->value;
|
||||
}
|
||||
if (!$item instanceof Stub) {
|
||||
return \gettype($item);
|
||||
}
|
||||
if (Stub::TYPE_STRING === $item->type) {
|
||||
return 'string';
|
||||
}
|
||||
if (Stub::TYPE_ARRAY === $item->type) {
|
||||
return 'array';
|
||||
}
|
||||
if (Stub::TYPE_OBJECT === $item->type) {
|
||||
return $item->class;
|
||||
}
|
||||
if (Stub::TYPE_RESOURCE === $item->type) {
|
||||
return $item->class.' resource';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|bool $recursive Whether values should be resolved recursively or not
|
||||
*
|
||||
* @return string|int|float|bool|array|Data[]|null A native representation of the original value
|
||||
*/
|
||||
public function getValue($recursive = false)
|
||||
{
|
||||
$item = $this->data[$this->position][$this->key];
|
||||
|
||||
if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
|
||||
$item = $item->value;
|
||||
}
|
||||
if (!($item = $this->getStub($item)) instanceof Stub) {
|
||||
return $item;
|
||||
}
|
||||
if (Stub::TYPE_STRING === $item->type) {
|
||||
return $item->value;
|
||||
}
|
||||
|
||||
$children = $item->position ? $this->data[$item->position] : [];
|
||||
|
||||
foreach ($children as $k => $v) {
|
||||
if ($recursive && !($v = $this->getStub($v)) instanceof Stub) {
|
||||
continue;
|
||||
}
|
||||
$children[$k] = clone $this;
|
||||
$children[$k]->key = $k;
|
||||
$children[$k]->position = $item->position;
|
||||
|
||||
if ($recursive) {
|
||||
if (Stub::TYPE_REF === $v->type && ($v = $this->getStub($v->value)) instanceof Stub) {
|
||||
$recursive = (array) $recursive;
|
||||
if (isset($recursive[$v->position])) {
|
||||
continue;
|
||||
}
|
||||
$recursive[$v->position] = true;
|
||||
}
|
||||
$children[$k] = $children[$k]->getValue($recursive);
|
||||
}
|
||||
}
|
||||
|
||||
return $children;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function count()
|
||||
{
|
||||
return \count($this->getValue());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Traversable
|
||||
*/
|
||||
public function getIterator()
|
||||
{
|
||||
if (!\is_array($value = $this->getValue())) {
|
||||
throw new \LogicException(sprintf('"%s" object holds non-iterable type "%s".', self::class, \gettype($value)));
|
||||
}
|
||||
|
||||
yield from $value;
|
||||
}
|
||||
|
||||
public function __get(string $key)
|
||||
{
|
||||
if (null !== $data = $this->seek($key)) {
|
||||
$item = $this->getStub($data->data[$data->position][$data->key]);
|
||||
|
||||
return $item instanceof Stub || [] === $item ? $data : $item;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function __isset(string $key)
|
||||
{
|
||||
return null !== $this->seek($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function offsetExists($key)
|
||||
{
|
||||
return $this->__isset($key);
|
||||
}
|
||||
|
||||
public function offsetGet($key)
|
||||
{
|
||||
return $this->__get($key);
|
||||
}
|
||||
|
||||
public function offsetSet($key, $value)
|
||||
{
|
||||
throw new \BadMethodCallException(self::class.' objects are immutable.');
|
||||
}
|
||||
|
||||
public function offsetUnset($key)
|
||||
{
|
||||
throw new \BadMethodCallException(self::class.' objects are immutable.');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
$value = $this->getValue();
|
||||
|
||||
if (!\is_array($value)) {
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
return sprintf('%s (count=%d)', $this->getType(), \count($value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a depth limited clone of $this.
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withMaxDepth(int $maxDepth)
|
||||
{
|
||||
$data = clone $this;
|
||||
$data->maxDepth = (int) $maxDepth;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Limits the number of elements per depth level.
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withMaxItemsPerDepth(int $maxItemsPerDepth)
|
||||
{
|
||||
$data = clone $this;
|
||||
$data->maxItemsPerDepth = (int) $maxItemsPerDepth;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables objects' identifiers tracking.
|
||||
*
|
||||
* @param bool $useRefHandles False to hide global ref. handles
|
||||
*
|
||||
* @return static
|
||||
*/
|
||||
public function withRefHandles(bool $useRefHandles)
|
||||
{
|
||||
$data = clone $this;
|
||||
$data->useRefHandles = $useRefHandles ? -1 : 0;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return static
|
||||
*/
|
||||
public function withContext(array $context)
|
||||
{
|
||||
$data = clone $this;
|
||||
$data->context = $context;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Seeks to a specific key in nested data structures.
|
||||
*
|
||||
* @param string|int $key The key to seek to
|
||||
*
|
||||
* @return static|null Null if the key is not set
|
||||
*/
|
||||
public function seek($key)
|
||||
{
|
||||
$item = $this->data[$this->position][$this->key];
|
||||
|
||||
if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
|
||||
$item = $item->value;
|
||||
}
|
||||
if (!($item = $this->getStub($item)) instanceof Stub || !$item->position) {
|
||||
return null;
|
||||
}
|
||||
$keys = [$key];
|
||||
|
||||
switch ($item->type) {
|
||||
case Stub::TYPE_OBJECT:
|
||||
$keys[] = Caster::PREFIX_DYNAMIC.$key;
|
||||
$keys[] = Caster::PREFIX_PROTECTED.$key;
|
||||
$keys[] = Caster::PREFIX_VIRTUAL.$key;
|
||||
$keys[] = "\0$item->class\0$key";
|
||||
// no break
|
||||
case Stub::TYPE_ARRAY:
|
||||
case Stub::TYPE_RESOURCE:
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = null;
|
||||
$children = $this->data[$item->position];
|
||||
|
||||
foreach ($keys as $key) {
|
||||
if (isset($children[$key]) || \array_key_exists($key, $children)) {
|
||||
$data = clone $this;
|
||||
$data->key = $key;
|
||||
$data->position = $item->position;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps data with a DumperInterface dumper.
|
||||
*/
|
||||
public function dump(DumperInterface $dumper)
|
||||
{
|
||||
$refs = [0];
|
||||
$cursor = new Cursor();
|
||||
|
||||
if ($cursor->attr = $this->context[SourceContextProvider::class] ?? []) {
|
||||
$cursor->attr['if_links'] = true;
|
||||
$cursor->hashType = -1;
|
||||
$dumper->dumpScalar($cursor, 'default', '^');
|
||||
$cursor->attr = ['if_links' => true];
|
||||
$dumper->dumpScalar($cursor, 'default', ' ');
|
||||
$cursor->hashType = 0;
|
||||
}
|
||||
|
||||
$this->dumpItem($dumper, $cursor, $refs, $this->data[$this->position][$this->key]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Depth-first dumping of items.
|
||||
*
|
||||
* @param mixed $item A Stub object or the original value being dumped
|
||||
*/
|
||||
private function dumpItem(DumperInterface $dumper, Cursor $cursor, array &$refs, $item)
|
||||
{
|
||||
$cursor->refIndex = 0;
|
||||
$cursor->softRefTo = $cursor->softRefHandle = $cursor->softRefCount = 0;
|
||||
$cursor->hardRefTo = $cursor->hardRefHandle = $cursor->hardRefCount = 0;
|
||||
$firstSeen = true;
|
||||
|
||||
if (!$item instanceof Stub) {
|
||||
$cursor->attr = [];
|
||||
$type = \gettype($item);
|
||||
if ($item && 'array' === $type) {
|
||||
$item = $this->getStub($item);
|
||||
}
|
||||
} elseif (Stub::TYPE_REF === $item->type) {
|
||||
if ($item->handle) {
|
||||
if (!isset($refs[$r = $item->handle - (PHP_INT_MAX >> 1)])) {
|
||||
$cursor->refIndex = $refs[$r] = $cursor->refIndex ?: ++$refs[0];
|
||||
} else {
|
||||
$firstSeen = false;
|
||||
}
|
||||
$cursor->hardRefTo = $refs[$r];
|
||||
$cursor->hardRefHandle = $this->useRefHandles & $item->handle;
|
||||
$cursor->hardRefCount = $item->refCount;
|
||||
}
|
||||
$cursor->attr = $item->attr;
|
||||
$type = $item->class ?: \gettype($item->value);
|
||||
$item = $this->getStub($item->value);
|
||||
}
|
||||
if ($item instanceof Stub) {
|
||||
if ($item->refCount) {
|
||||
if (!isset($refs[$r = $item->handle])) {
|
||||
$cursor->refIndex = $refs[$r] = $cursor->refIndex ?: ++$refs[0];
|
||||
} else {
|
||||
$firstSeen = false;
|
||||
}
|
||||
$cursor->softRefTo = $refs[$r];
|
||||
}
|
||||
$cursor->softRefHandle = $this->useRefHandles & $item->handle;
|
||||
$cursor->softRefCount = $item->refCount;
|
||||
$cursor->attr = $item->attr;
|
||||
$cut = $item->cut;
|
||||
|
||||
if ($item->position && $firstSeen) {
|
||||
$children = $this->data[$item->position];
|
||||
|
||||
if ($cursor->stop) {
|
||||
if ($cut >= 0) {
|
||||
$cut += \count($children);
|
||||
}
|
||||
$children = [];
|
||||
}
|
||||
} else {
|
||||
$children = [];
|
||||
}
|
||||
switch ($item->type) {
|
||||
case Stub::TYPE_STRING:
|
||||
$dumper->dumpString($cursor, $item->value, Stub::STRING_BINARY === $item->class, $cut);
|
||||
break;
|
||||
|
||||
case Stub::TYPE_ARRAY:
|
||||
$item = clone $item;
|
||||
$item->type = $item->class;
|
||||
$item->class = $item->value;
|
||||
// no break
|
||||
case Stub::TYPE_OBJECT:
|
||||
case Stub::TYPE_RESOURCE:
|
||||
$withChildren = $children && $cursor->depth !== $this->maxDepth && $this->maxItemsPerDepth;
|
||||
$dumper->enterHash($cursor, $item->type, $item->class, $withChildren);
|
||||
if ($withChildren) {
|
||||
if ($cursor->skipChildren) {
|
||||
$withChildren = false;
|
||||
$cut = -1;
|
||||
} else {
|
||||
$cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class);
|
||||
}
|
||||
} elseif ($children && 0 <= $cut) {
|
||||
$cut += \count($children);
|
||||
}
|
||||
$cursor->skipChildren = false;
|
||||
$dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new \RuntimeException(sprintf('Unexpected Stub type: "%s".', $item->type));
|
||||
}
|
||||
} elseif ('array' === $type) {
|
||||
$dumper->enterHash($cursor, Cursor::HASH_INDEXED, 0, false);
|
||||
$dumper->leaveHash($cursor, Cursor::HASH_INDEXED, 0, false, 0);
|
||||
} elseif ('string' === $type) {
|
||||
$dumper->dumpString($cursor, $item, false, 0);
|
||||
} else {
|
||||
$dumper->dumpScalar($cursor, $type, $item);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps children of hash structures.
|
||||
*
|
||||
* @return int The final number of removed items
|
||||
*/
|
||||
private function dumpChildren(DumperInterface $dumper, Cursor $parentCursor, array &$refs, array $children, int $hashCut, int $hashType, bool $dumpKeys): int
|
||||
{
|
||||
$cursor = clone $parentCursor;
|
||||
++$cursor->depth;
|
||||
$cursor->hashType = $hashType;
|
||||
$cursor->hashIndex = 0;
|
||||
$cursor->hashLength = \count($children);
|
||||
$cursor->hashCut = $hashCut;
|
||||
foreach ($children as $key => $child) {
|
||||
$cursor->hashKeyIsBinary = isset($key[0]) && !preg_match('//u', $key);
|
||||
$cursor->hashKey = $dumpKeys ? $key : null;
|
||||
$this->dumpItem($dumper, $cursor, $refs, $child);
|
||||
if (++$cursor->hashIndex === $this->maxItemsPerDepth || $cursor->stop) {
|
||||
$parentCursor->stop = true;
|
||||
|
||||
return $hashCut >= 0 ? $hashCut + $cursor->hashLength - $cursor->hashIndex : $hashCut;
|
||||
}
|
||||
}
|
||||
|
||||
return $hashCut;
|
||||
}
|
||||
|
||||
private function getStub($item)
|
||||
{
|
||||
if (!$item || !\is_array($item)) {
|
||||
return $item;
|
||||
}
|
||||
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_ARRAY;
|
||||
foreach ($item as $stub->class => $stub->position) {
|
||||
}
|
||||
if (isset($item[0])) {
|
||||
$stub->cut = $item[0];
|
||||
}
|
||||
$stub->value = $stub->cut + ($stub->position ? \count($this->data[$stub->position]) : 0);
|
||||
|
||||
return $stub;
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<?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\VarDumper\Cloner;
|
||||
|
||||
/**
|
||||
* DumperInterface used by Data objects.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
interface DumperInterface
|
||||
{
|
||||
/**
|
||||
* Dumps a scalar value.
|
||||
*
|
||||
* @param string $type The PHP type of the value being dumped
|
||||
* @param string|int|float|bool $value The scalar value being dumped
|
||||
*/
|
||||
public function dumpScalar(Cursor $cursor, string $type, $value);
|
||||
|
||||
/**
|
||||
* Dumps a string.
|
||||
*
|
||||
* @param string $str The string being dumped
|
||||
* @param bool $bin Whether $str is UTF-8 or binary encoded
|
||||
* @param int $cut The number of characters $str has been cut by
|
||||
*/
|
||||
public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut);
|
||||
|
||||
/**
|
||||
* Dumps while entering an hash.
|
||||
*
|
||||
* @param int $type A Cursor::HASH_* const for the type of hash
|
||||
* @param string|int $class The object class, resource type or array count
|
||||
* @param bool $hasChild When the dump of the hash has child item
|
||||
*/
|
||||
public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild);
|
||||
|
||||
/**
|
||||
* Dumps while leaving an hash.
|
||||
*
|
||||
* @param int $type A Cursor::HASH_* const for the type of hash
|
||||
* @param string|int $class The object class, resource type or array count
|
||||
* @param bool $hasChild When the dump of the hash has child item
|
||||
* @param int $cut The number of items the hash has been cut by
|
||||
*/
|
||||
public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut);
|
||||
}
|
||||
67
vendor/symfony/var-dumper/Cloner/Stub.php
vendored
67
vendor/symfony/var-dumper/Cloner/Stub.php
vendored
@@ -1,67 +0,0 @@
|
||||
<?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\VarDumper\Cloner;
|
||||
|
||||
/**
|
||||
* Represents the main properties of a PHP variable.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class Stub
|
||||
{
|
||||
const TYPE_REF = 1;
|
||||
const TYPE_STRING = 2;
|
||||
const TYPE_ARRAY = 3;
|
||||
const TYPE_OBJECT = 4;
|
||||
const TYPE_RESOURCE = 5;
|
||||
|
||||
const STRING_BINARY = 1;
|
||||
const STRING_UTF8 = 2;
|
||||
|
||||
const ARRAY_ASSOC = 1;
|
||||
const ARRAY_INDEXED = 2;
|
||||
|
||||
public $type = self::TYPE_REF;
|
||||
public $class = '';
|
||||
public $value;
|
||||
public $cut = 0;
|
||||
public $handle = 0;
|
||||
public $refCount = 0;
|
||||
public $position = 0;
|
||||
public $attr = [];
|
||||
|
||||
private static $defaultProperties = [];
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function __sleep(): array
|
||||
{
|
||||
$properties = [];
|
||||
|
||||
if (!isset(self::$defaultProperties[$c = static::class])) {
|
||||
self::$defaultProperties[$c] = get_class_vars($c);
|
||||
|
||||
foreach ((new \ReflectionClass($c))->getStaticProperties() as $k => $v) {
|
||||
unset(self::$defaultProperties[$c][$k]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (self::$defaultProperties[$c] as $k => $v) {
|
||||
if ($this->$k !== $v) {
|
||||
$properties[] = $k;
|
||||
}
|
||||
}
|
||||
|
||||
return $properties;
|
||||
}
|
||||
}
|
||||
284
vendor/symfony/var-dumper/Cloner/VarCloner.php
vendored
284
vendor/symfony/var-dumper/Cloner/VarCloner.php
vendored
@@ -1,284 +0,0 @@
|
||||
<?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\VarDumper\Cloner;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class VarCloner extends AbstractCloner
|
||||
{
|
||||
private static $gid;
|
||||
private static $arrayCache = [];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doClone($var)
|
||||
{
|
||||
$len = 1; // Length of $queue
|
||||
$pos = 0; // Number of cloned items past the minimum depth
|
||||
$refsCounter = 0; // Hard references counter
|
||||
$queue = [[$var]]; // This breadth-first queue is the return value
|
||||
$hardRefs = []; // Map of original zval ids to stub objects
|
||||
$objRefs = []; // Map of original object handles to their stub object counterpart
|
||||
$objects = []; // Keep a ref to objects to ensure their handle cannot be reused while cloning
|
||||
$resRefs = []; // Map of original resource handles to their stub object counterpart
|
||||
$values = []; // Map of stub objects' ids to original values
|
||||
$maxItems = $this->maxItems;
|
||||
$maxString = $this->maxString;
|
||||
$minDepth = $this->minDepth;
|
||||
$currentDepth = 0; // Current tree depth
|
||||
$currentDepthFinalIndex = 0; // Final $queue index for current tree depth
|
||||
$minimumDepthReached = 0 === $minDepth; // Becomes true when minimum tree depth has been reached
|
||||
$cookie = (object) []; // Unique object used to detect hard references
|
||||
$a = null; // Array cast for nested structures
|
||||
$stub = null; // Stub capturing the main properties of an original item value
|
||||
// or null if the original value is used directly
|
||||
|
||||
if (!$gid = self::$gid) {
|
||||
$gid = self::$gid = md5(random_bytes(6)); // Unique string used to detect the special $GLOBALS variable
|
||||
}
|
||||
$arrayStub = new Stub();
|
||||
$arrayStub->type = Stub::TYPE_ARRAY;
|
||||
$fromObjCast = false;
|
||||
|
||||
for ($i = 0; $i < $len; ++$i) {
|
||||
// Detect when we move on to the next tree depth
|
||||
if ($i > $currentDepthFinalIndex) {
|
||||
++$currentDepth;
|
||||
$currentDepthFinalIndex = $len - 1;
|
||||
if ($currentDepth >= $minDepth) {
|
||||
$minimumDepthReached = true;
|
||||
}
|
||||
}
|
||||
|
||||
$refs = $vals = $queue[$i];
|
||||
foreach ($vals as $k => $v) {
|
||||
// $v is the original value or a stub object in case of hard references
|
||||
|
||||
if (\PHP_VERSION_ID >= 70400) {
|
||||
$zvalIsRef = null !== \ReflectionReference::fromArrayElement($vals, $k);
|
||||
} else {
|
||||
$refs[$k] = $cookie;
|
||||
$zvalIsRef = $vals[$k] === $cookie;
|
||||
}
|
||||
|
||||
if ($zvalIsRef) {
|
||||
$vals[$k] = &$stub; // Break hard references to make $queue completely
|
||||
unset($stub); // independent from the original structure
|
||||
if ($v instanceof Stub && isset($hardRefs[spl_object_id($v)])) {
|
||||
$vals[$k] = $refs[$k] = $v;
|
||||
if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) {
|
||||
++$v->value->refCount;
|
||||
}
|
||||
++$v->refCount;
|
||||
continue;
|
||||
}
|
||||
$refs[$k] = $vals[$k] = new Stub();
|
||||
$refs[$k]->value = $v;
|
||||
$h = spl_object_id($refs[$k]);
|
||||
$hardRefs[$h] = &$refs[$k];
|
||||
$values[$h] = $v;
|
||||
$vals[$k]->handle = ++$refsCounter;
|
||||
}
|
||||
// Create $stub when the original value $v can not be used directly
|
||||
// If $v is a nested structure, put that structure in array $a
|
||||
switch (true) {
|
||||
case null === $v:
|
||||
case \is_bool($v):
|
||||
case \is_int($v):
|
||||
case \is_float($v):
|
||||
continue 2;
|
||||
|
||||
case \is_string($v):
|
||||
if ('' === $v) {
|
||||
continue 2;
|
||||
}
|
||||
if (!preg_match('//u', $v)) {
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_STRING;
|
||||
$stub->class = Stub::STRING_BINARY;
|
||||
if (0 <= $maxString && 0 < $cut = \strlen($v) - $maxString) {
|
||||
$stub->cut = $cut;
|
||||
$stub->value = substr($v, 0, -$cut);
|
||||
} else {
|
||||
$stub->value = $v;
|
||||
}
|
||||
} elseif (0 <= $maxString && isset($v[1 + ($maxString >> 2)]) && 0 < $cut = mb_strlen($v, 'UTF-8') - $maxString) {
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_STRING;
|
||||
$stub->class = Stub::STRING_UTF8;
|
||||
$stub->cut = $cut;
|
||||
$stub->value = mb_substr($v, 0, $maxString, 'UTF-8');
|
||||
} else {
|
||||
continue 2;
|
||||
}
|
||||
$a = null;
|
||||
break;
|
||||
|
||||
case \is_array($v):
|
||||
if (!$v) {
|
||||
continue 2;
|
||||
}
|
||||
$stub = $arrayStub;
|
||||
$stub->class = Stub::ARRAY_INDEXED;
|
||||
|
||||
$j = -1;
|
||||
foreach ($v as $gk => $gv) {
|
||||
if ($gk !== ++$j) {
|
||||
$stub->class = Stub::ARRAY_ASSOC;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$a = $v;
|
||||
|
||||
if (Stub::ARRAY_ASSOC === $stub->class) {
|
||||
// Copies of $GLOBALS have very strange behavior,
|
||||
// let's detect them with some black magic
|
||||
$a[$gid] = true;
|
||||
|
||||
// Happens with copies of $GLOBALS
|
||||
if (isset($v[$gid])) {
|
||||
unset($v[$gid]);
|
||||
$a = [];
|
||||
foreach ($v as $gk => &$gv) {
|
||||
$a[$gk] = &$gv;
|
||||
}
|
||||
unset($gv);
|
||||
} else {
|
||||
$a = $v;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case \is_object($v):
|
||||
case $v instanceof \__PHP_Incomplete_Class:
|
||||
if (empty($objRefs[$h = spl_object_id($v)])) {
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_OBJECT;
|
||||
$stub->class = \get_class($v);
|
||||
$stub->value = $v;
|
||||
$stub->handle = $h;
|
||||
$a = $this->castObject($stub, 0 < $i);
|
||||
if ($v !== $stub->value) {
|
||||
if (Stub::TYPE_OBJECT !== $stub->type || null === $stub->value) {
|
||||
break;
|
||||
}
|
||||
$stub->handle = $h = spl_object_id($stub->value);
|
||||
}
|
||||
$stub->value = null;
|
||||
if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
|
||||
$stub->cut = \count($a);
|
||||
$a = null;
|
||||
}
|
||||
}
|
||||
if (empty($objRefs[$h])) {
|
||||
$objRefs[$h] = $stub;
|
||||
$objects[] = $v;
|
||||
} else {
|
||||
$stub = $objRefs[$h];
|
||||
++$stub->refCount;
|
||||
$a = null;
|
||||
}
|
||||
break;
|
||||
|
||||
default: // resource
|
||||
if (empty($resRefs[$h = (int) $v])) {
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_RESOURCE;
|
||||
if ('Unknown' === $stub->class = @get_resource_type($v)) {
|
||||
$stub->class = 'Closed';
|
||||
}
|
||||
$stub->value = $v;
|
||||
$stub->handle = $h;
|
||||
$a = $this->castResource($stub, 0 < $i);
|
||||
$stub->value = null;
|
||||
if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
|
||||
$stub->cut = \count($a);
|
||||
$a = null;
|
||||
}
|
||||
}
|
||||
if (empty($resRefs[$h])) {
|
||||
$resRefs[$h] = $stub;
|
||||
} else {
|
||||
$stub = $resRefs[$h];
|
||||
++$stub->refCount;
|
||||
$a = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($a) {
|
||||
if (!$minimumDepthReached || 0 > $maxItems) {
|
||||
$queue[$len] = $a;
|
||||
$stub->position = $len++;
|
||||
} elseif ($pos < $maxItems) {
|
||||
if ($maxItems < $pos += \count($a)) {
|
||||
$a = \array_slice($a, 0, $maxItems - $pos);
|
||||
if ($stub->cut >= 0) {
|
||||
$stub->cut += $pos - $maxItems;
|
||||
}
|
||||
}
|
||||
$queue[$len] = $a;
|
||||
$stub->position = $len++;
|
||||
} elseif ($stub->cut >= 0) {
|
||||
$stub->cut += \count($a);
|
||||
$stub->position = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($arrayStub === $stub) {
|
||||
if ($arrayStub->cut) {
|
||||
$stub = [$arrayStub->cut, $arrayStub->class => $arrayStub->position];
|
||||
$arrayStub->cut = 0;
|
||||
} elseif (isset(self::$arrayCache[$arrayStub->class][$arrayStub->position])) {
|
||||
$stub = self::$arrayCache[$arrayStub->class][$arrayStub->position];
|
||||
} else {
|
||||
self::$arrayCache[$arrayStub->class][$arrayStub->position] = $stub = [$arrayStub->class => $arrayStub->position];
|
||||
}
|
||||
}
|
||||
|
||||
if ($zvalIsRef) {
|
||||
$refs[$k]->value = $stub;
|
||||
} else {
|
||||
$vals[$k] = $stub;
|
||||
}
|
||||
}
|
||||
|
||||
if ($fromObjCast) {
|
||||
$fromObjCast = false;
|
||||
$refs = $vals;
|
||||
$vals = [];
|
||||
$j = -1;
|
||||
foreach ($queue[$i] as $k => $v) {
|
||||
foreach ([$k => true] as $gk => $gv) {
|
||||
}
|
||||
if ($gk !== $k) {
|
||||
$vals = (object) $vals;
|
||||
$vals->{$k} = $refs[++$j];
|
||||
$vals = (array) $vals;
|
||||
} else {
|
||||
$vals[$k] = $refs[++$j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$queue[$i] = $vals;
|
||||
}
|
||||
|
||||
foreach ($values as $h => $v) {
|
||||
$hardRefs[$h] = $v;
|
||||
}
|
||||
|
||||
return $queue;
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
<?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\VarDumper\Command\Descriptor;
|
||||
|
||||
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
|
||||
/**
|
||||
* Describe collected data clones for cli output.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class CliDescriptor implements DumpDescriptorInterface
|
||||
{
|
||||
private $dumper;
|
||||
private $lastIdentifier;
|
||||
private $supportsHref;
|
||||
|
||||
public function __construct(CliDumper $dumper)
|
||||
{
|
||||
$this->dumper = $dumper;
|
||||
$this->supportsHref = method_exists(OutputFormatterStyle::class, 'setHref');
|
||||
}
|
||||
|
||||
public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void
|
||||
{
|
||||
$io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput([]), $output);
|
||||
$this->dumper->setColors($output->isDecorated());
|
||||
|
||||
$rows = [['date', date('r', $context['timestamp'])]];
|
||||
$lastIdentifier = $this->lastIdentifier;
|
||||
$this->lastIdentifier = $clientId;
|
||||
|
||||
$section = "Received from client #$clientId";
|
||||
if (isset($context['request'])) {
|
||||
$request = $context['request'];
|
||||
$this->lastIdentifier = $request['identifier'];
|
||||
$section = sprintf('%s %s', $request['method'], $request['uri']);
|
||||
if ($controller = $request['controller']) {
|
||||
$rows[] = ['controller', rtrim($this->dumper->dump($controller, true), "\n")];
|
||||
}
|
||||
} elseif (isset($context['cli'])) {
|
||||
$this->lastIdentifier = $context['cli']['identifier'];
|
||||
$section = '$ '.$context['cli']['command_line'];
|
||||
}
|
||||
|
||||
if ($this->lastIdentifier !== $lastIdentifier) {
|
||||
$io->section($section);
|
||||
}
|
||||
|
||||
if (isset($context['source'])) {
|
||||
$source = $context['source'];
|
||||
$sourceInfo = sprintf('%s on line %d', $source['name'], $source['line']);
|
||||
$fileLink = $source['file_link'] ?? null;
|
||||
if ($this->supportsHref && $fileLink) {
|
||||
$sourceInfo = sprintf('<href=%s>%s</>', $fileLink, $sourceInfo);
|
||||
}
|
||||
$rows[] = ['source', $sourceInfo];
|
||||
$file = $source['file_relative'] ?? $source['file'];
|
||||
$rows[] = ['file', $file];
|
||||
}
|
||||
|
||||
$io->table([], $rows);
|
||||
|
||||
if (!$this->supportsHref && isset($fileLink)) {
|
||||
$io->writeln(['<info>Open source in your IDE/browser:</info>', $fileLink]);
|
||||
$io->newLine();
|
||||
}
|
||||
|
||||
$this->dumper->dump($data);
|
||||
$io->newLine();
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<?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\VarDumper\Command\Descriptor;
|
||||
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
|
||||
/**
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
interface DumpDescriptorInterface
|
||||
{
|
||||
public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void;
|
||||
}
|
||||
@@ -1,119 +0,0 @@
|
||||
<?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\VarDumper\Command\Descriptor;
|
||||
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
||||
|
||||
/**
|
||||
* Describe collected data clones for html output.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class HtmlDescriptor implements DumpDescriptorInterface
|
||||
{
|
||||
private $dumper;
|
||||
private $initialized = false;
|
||||
|
||||
public function __construct(HtmlDumper $dumper)
|
||||
{
|
||||
$this->dumper = $dumper;
|
||||
}
|
||||
|
||||
public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void
|
||||
{
|
||||
if (!$this->initialized) {
|
||||
$styles = file_get_contents(__DIR__.'/../../Resources/css/htmlDescriptor.css');
|
||||
$scripts = file_get_contents(__DIR__.'/../../Resources/js/htmlDescriptor.js');
|
||||
$output->writeln("<style>$styles</style><script>$scripts</script>");
|
||||
$this->initialized = true;
|
||||
}
|
||||
|
||||
$title = '-';
|
||||
if (isset($context['request'])) {
|
||||
$request = $context['request'];
|
||||
$controller = "<span class='dumped-tag'>{$this->dumper->dump($request['controller'], true, ['maxDepth' => 0])}</span>";
|
||||
$title = sprintf('<code>%s</code> <a href="%s">%s</a>', $request['method'], $uri = $request['uri'], $uri);
|
||||
$dedupIdentifier = $request['identifier'];
|
||||
} elseif (isset($context['cli'])) {
|
||||
$title = '<code>$ </code>'.$context['cli']['command_line'];
|
||||
$dedupIdentifier = $context['cli']['identifier'];
|
||||
} else {
|
||||
$dedupIdentifier = uniqid('', true);
|
||||
}
|
||||
|
||||
$sourceDescription = '';
|
||||
if (isset($context['source'])) {
|
||||
$source = $context['source'];
|
||||
$projectDir = $source['project_dir'] ?? null;
|
||||
$sourceDescription = sprintf('%s on line %d', $source['name'], $source['line']);
|
||||
if (isset($source['file_link'])) {
|
||||
$sourceDescription = sprintf('<a href="%s">%s</a>', $source['file_link'], $sourceDescription);
|
||||
}
|
||||
}
|
||||
|
||||
$isoDate = $this->extractDate($context, 'c');
|
||||
$tags = array_filter([
|
||||
'controller' => $controller ?? null,
|
||||
'project dir' => $projectDir ?? null,
|
||||
]);
|
||||
|
||||
$output->writeln(<<<HTML
|
||||
<article data-dedup-id="$dedupIdentifier">
|
||||
<header>
|
||||
<div class="row">
|
||||
<h2 class="col">$title</h2>
|
||||
<time class="col text-small" title="$isoDate" datetime="$isoDate">
|
||||
{$this->extractDate($context)}
|
||||
</time>
|
||||
</div>
|
||||
{$this->renderTags($tags)}
|
||||
</header>
|
||||
<section class="body">
|
||||
<p class="text-small">
|
||||
$sourceDescription
|
||||
</p>
|
||||
{$this->dumper->dump($data, true)}
|
||||
</section>
|
||||
</article>
|
||||
HTML
|
||||
);
|
||||
}
|
||||
|
||||
private function extractDate(array $context, string $format = 'r'): string
|
||||
{
|
||||
return date($format, $context['timestamp']);
|
||||
}
|
||||
|
||||
private function renderTags(array $tags): string
|
||||
{
|
||||
if (!$tags) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$renderedTags = '';
|
||||
foreach ($tags as $key => $value) {
|
||||
$renderedTags .= sprintf('<li><span class="badge">%s</span>%s</li>', $key, $value);
|
||||
}
|
||||
|
||||
return <<<HTML
|
||||
<div class="row">
|
||||
<ul class="tags">
|
||||
$renderedTags
|
||||
</ul>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
<?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\VarDumper\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor;
|
||||
use Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface;
|
||||
use Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
||||
use Symfony\Component\VarDumper\Server\DumpServer;
|
||||
|
||||
/**
|
||||
* Starts a dump server to collect and output dumps on a single place with multiple formats support.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class ServerDumpCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'server:dump';
|
||||
|
||||
private $server;
|
||||
|
||||
/** @var DumpDescriptorInterface[] */
|
||||
private $descriptors;
|
||||
|
||||
public function __construct(DumpServer $server, array $descriptors = [])
|
||||
{
|
||||
$this->server = $server;
|
||||
$this->descriptors = $descriptors + [
|
||||
'cli' => new CliDescriptor(new CliDumper()),
|
||||
'html' => new HtmlDescriptor(new HtmlDumper()),
|
||||
];
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$availableFormats = implode(', ', array_keys($this->descriptors));
|
||||
|
||||
$this
|
||||
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli')
|
||||
->setDescription('Starts a dump server that collects and displays dumps in a single place')
|
||||
->setHelp(<<<'EOF'
|
||||
<info>%command.name%</info> starts a dump server that collects and displays
|
||||
dumps in a single place for debugging you application:
|
||||
|
||||
<info>php %command.full_name%</info>
|
||||
|
||||
You can consult dumped data in HTML format in your browser by providing the <comment>--format=html</comment> option
|
||||
and redirecting the output to a file:
|
||||
|
||||
<info>php %command.full_name% --format="html" > dump.html</info>
|
||||
|
||||
EOF
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$format = $input->getOption('format');
|
||||
|
||||
if (!$descriptor = $this->descriptors[$format] ?? null) {
|
||||
throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $format));
|
||||
}
|
||||
|
||||
$errorIo = $io->getErrorStyle();
|
||||
$errorIo->title('Symfony Var Dumper Server');
|
||||
|
||||
$this->server->start();
|
||||
|
||||
$errorIo->success(sprintf('Server listening on %s', $this->server->getHost()));
|
||||
$errorIo->comment('Quit the server with CONTROL-C.');
|
||||
|
||||
$this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) {
|
||||
$descriptor->describe($io, $data, $context, $clientId);
|
||||
});
|
||||
}
|
||||
}
|
||||
204
vendor/symfony/var-dumper/Dumper/AbstractDumper.php
vendored
204
vendor/symfony/var-dumper/Dumper/AbstractDumper.php
vendored
@@ -1,204 +0,0 @@
|
||||
<?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\VarDumper\Dumper;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Cloner\DumperInterface;
|
||||
|
||||
/**
|
||||
* Abstract mechanism for dumping a Data object.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
||||
{
|
||||
const DUMP_LIGHT_ARRAY = 1;
|
||||
const DUMP_STRING_LENGTH = 2;
|
||||
const DUMP_COMMA_SEPARATOR = 4;
|
||||
const DUMP_TRAILING_COMMA = 8;
|
||||
|
||||
public static $defaultOutput = 'php://output';
|
||||
|
||||
protected $line = '';
|
||||
protected $lineDumper;
|
||||
protected $outputStream;
|
||||
protected $decimalPoint; // This is locale dependent
|
||||
protected $indentPad = ' ';
|
||||
protected $flags;
|
||||
|
||||
private $charset = '';
|
||||
|
||||
/**
|
||||
* @param callable|resource|string|null $output A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput
|
||||
* @param string|null $charset The default character encoding to use for non-UTF8 strings
|
||||
* @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation
|
||||
*/
|
||||
public function __construct($output = null, string $charset = null, int $flags = 0)
|
||||
{
|
||||
$this->flags = $flags;
|
||||
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
|
||||
$this->decimalPoint = localeconv();
|
||||
$this->decimalPoint = $this->decimalPoint['decimal_point'];
|
||||
$this->setOutput($output ?: static::$defaultOutput);
|
||||
if (!$output && \is_string(static::$defaultOutput)) {
|
||||
static::$defaultOutput = $this->outputStream;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the output destination of the dumps.
|
||||
*
|
||||
* @param callable|resource|string $output A line dumper callable, an opened stream or an output path
|
||||
*
|
||||
* @return callable|resource|string The previous output destination
|
||||
*/
|
||||
public function setOutput($output)
|
||||
{
|
||||
$prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
|
||||
|
||||
if (\is_callable($output)) {
|
||||
$this->outputStream = null;
|
||||
$this->lineDumper = $output;
|
||||
} else {
|
||||
if (\is_string($output)) {
|
||||
$output = fopen($output, 'wb');
|
||||
}
|
||||
$this->outputStream = $output;
|
||||
$this->lineDumper = [$this, 'echoLine'];
|
||||
}
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default character encoding to use for non-UTF8 strings.
|
||||
*
|
||||
* @return string The previous charset
|
||||
*/
|
||||
public function setCharset(string $charset)
|
||||
{
|
||||
$prev = $this->charset;
|
||||
|
||||
$charset = strtoupper($charset);
|
||||
$charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;
|
||||
|
||||
$this->charset = $charset;
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the indentation pad string.
|
||||
*
|
||||
* @param string $pad A string that will be prepended to dumped lines, repeated by nesting level
|
||||
*
|
||||
* @return string The previous indent pad
|
||||
*/
|
||||
public function setIndentPad(string $pad)
|
||||
{
|
||||
$prev = $this->indentPad;
|
||||
$this->indentPad = $pad;
|
||||
|
||||
return $prev;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps a Data object.
|
||||
*
|
||||
* @param callable|resource|string|true|null $output A line dumper callable, an opened stream, an output path or true to return the dump
|
||||
*
|
||||
* @return string|null The dump as string when $output is true
|
||||
*/
|
||||
public function dump(Data $data, $output = null)
|
||||
{
|
||||
$this->decimalPoint = localeconv();
|
||||
$this->decimalPoint = $this->decimalPoint['decimal_point'];
|
||||
|
||||
if ($locale = $this->flags & (self::DUMP_COMMA_SEPARATOR | self::DUMP_TRAILING_COMMA) ? setlocale(LC_NUMERIC, 0) : null) {
|
||||
setlocale(LC_NUMERIC, 'C');
|
||||
}
|
||||
|
||||
if ($returnDump = true === $output) {
|
||||
$output = fopen('php://memory', 'r+b');
|
||||
}
|
||||
if ($output) {
|
||||
$prevOutput = $this->setOutput($output);
|
||||
}
|
||||
try {
|
||||
$data->dump($this);
|
||||
$this->dumpLine(-1);
|
||||
|
||||
if ($returnDump) {
|
||||
$result = stream_get_contents($output, -1, 0);
|
||||
fclose($output);
|
||||
|
||||
return $result;
|
||||
}
|
||||
} finally {
|
||||
if ($output) {
|
||||
$this->setOutput($prevOutput);
|
||||
}
|
||||
if ($locale) {
|
||||
setlocale(LC_NUMERIC, $locale);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps the current line.
|
||||
*
|
||||
* @param int $depth The recursive depth in the dumped structure for the line being dumped,
|
||||
* or -1 to signal the end-of-dump to the line dumper callable
|
||||
*/
|
||||
protected function dumpLine(int $depth)
|
||||
{
|
||||
($this->lineDumper)($this->line, $depth, $this->indentPad);
|
||||
$this->line = '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic line dumper callback.
|
||||
*/
|
||||
protected function echoLine(string $line, int $depth, string $indentPad)
|
||||
{
|
||||
if (-1 !== $depth) {
|
||||
fwrite($this->outputStream, str_repeat($indentPad, $depth).$line."\n");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a non-UTF-8 string to UTF-8.
|
||||
*
|
||||
* @return string|null The string converted to UTF-8
|
||||
*/
|
||||
protected function utf8Encode(?string $s)
|
||||
{
|
||||
if (null === $s || preg_match('//u', $s)) {
|
||||
return $s;
|
||||
}
|
||||
|
||||
if (!\function_exists('iconv')) {
|
||||
throw new \RuntimeException('Unable to convert a non-UTF-8 string to UTF-8: required function iconv() does not exist. You should install ext-iconv or symfony/polyfill-iconv.');
|
||||
}
|
||||
|
||||
if (false !== $c = @iconv($this->charset, 'UTF-8', $s)) {
|
||||
return $c;
|
||||
}
|
||||
if ('CP1252' !== $this->charset && false !== $c = @iconv('CP1252', 'UTF-8', $s)) {
|
||||
return $c;
|
||||
}
|
||||
|
||||
return iconv('CP850', 'UTF-8', $s);
|
||||
}
|
||||
}
|
||||
636
vendor/symfony/var-dumper/Dumper/CliDumper.php
vendored
636
vendor/symfony/var-dumper/Dumper/CliDumper.php
vendored
@@ -1,636 +0,0 @@
|
||||
<?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\VarDumper\Dumper;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Cursor;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* CliDumper dumps variables for command line output.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class CliDumper extends AbstractDumper
|
||||
{
|
||||
public static $defaultColors;
|
||||
public static $defaultOutput = 'php://stdout';
|
||||
|
||||
protected $colors;
|
||||
protected $maxStringWidth = 0;
|
||||
protected $styles = [
|
||||
// See http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
|
||||
'default' => '0;38;5;208',
|
||||
'num' => '1;38;5;38',
|
||||
'const' => '1;38;5;208',
|
||||
'str' => '1;38;5;113',
|
||||
'note' => '38;5;38',
|
||||
'ref' => '38;5;247',
|
||||
'public' => '',
|
||||
'protected' => '',
|
||||
'private' => '',
|
||||
'meta' => '38;5;170',
|
||||
'key' => '38;5;113',
|
||||
'index' => '38;5;38',
|
||||
];
|
||||
|
||||
protected static $controlCharsRx = '/[\x00-\x1F\x7F]+/';
|
||||
protected static $controlCharsMap = [
|
||||
"\t" => '\t',
|
||||
"\n" => '\n',
|
||||
"\v" => '\v',
|
||||
"\f" => '\f',
|
||||
"\r" => '\r',
|
||||
"\033" => '\e',
|
||||
];
|
||||
|
||||
protected $collapseNextHash = false;
|
||||
protected $expandNextHash = false;
|
||||
|
||||
private $displayOptions = [
|
||||
'fileLinkFormat' => null,
|
||||
];
|
||||
|
||||
private $handlesHrefGracefully;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct($output = null, string $charset = null, int $flags = 0)
|
||||
{
|
||||
parent::__construct($output, $charset, $flags);
|
||||
|
||||
if ('\\' === \DIRECTORY_SEPARATOR && !$this->isWindowsTrueColor()) {
|
||||
// Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI
|
||||
$this->setStyles([
|
||||
'default' => '31',
|
||||
'num' => '1;34',
|
||||
'const' => '1;31',
|
||||
'str' => '1;32',
|
||||
'note' => '34',
|
||||
'ref' => '1;30',
|
||||
'meta' => '35',
|
||||
'key' => '32',
|
||||
'index' => '34',
|
||||
]);
|
||||
}
|
||||
|
||||
$this->displayOptions['fileLinkFormat'] = ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: 'file://%f#L%l';
|
||||
}
|
||||
|
||||
/**
|
||||
* Enables/disables colored output.
|
||||
*/
|
||||
public function setColors(bool $colors)
|
||||
{
|
||||
$this->colors = $colors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum number of characters per line for dumped strings.
|
||||
*/
|
||||
public function setMaxStringWidth(int $maxStringWidth)
|
||||
{
|
||||
$this->maxStringWidth = $maxStringWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures styles.
|
||||
*
|
||||
* @param array $styles A map of style names to style definitions
|
||||
*/
|
||||
public function setStyles(array $styles)
|
||||
{
|
||||
$this->styles = $styles + $this->styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configures display options.
|
||||
*
|
||||
* @param array $displayOptions A map of display options to customize the behavior
|
||||
*/
|
||||
public function setDisplayOptions(array $displayOptions)
|
||||
{
|
||||
$this->displayOptions = $displayOptions + $this->displayOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function dumpScalar(Cursor $cursor, string $type, $value)
|
||||
{
|
||||
$this->dumpKey($cursor);
|
||||
|
||||
$style = 'const';
|
||||
$attr = $cursor->attr;
|
||||
|
||||
switch ($type) {
|
||||
case 'default':
|
||||
$style = 'default';
|
||||
break;
|
||||
|
||||
case 'integer':
|
||||
$style = 'num';
|
||||
break;
|
||||
|
||||
case 'double':
|
||||
$style = 'num';
|
||||
|
||||
switch (true) {
|
||||
case INF === $value: $value = 'INF'; break;
|
||||
case -INF === $value: $value = '-INF'; break;
|
||||
case is_nan($value): $value = 'NAN'; break;
|
||||
default:
|
||||
$value = (string) $value;
|
||||
if (false === strpos($value, $this->decimalPoint)) {
|
||||
$value .= $this->decimalPoint.'0';
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'NULL':
|
||||
$value = 'null';
|
||||
break;
|
||||
|
||||
case 'boolean':
|
||||
$value = $value ? 'true' : 'false';
|
||||
break;
|
||||
|
||||
default:
|
||||
$attr += ['value' => $this->utf8Encode($value)];
|
||||
$value = $this->utf8Encode($type);
|
||||
break;
|
||||
}
|
||||
|
||||
$this->line .= $this->style($style, $value, $attr);
|
||||
|
||||
$this->endValue($cursor);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function dumpString(Cursor $cursor, string $str, bool $bin, int $cut)
|
||||
{
|
||||
$this->dumpKey($cursor);
|
||||
$attr = $cursor->attr;
|
||||
|
||||
if ($bin) {
|
||||
$str = $this->utf8Encode($str);
|
||||
}
|
||||
if ('' === $str) {
|
||||
$this->line .= '""';
|
||||
$this->endValue($cursor);
|
||||
} else {
|
||||
$attr += [
|
||||
'length' => 0 <= $cut ? mb_strlen($str, 'UTF-8') + $cut : 0,
|
||||
'binary' => $bin,
|
||||
];
|
||||
$str = explode("\n", $str);
|
||||
if (isset($str[1]) && !isset($str[2]) && !isset($str[1][0])) {
|
||||
unset($str[1]);
|
||||
$str[0] .= "\n";
|
||||
}
|
||||
$m = \count($str) - 1;
|
||||
$i = $lineCut = 0;
|
||||
|
||||
if (self::DUMP_STRING_LENGTH & $this->flags) {
|
||||
$this->line .= '('.$attr['length'].') ';
|
||||
}
|
||||
if ($bin) {
|
||||
$this->line .= 'b';
|
||||
}
|
||||
|
||||
if ($m) {
|
||||
$this->line .= '"""';
|
||||
$this->dumpLine($cursor->depth);
|
||||
} else {
|
||||
$this->line .= '"';
|
||||
}
|
||||
|
||||
foreach ($str as $str) {
|
||||
if ($i < $m) {
|
||||
$str .= "\n";
|
||||
}
|
||||
if (0 < $this->maxStringWidth && $this->maxStringWidth < $len = mb_strlen($str, 'UTF-8')) {
|
||||
$str = mb_substr($str, 0, $this->maxStringWidth, 'UTF-8');
|
||||
$lineCut = $len - $this->maxStringWidth;
|
||||
}
|
||||
if ($m && 0 < $cursor->depth) {
|
||||
$this->line .= $this->indentPad;
|
||||
}
|
||||
if ('' !== $str) {
|
||||
$this->line .= $this->style('str', $str, $attr);
|
||||
}
|
||||
if ($i++ == $m) {
|
||||
if ($m) {
|
||||
if ('' !== $str) {
|
||||
$this->dumpLine($cursor->depth);
|
||||
if (0 < $cursor->depth) {
|
||||
$this->line .= $this->indentPad;
|
||||
}
|
||||
}
|
||||
$this->line .= '"""';
|
||||
} else {
|
||||
$this->line .= '"';
|
||||
}
|
||||
if ($cut < 0) {
|
||||
$this->line .= '…';
|
||||
$lineCut = 0;
|
||||
} elseif ($cut) {
|
||||
$lineCut += $cut;
|
||||
}
|
||||
}
|
||||
if ($lineCut) {
|
||||
$this->line .= '…'.$lineCut;
|
||||
$lineCut = 0;
|
||||
}
|
||||
|
||||
if ($i > $m) {
|
||||
$this->endValue($cursor);
|
||||
} else {
|
||||
$this->dumpLine($cursor->depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function enterHash(Cursor $cursor, int $type, $class, bool $hasChild)
|
||||
{
|
||||
$this->dumpKey($cursor);
|
||||
$attr = $cursor->attr;
|
||||
|
||||
if ($this->collapseNextHash) {
|
||||
$cursor->skipChildren = true;
|
||||
$this->collapseNextHash = $hasChild = false;
|
||||
}
|
||||
|
||||
$class = $this->utf8Encode($class);
|
||||
if (Cursor::HASH_OBJECT === $type) {
|
||||
$prefix = $class && 'stdClass' !== $class ? $this->style('note', $class, $attr).(empty($attr['cut_hash']) ? ' {' : '') : '{';
|
||||
} elseif (Cursor::HASH_RESOURCE === $type) {
|
||||
$prefix = $this->style('note', $class.' resource', $attr).($hasChild ? ' {' : ' ');
|
||||
} else {
|
||||
$prefix = $class && !(self::DUMP_LIGHT_ARRAY & $this->flags) ? $this->style('note', 'array:'.$class, $attr).' [' : '[';
|
||||
}
|
||||
|
||||
if (($cursor->softRefCount || 0 < $cursor->softRefHandle) && empty($attr['cut_hash'])) {
|
||||
$prefix .= $this->style('ref', (Cursor::HASH_RESOURCE === $type ? '@' : '#').(0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->softRefTo), ['count' => $cursor->softRefCount]);
|
||||
} elseif ($cursor->hardRefTo && !$cursor->refIndex && $class) {
|
||||
$prefix .= $this->style('ref', '&'.$cursor->hardRefTo, ['count' => $cursor->hardRefCount]);
|
||||
} elseif (!$hasChild && Cursor::HASH_RESOURCE === $type) {
|
||||
$prefix = substr($prefix, 0, -1);
|
||||
}
|
||||
|
||||
$this->line .= $prefix;
|
||||
|
||||
if ($hasChild) {
|
||||
$this->dumpLine($cursor->depth);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int $cut)
|
||||
{
|
||||
if (empty($cursor->attr['cut_hash'])) {
|
||||
$this->dumpEllipsis($cursor, $hasChild, $cut);
|
||||
$this->line .= Cursor::HASH_OBJECT === $type ? '}' : (Cursor::HASH_RESOURCE !== $type ? ']' : ($hasChild ? '}' : ''));
|
||||
}
|
||||
|
||||
$this->endValue($cursor);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps an ellipsis for cut children.
|
||||
*
|
||||
* @param bool $hasChild When the dump of the hash has child item
|
||||
* @param int $cut The number of items the hash has been cut by
|
||||
*/
|
||||
protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut)
|
||||
{
|
||||
if ($cut) {
|
||||
$this->line .= ' …';
|
||||
if (0 < $cut) {
|
||||
$this->line .= $cut;
|
||||
}
|
||||
if ($hasChild) {
|
||||
$this->dumpLine($cursor->depth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps a key in a hash structure.
|
||||
*/
|
||||
protected function dumpKey(Cursor $cursor)
|
||||
{
|
||||
if (null !== $key = $cursor->hashKey) {
|
||||
if ($cursor->hashKeyIsBinary) {
|
||||
$key = $this->utf8Encode($key);
|
||||
}
|
||||
$attr = ['binary' => $cursor->hashKeyIsBinary];
|
||||
$bin = $cursor->hashKeyIsBinary ? 'b' : '';
|
||||
$style = 'key';
|
||||
switch ($cursor->hashType) {
|
||||
default:
|
||||
case Cursor::HASH_INDEXED:
|
||||
if (self::DUMP_LIGHT_ARRAY & $this->flags) {
|
||||
break;
|
||||
}
|
||||
$style = 'index';
|
||||
// no break
|
||||
case Cursor::HASH_ASSOC:
|
||||
if (\is_int($key)) {
|
||||
$this->line .= $this->style($style, $key).' => ';
|
||||
} else {
|
||||
$this->line .= $bin.'"'.$this->style($style, $key).'" => ';
|
||||
}
|
||||
break;
|
||||
|
||||
case Cursor::HASH_RESOURCE:
|
||||
$key = "\0~\0".$key;
|
||||
// no break
|
||||
case Cursor::HASH_OBJECT:
|
||||
if (!isset($key[0]) || "\0" !== $key[0]) {
|
||||
$this->line .= '+'.$bin.$this->style('public', $key).': ';
|
||||
} elseif (0 < strpos($key, "\0", 1)) {
|
||||
$key = explode("\0", substr($key, 1), 2);
|
||||
|
||||
switch ($key[0][0]) {
|
||||
case '+': // User inserted keys
|
||||
$attr['dynamic'] = true;
|
||||
$this->line .= '+'.$bin.'"'.$this->style('public', $key[1], $attr).'": ';
|
||||
break 2;
|
||||
case '~':
|
||||
$style = 'meta';
|
||||
if (isset($key[0][1])) {
|
||||
parse_str(substr($key[0], 1), $attr);
|
||||
$attr += ['binary' => $cursor->hashKeyIsBinary];
|
||||
}
|
||||
break;
|
||||
case '*':
|
||||
$style = 'protected';
|
||||
$bin = '#'.$bin;
|
||||
break;
|
||||
default:
|
||||
$attr['class'] = $key[0];
|
||||
$style = 'private';
|
||||
$bin = '-'.$bin;
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset($attr['collapse'])) {
|
||||
if ($attr['collapse']) {
|
||||
$this->collapseNextHash = true;
|
||||
} else {
|
||||
$this->expandNextHash = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->line .= $bin.$this->style($style, $key[1], $attr).(isset($attr['separator']) ? $attr['separator'] : ': ');
|
||||
} else {
|
||||
// This case should not happen
|
||||
$this->line .= '-'.$bin.'"'.$this->style('private', $key, ['class' => '']).'": ';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ($cursor->hardRefTo) {
|
||||
$this->line .= $this->style('ref', '&'.($cursor->hardRefCount ? $cursor->hardRefTo : ''), ['count' => $cursor->hardRefCount]).' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Decorates a value with some style.
|
||||
*
|
||||
* @param string $style The type of style being applied
|
||||
* @param string $value The value being styled
|
||||
* @param array $attr Optional context information
|
||||
*
|
||||
* @return string The value with style decoration
|
||||
*/
|
||||
protected function style($style, $value, $attr = [])
|
||||
{
|
||||
if (null === $this->colors) {
|
||||
$this->colors = $this->supportsColors();
|
||||
}
|
||||
|
||||
if (null === $this->handlesHrefGracefully) {
|
||||
$this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') && !getenv('KONSOLE_VERSION');
|
||||
}
|
||||
|
||||
if (isset($attr['ellipsis'], $attr['ellipsis-type'])) {
|
||||
$prefix = substr($value, 0, -$attr['ellipsis']);
|
||||
if ('cli' === \PHP_SAPI && 'path' === $attr['ellipsis-type'] && isset($_SERVER[$pwd = '\\' === \DIRECTORY_SEPARATOR ? 'CD' : 'PWD']) && 0 === strpos($prefix, $_SERVER[$pwd])) {
|
||||
$prefix = '.'.substr($prefix, \strlen($_SERVER[$pwd]));
|
||||
}
|
||||
if (!empty($attr['ellipsis-tail'])) {
|
||||
$prefix .= substr($value, -$attr['ellipsis'], $attr['ellipsis-tail']);
|
||||
$value = substr($value, -$attr['ellipsis'] + $attr['ellipsis-tail']);
|
||||
} else {
|
||||
$value = substr($value, -$attr['ellipsis']);
|
||||
}
|
||||
|
||||
$value = $this->style('default', $prefix).$this->style($style, $value);
|
||||
|
||||
goto href;
|
||||
}
|
||||
|
||||
$map = static::$controlCharsMap;
|
||||
$startCchr = $this->colors ? "\033[m\033[{$this->styles['default']}m" : '';
|
||||
$endCchr = $this->colors ? "\033[m\033[{$this->styles[$style]}m" : '';
|
||||
$value = preg_replace_callback(static::$controlCharsRx, function ($c) use ($map, $startCchr, $endCchr) {
|
||||
$s = $startCchr;
|
||||
$c = $c[$i = 0];
|
||||
do {
|
||||
$s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', \ord($c[$i]));
|
||||
} while (isset($c[++$i]));
|
||||
|
||||
return $s.$endCchr;
|
||||
}, $value, -1, $cchrCount);
|
||||
|
||||
if ($this->colors) {
|
||||
if ($cchrCount && "\033" === $value[0]) {
|
||||
$value = substr($value, \strlen($startCchr));
|
||||
} else {
|
||||
$value = "\033[{$this->styles[$style]}m".$value;
|
||||
}
|
||||
if ($cchrCount && $endCchr === substr($value, -\strlen($endCchr))) {
|
||||
$value = substr($value, 0, -\strlen($endCchr));
|
||||
} else {
|
||||
$value .= "\033[{$this->styles['default']}m";
|
||||
}
|
||||
}
|
||||
|
||||
href:
|
||||
if ($this->colors && $this->handlesHrefGracefully) {
|
||||
if (isset($attr['file']) && $href = $this->getSourceLink($attr['file'], isset($attr['line']) ? $attr['line'] : 0)) {
|
||||
if ('note' === $style) {
|
||||
$value .= "\033]8;;{$href}\033\\^\033]8;;\033\\";
|
||||
} else {
|
||||
$attr['href'] = $href;
|
||||
}
|
||||
}
|
||||
if (isset($attr['href'])) {
|
||||
$value = "\033]8;;{$attr['href']}\033\\{$value}\033]8;;\033\\";
|
||||
}
|
||||
} elseif ($attr['if_links'] ?? false) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool Tells if the current output stream supports ANSI colors or not
|
||||
*/
|
||||
protected function supportsColors()
|
||||
{
|
||||
if ($this->outputStream !== static::$defaultOutput) {
|
||||
return $this->hasColorSupport($this->outputStream);
|
||||
}
|
||||
if (null !== static::$defaultColors) {
|
||||
return static::$defaultColors;
|
||||
}
|
||||
if (isset($_SERVER['argv'][1])) {
|
||||
$colors = $_SERVER['argv'];
|
||||
$i = \count($colors);
|
||||
while (--$i > 0) {
|
||||
if (isset($colors[$i][5])) {
|
||||
switch ($colors[$i]) {
|
||||
case '--ansi':
|
||||
case '--color':
|
||||
case '--color=yes':
|
||||
case '--color=force':
|
||||
case '--color=always':
|
||||
return static::$defaultColors = true;
|
||||
|
||||
case '--no-ansi':
|
||||
case '--color=no':
|
||||
case '--color=none':
|
||||
case '--color=never':
|
||||
return static::$defaultColors = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$h = stream_get_meta_data($this->outputStream) + ['wrapper_type' => null];
|
||||
$h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'wb') : $this->outputStream;
|
||||
|
||||
return static::$defaultColors = $this->hasColorSupport($h);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function dumpLine(int $depth, bool $endOfValue = false)
|
||||
{
|
||||
if ($this->colors) {
|
||||
$this->line = sprintf("\033[%sm%s\033[m", $this->styles['default'], $this->line);
|
||||
}
|
||||
parent::dumpLine($depth);
|
||||
}
|
||||
|
||||
protected function endValue(Cursor $cursor)
|
||||
{
|
||||
if (-1 === $cursor->hashType) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Stub::ARRAY_INDEXED === $cursor->hashType || Stub::ARRAY_ASSOC === $cursor->hashType) {
|
||||
if (self::DUMP_TRAILING_COMMA & $this->flags && 0 < $cursor->depth) {
|
||||
$this->line .= ',';
|
||||
} elseif (self::DUMP_COMMA_SEPARATOR & $this->flags && 1 < $cursor->hashLength - $cursor->hashIndex) {
|
||||
$this->line .= ',';
|
||||
}
|
||||
}
|
||||
|
||||
$this->dumpLine($cursor->depth, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the stream supports colorization.
|
||||
*
|
||||
* Reference: Composer\XdebugHandler\Process::supportsColor
|
||||
* https://github.com/composer/xdebug-handler
|
||||
*
|
||||
* @param mixed $stream A CLI output stream
|
||||
*/
|
||||
private function hasColorSupport($stream): bool
|
||||
{
|
||||
if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Follow https://no-color.org/
|
||||
if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('Hyper' === getenv('TERM_PROGRAM')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (\DIRECTORY_SEPARATOR === '\\') {
|
||||
return (\function_exists('sapi_windows_vt100_support')
|
||||
&& @sapi_windows_vt100_support($stream))
|
||||
|| false !== getenv('ANSICON')
|
||||
|| 'ON' === getenv('ConEmuANSI')
|
||||
|| 'xterm' === getenv('TERM');
|
||||
}
|
||||
|
||||
return stream_isatty($stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the Windows terminal supports true color.
|
||||
*
|
||||
* Note that this does not check an output stream, but relies on environment
|
||||
* variables from known implementations, or a PHP and Windows version that
|
||||
* supports true color.
|
||||
*/
|
||||
private function isWindowsTrueColor(): bool
|
||||
{
|
||||
$result = 183 <= getenv('ANSICON_VER')
|
||||
|| 'ON' === getenv('ConEmuANSI')
|
||||
|| 'xterm' === getenv('TERM')
|
||||
|| 'Hyper' === getenv('TERM_PROGRAM');
|
||||
|
||||
if (!$result) {
|
||||
$version = sprintf(
|
||||
'%s.%s.%s',
|
||||
PHP_WINDOWS_VERSION_MAJOR,
|
||||
PHP_WINDOWS_VERSION_MINOR,
|
||||
PHP_WINDOWS_VERSION_BUILD
|
||||
);
|
||||
$result = $version >= '10.0.15063';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function getSourceLink(string $file, int $line)
|
||||
{
|
||||
if ($fmt = $this->displayOptions['fileLinkFormat']) {
|
||||
return \is_string($fmt) ? strtr($fmt, ['%f' => $file, '%l' => $line]) : ($fmt->format($file, $line) ?: 'file://'.$file.'#L'.$line);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
<?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\VarDumper\Dumper\ContextProvider;
|
||||
|
||||
/**
|
||||
* Tries to provide context on CLI.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
final class CliContextProvider implements ContextProviderInterface
|
||||
{
|
||||
public function getContext(): ?array
|
||||
{
|
||||
if ('cli' !== \PHP_SAPI) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return [
|
||||
'command_line' => $commandLine = implode(' ', $_SERVER['argv'] ?? []),
|
||||
'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?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\VarDumper\Dumper\ContextProvider;
|
||||
|
||||
/**
|
||||
* Interface to provide contextual data about dump data clones sent to a server.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
interface ContextProviderInterface
|
||||
{
|
||||
/**
|
||||
* @return array|null Context data or null if unable to provide any context
|
||||
*/
|
||||
public function getContext(): ?array;
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
<?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\VarDumper\Dumper\ContextProvider;
|
||||
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\VarDumper\Caster\ReflectionCaster;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
|
||||
/**
|
||||
* Tries to provide context from a request.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
final class RequestContextProvider implements ContextProviderInterface
|
||||
{
|
||||
private $requestStack;
|
||||
private $cloner;
|
||||
|
||||
public function __construct(RequestStack $requestStack)
|
||||
{
|
||||
$this->requestStack = $requestStack;
|
||||
$this->cloner = new VarCloner();
|
||||
$this->cloner->setMaxItems(0);
|
||||
$this->cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO);
|
||||
}
|
||||
|
||||
public function getContext(): ?array
|
||||
{
|
||||
if (null === $request = $this->requestStack->getCurrentRequest()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$controller = $request->attributes->get('_controller');
|
||||
|
||||
return [
|
||||
'uri' => $request->getUri(),
|
||||
'method' => $request->getMethod(),
|
||||
'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller,
|
||||
'identifier' => spl_object_hash($request),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
<?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\VarDumper\Dumper\ContextProvider;
|
||||
|
||||
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
use Twig\Template;
|
||||
|
||||
/**
|
||||
* Tries to provide context from sources (class name, file, line, code excerpt, ...).
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
final class SourceContextProvider implements ContextProviderInterface
|
||||
{
|
||||
private $limit;
|
||||
private $charset;
|
||||
private $projectDir;
|
||||
private $fileLinkFormatter;
|
||||
|
||||
public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9)
|
||||
{
|
||||
$this->charset = $charset;
|
||||
$this->projectDir = $projectDir;
|
||||
$this->fileLinkFormatter = $fileLinkFormatter;
|
||||
$this->limit = $limit;
|
||||
}
|
||||
|
||||
public function getContext(): ?array
|
||||
{
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, $this->limit);
|
||||
|
||||
$file = $trace[1]['file'];
|
||||
$line = $trace[1]['line'];
|
||||
$name = false;
|
||||
$fileExcerpt = false;
|
||||
|
||||
for ($i = 2; $i < $this->limit; ++$i) {
|
||||
if (isset($trace[$i]['class'], $trace[$i]['function'])
|
||||
&& 'dump' === $trace[$i]['function']
|
||||
&& VarDumper::class === $trace[$i]['class']
|
||||
) {
|
||||
$file = $trace[$i]['file'] ?? $file;
|
||||
$line = $trace[$i]['line'] ?? $line;
|
||||
|
||||
while (++$i < $this->limit) {
|
||||
if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && 0 !== strpos($trace[$i]['function'], 'call_user_func')) {
|
||||
$file = $trace[$i]['file'];
|
||||
$line = $trace[$i]['line'];
|
||||
|
||||
break;
|
||||
} elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof Template) {
|
||||
$template = $trace[$i]['object'];
|
||||
$name = $template->getTemplateName();
|
||||
$src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false);
|
||||
$info = $template->getDebugInfo();
|
||||
if (isset($info[$trace[$i - 1]['line']])) {
|
||||
$line = $info[$trace[$i - 1]['line']];
|
||||
$file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null;
|
||||
|
||||
if ($src) {
|
||||
$src = explode("\n", $src);
|
||||
$fileExcerpt = [];
|
||||
|
||||
for ($i = max($line - 3, 1), $max = min($line + 3, \count($src)); $i <= $max; ++$i) {
|
||||
$fileExcerpt[] = '<li'.($i === $line ? ' class="selected"' : '').'><code>'.$this->htmlEncode($src[$i - 1]).'</code></li>';
|
||||
}
|
||||
|
||||
$fileExcerpt = '<ol start="'.max($line - 3, 1).'">'.implode("\n", $fileExcerpt).'</ol>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (false === $name) {
|
||||
$name = str_replace('\\', '/', $file);
|
||||
$name = substr($name, strrpos($name, '/') + 1);
|
||||
}
|
||||
|
||||
$context = ['name' => $name, 'file' => $file, 'line' => $line];
|
||||
$context['file_excerpt'] = $fileExcerpt;
|
||||
|
||||
if (null !== $this->projectDir) {
|
||||
$context['project_dir'] = $this->projectDir;
|
||||
if (0 === strpos($file, $this->projectDir)) {
|
||||
$context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->fileLinkFormatter && $fileLink = $this->fileLinkFormatter->format($context['file'], $context['line'])) {
|
||||
$context['file_link'] = $fileLink;
|
||||
}
|
||||
|
||||
return $context;
|
||||
}
|
||||
|
||||
private function htmlEncode(string $s): string
|
||||
{
|
||||
$html = '';
|
||||
|
||||
$dumper = new HtmlDumper(function ($line) use (&$html) { $html .= $line; }, $this->charset);
|
||||
$dumper->setDumpHeader('');
|
||||
$dumper->setDumpBoundaries('', '');
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$dumper->dump($cloner->cloneVar($s));
|
||||
|
||||
return substr(strip_tags($html), 1, -1);
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
<?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\VarDumper\Dumper;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
|
||||
/**
|
||||
* @author Kévin Thérage <therage.kevin@gmail.com>
|
||||
*/
|
||||
class ContextualizedDumper implements DataDumperInterface
|
||||
{
|
||||
private $wrappedDumper;
|
||||
private $contextProviders;
|
||||
|
||||
/**
|
||||
* @param ContextProviderInterface[] $contextProviders
|
||||
*/
|
||||
public function __construct(DataDumperInterface $wrappedDumper, array $contextProviders)
|
||||
{
|
||||
$this->wrappedDumper = $wrappedDumper;
|
||||
$this->contextProviders = $contextProviders;
|
||||
}
|
||||
|
||||
public function dump(Data $data)
|
||||
{
|
||||
$context = [];
|
||||
foreach ($this->contextProviders as $contextProvider) {
|
||||
$context[\get_class($contextProvider)] = $contextProvider->getContext();
|
||||
}
|
||||
|
||||
$this->wrappedDumper->dump($data->withContext($context));
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?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\VarDumper\Dumper;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
|
||||
/**
|
||||
* DataDumperInterface for dumping Data objects.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
interface DataDumperInterface
|
||||
{
|
||||
public function dump(Data $data);
|
||||
}
|
||||
1004
vendor/symfony/var-dumper/Dumper/HtmlDumper.php
vendored
1004
vendor/symfony/var-dumper/Dumper/HtmlDumper.php
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,53 +0,0 @@
|
||||
<?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\VarDumper\Dumper;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
use Symfony\Component\VarDumper\Server\Connection;
|
||||
|
||||
/**
|
||||
* ServerDumper forwards serialized Data clones to a server.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
class ServerDumper implements DataDumperInterface
|
||||
{
|
||||
private $connection;
|
||||
private $wrappedDumper;
|
||||
|
||||
/**
|
||||
* @param string $host The server host
|
||||
* @param DataDumperInterface|null $wrappedDumper A wrapped instance used whenever we failed contacting the server
|
||||
* @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
|
||||
*/
|
||||
public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = [])
|
||||
{
|
||||
$this->connection = new Connection($host, $contextProviders);
|
||||
$this->wrappedDumper = $wrappedDumper;
|
||||
}
|
||||
|
||||
public function getContextProviders(): array
|
||||
{
|
||||
return $this->connection->getContextProviders();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function dump(Data $data)
|
||||
{
|
||||
if (!$this->connection->write($data) && $this->wrappedDumper) {
|
||||
$this->wrappedDumper->dump($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
<?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\VarDumper\Exception;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class ThrowingCasterException extends \Exception
|
||||
{
|
||||
/**
|
||||
* @param \Throwable $prev The exception thrown from the caster
|
||||
*/
|
||||
public function __construct(\Throwable $prev)
|
||||
{
|
||||
parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev);
|
||||
}
|
||||
}
|
||||
15
vendor/symfony/var-dumper/README.md
vendored
15
vendor/symfony/var-dumper/README.md
vendored
@@ -1,15 +0,0 @@
|
||||
VarDumper Component
|
||||
===================
|
||||
|
||||
The VarDumper component provides mechanisms for walking through any arbitrary
|
||||
PHP variable. It provides a better `dump()` function that you can use instead
|
||||
of `var_dump`.
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
* [Documentation](https://symfony.com/doc/current/components/var_dumper/introduction.html)
|
||||
* [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)
|
||||
@@ -1,63 +0,0 @@
|
||||
#!/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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Starts a dump server to collect and output dumps on a single place with multiple formats support.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Logger\ConsoleLogger;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
use Symfony\Component\VarDumper\Command\ServerDumpCommand;
|
||||
use Symfony\Component\VarDumper\Server\DumpServer;
|
||||
|
||||
function includeIfExists(string $file): bool
|
||||
{
|
||||
return file_exists($file) && include $file;
|
||||
}
|
||||
|
||||
if (
|
||||
!includeIfExists(__DIR__ . '/../../../../autoload.php') &&
|
||||
!includeIfExists(__DIR__ . '/../../vendor/autoload.php') &&
|
||||
!includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php')
|
||||
) {
|
||||
fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!class_exists(Application::class)) {
|
||||
fwrite(STDERR, 'You need the "symfony/console" component in order to run the VarDumper server.'.PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$input = new ArgvInput();
|
||||
$output = new ConsoleOutput();
|
||||
$defaultHost = '127.0.0.1:9912';
|
||||
$host = $input->getParameterOption(['--host'], $_SERVER['VAR_DUMPER_SERVER'] ?? $defaultHost, true);
|
||||
$logger = interface_exists(LoggerInterface::class) ? new ConsoleLogger($output->getErrorOutput()) : null;
|
||||
|
||||
$app = new Application();
|
||||
|
||||
$app->getDefinition()->addOption(
|
||||
new InputOption('--host', null, InputOption::VALUE_REQUIRED, 'The address the server should listen to', $defaultHost)
|
||||
);
|
||||
|
||||
$app->add($command = new ServerDumpCommand(new DumpServer($host, $logger)))
|
||||
->getApplication()
|
||||
->setDefaultCommand($command->getName(), true)
|
||||
->run($input, $output)
|
||||
;
|
||||
@@ -1,130 +0,0 @@
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
justify-content: flex-end;
|
||||
max-width: 1140px;
|
||||
margin: auto;
|
||||
padding: 15px;
|
||||
word-wrap: break-word;
|
||||
background-color: #F9F9F9;
|
||||
color: #222;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
color: #218BC3;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.text-small {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
article {
|
||||
margin: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
article > header > .row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: baseline;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
article > header > .row > .col {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
article > header > .row > h2 {
|
||||
font-size: 14px;
|
||||
color: #222;
|
||||
font-weight: normal;
|
||||
font-family: "Lucida Console", monospace, sans-serif;
|
||||
word-break: break-all;
|
||||
margin: 20px 5px 0 0;
|
||||
user-select: all;
|
||||
}
|
||||
article > header > .row > h2 > code {
|
||||
white-space: nowrap;
|
||||
user-select: none;
|
||||
color: #cc2255;
|
||||
background-color: #f7f7f9;
|
||||
border: 1px solid #e1e1e8;
|
||||
border-radius: 3px;
|
||||
margin-right: 5px;
|
||||
padding: 0 3px;
|
||||
}
|
||||
article > header > .row > time.col {
|
||||
flex: 0;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
color: #999;
|
||||
font-style: italic;
|
||||
}
|
||||
article > header ul.tags {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
article > header ul.tags > li {
|
||||
user-select: all;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
article > header ul.tags > li > span.badge {
|
||||
display: inline-block;
|
||||
padding: .25em .4em;
|
||||
margin-right: 5px;
|
||||
border-radius: 4px;
|
||||
background-color: #6c757d3b;
|
||||
color: #524d4d;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
user-select: none;
|
||||
}
|
||||
article > section.body {
|
||||
border: 1px solid #d8d8d8;
|
||||
background: #FFF;
|
||||
padding: 10px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
pre.sf-dump {
|
||||
border-radius: 3px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
.dumped-tag > .sf-dump {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 1px 5px;
|
||||
line-height: 1.4;
|
||||
vertical-align: top;
|
||||
background-color: transparent;
|
||||
user-select: auto;
|
||||
}
|
||||
.dumped-tag > pre.sf-dump,
|
||||
.dumped-tag > .sf-dump-default {
|
||||
color: #CC7832;
|
||||
background: none;
|
||||
}
|
||||
.dumped-tag > .sf-dump .sf-dump-str { color: #629755; }
|
||||
.dumped-tag > .sf-dump .sf-dump-private,
|
||||
.dumped-tag > .sf-dump .sf-dump-protected,
|
||||
.dumped-tag > .sf-dump .sf-dump-public { color: #262626; }
|
||||
.dumped-tag > .sf-dump .sf-dump-note { color: #6897BB; }
|
||||
.dumped-tag > .sf-dump .sf-dump-key { color: #789339; }
|
||||
.dumped-tag > .sf-dump .sf-dump-ref { color: #6E6E6E; }
|
||||
.dumped-tag > .sf-dump .sf-dump-ellipsis { color: #CC7832; max-width: 100em; }
|
||||
.dumped-tag > .sf-dump .sf-dump-ellipsis-path { max-width: 5em; }
|
||||
.dumped-tag > .sf-dump .sf-dump-ns { user-select: none; }
|
||||
@@ -1,43 +0,0 @@
|
||||
<?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.
|
||||
*/
|
||||
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
if (!function_exists('dump')) {
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
function dump($var, ...$moreVars)
|
||||
{
|
||||
VarDumper::dump($var);
|
||||
|
||||
foreach ($moreVars as $v) {
|
||||
VarDumper::dump($v);
|
||||
}
|
||||
|
||||
if (1 < func_num_args()) {
|
||||
return func_get_args();
|
||||
}
|
||||
|
||||
return $var;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('dd')) {
|
||||
function dd(...$vars)
|
||||
{
|
||||
foreach ($vars as $v) {
|
||||
VarDumper::dump($v);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let prev = null;
|
||||
Array.from(document.getElementsByTagName('article')).reverse().forEach(function (article) {
|
||||
const dedupId = article.dataset.dedupId;
|
||||
if (dedupId === prev) {
|
||||
article.getElementsByTagName('header')[0].classList.add('hidden');
|
||||
}
|
||||
prev = dedupId;
|
||||
});
|
||||
});
|
||||
95
vendor/symfony/var-dumper/Server/Connection.php
vendored
95
vendor/symfony/var-dumper/Server/Connection.php
vendored
@@ -1,95 +0,0 @@
|
||||
<?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\VarDumper\Server;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
|
||||
/**
|
||||
* Forwards serialized Data clones to a server.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
class Connection
|
||||
{
|
||||
private $host;
|
||||
private $contextProviders;
|
||||
private $socket;
|
||||
|
||||
/**
|
||||
* @param string $host The server host
|
||||
* @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
|
||||
*/
|
||||
public function __construct(string $host, array $contextProviders = [])
|
||||
{
|
||||
if (false === strpos($host, '://')) {
|
||||
$host = 'tcp://'.$host;
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
$this->contextProviders = $contextProviders;
|
||||
}
|
||||
|
||||
public function getContextProviders(): array
|
||||
{
|
||||
return $this->contextProviders;
|
||||
}
|
||||
|
||||
public function write(Data $data): bool
|
||||
{
|
||||
$socketIsFresh = !$this->socket;
|
||||
if (!$this->socket = $this->socket ?: $this->createSocket()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$context = ['timestamp' => microtime(true)];
|
||||
foreach ($this->contextProviders as $name => $provider) {
|
||||
$context[$name] = $provider->getContext();
|
||||
}
|
||||
$context = array_filter($context);
|
||||
$encodedPayload = base64_encode(serialize([$data, $context]))."\n";
|
||||
|
||||
set_error_handler([self::class, 'nullErrorHandler']);
|
||||
try {
|
||||
if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) {
|
||||
return true;
|
||||
}
|
||||
if (!$socketIsFresh) {
|
||||
stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
|
||||
fclose($this->socket);
|
||||
$this->socket = $this->createSocket();
|
||||
}
|
||||
if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) {
|
||||
return true;
|
||||
}
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static function nullErrorHandler($t, $m)
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
|
||||
private function createSocket()
|
||||
{
|
||||
set_error_handler([self::class, 'nullErrorHandler']);
|
||||
try {
|
||||
return stream_socket_client($this->host, $errno, $errstr, 3, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT);
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
}
|
||||
}
|
||||
107
vendor/symfony/var-dumper/Server/DumpServer.php
vendored
107
vendor/symfony/var-dumper/Server/DumpServer.php
vendored
@@ -1,107 +0,0 @@
|
||||
<?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\VarDumper\Server;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* A server collecting Data clones sent by a ServerDumper.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DumpServer
|
||||
{
|
||||
private $host;
|
||||
private $socket;
|
||||
private $logger;
|
||||
|
||||
public function __construct(string $host, LoggerInterface $logger = null)
|
||||
{
|
||||
if (false === strpos($host, '://')) {
|
||||
$host = 'tcp://'.$host;
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function start(): void
|
||||
{
|
||||
if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) {
|
||||
throw new \RuntimeException(sprintf('Server start failed on "%s": %s %s.', $this->host, $errstr, $errno));
|
||||
}
|
||||
}
|
||||
|
||||
public function listen(callable $callback): void
|
||||
{
|
||||
if (null === $this->socket) {
|
||||
$this->start();
|
||||
}
|
||||
|
||||
foreach ($this->getMessages() as $clientId => $message) {
|
||||
$payload = @unserialize(base64_decode($message), ['allowed_classes' => [Data::class, Stub::class]]);
|
||||
|
||||
// Impossible to decode the message, give up.
|
||||
if (false === $payload) {
|
||||
if ($this->logger) {
|
||||
$this->logger->warning('Unable to decode a message from {clientId} client.', ['clientId' => $clientId]);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) {
|
||||
if ($this->logger) {
|
||||
$this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', ['clientId' => $clientId]);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
list($data, $context) = $payload;
|
||||
|
||||
$callback($data, $context, $clientId);
|
||||
}
|
||||
}
|
||||
|
||||
public function getHost(): string
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
private function getMessages(): iterable
|
||||
{
|
||||
$sockets = [(int) $this->socket => $this->socket];
|
||||
$write = [];
|
||||
|
||||
while (true) {
|
||||
$read = $sockets;
|
||||
stream_select($read, $write, $write, null);
|
||||
|
||||
foreach ($read as $stream) {
|
||||
if ($this->socket === $stream) {
|
||||
$stream = stream_socket_accept($this->socket);
|
||||
$sockets[(int) $stream] = $stream;
|
||||
} elseif (feof($stream)) {
|
||||
unset($sockets[(int) $stream]);
|
||||
fclose($stream);
|
||||
} else {
|
||||
yield (int) $stream => fgets($stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
<?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\VarDumper\Test;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
trait VarDumperTestTrait
|
||||
{
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
private $varDumperConfig = [
|
||||
'casters' => [],
|
||||
'flags' => null,
|
||||
];
|
||||
|
||||
protected function setUpVarDumper(array $casters, int $flags = null): void
|
||||
{
|
||||
$this->varDumperConfig['casters'] = $casters;
|
||||
$this->varDumperConfig['flags'] = $flags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @after
|
||||
*/
|
||||
protected function tearDownVarDumper(): void
|
||||
{
|
||||
$this->varDumperConfig['casters'] = [];
|
||||
$this->varDumperConfig['flags'] = null;
|
||||
}
|
||||
|
||||
public function assertDumpEquals($expected, $data, int $filter = 0, string $message = '')
|
||||
{
|
||||
$this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
public function assertDumpMatchesFormat($expected, $data, int $filter = 0, string $message = '')
|
||||
{
|
||||
$this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
protected function getDump($data, $key = null, int $filter = 0): ?string
|
||||
{
|
||||
if (null === $flags = $this->varDumperConfig['flags']) {
|
||||
$flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0;
|
||||
$flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0;
|
||||
$flags |= getenv('DUMP_COMMA_SEPARATOR') ? CliDumper::DUMP_COMMA_SEPARATOR : 0;
|
||||
}
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$cloner->addCasters($this->varDumperConfig['casters']);
|
||||
$cloner->setMaxItems(-1);
|
||||
$dumper = new CliDumper(null, null, $flags);
|
||||
$dumper->setColors(false);
|
||||
$data = $cloner->cloneVar($data, $filter)->withRefHandles(false);
|
||||
if (null !== $key && null === $data = $data->seek($key)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return rtrim($dumper->dump($data, true));
|
||||
}
|
||||
|
||||
private function prepareExpectation($expected, int $filter): string
|
||||
{
|
||||
if (!\is_string($expected)) {
|
||||
$expected = $this->getDump($expected, null, $filter);
|
||||
}
|
||||
|
||||
return rtrim($expected);
|
||||
}
|
||||
}
|
||||
60
vendor/symfony/var-dumper/VarDumper.php
vendored
60
vendor/symfony/var-dumper/VarDumper.php
vendored
@@ -1,60 +0,0 @@
|
||||
<?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\VarDumper;
|
||||
|
||||
use Symfony\Component\VarDumper\Caster\ReflectionCaster;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextualizedDumper;
|
||||
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
||||
|
||||
// Load the global dump() function
|
||||
require_once __DIR__.'/Resources/functions/dump.php';
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class VarDumper
|
||||
{
|
||||
private static $handler;
|
||||
|
||||
public static function dump($var)
|
||||
{
|
||||
if (null === self::$handler) {
|
||||
$cloner = new VarCloner();
|
||||
$cloner->addCasters(ReflectionCaster::UNSET_CLOSURE_FILE_INFO);
|
||||
|
||||
if (isset($_SERVER['VAR_DUMPER_FORMAT'])) {
|
||||
$dumper = 'html' === $_SERVER['VAR_DUMPER_FORMAT'] ? new HtmlDumper() : new CliDumper();
|
||||
} else {
|
||||
$dumper = \in_array(\PHP_SAPI, ['cli', 'phpdbg']) ? new CliDumper() : new HtmlDumper();
|
||||
}
|
||||
|
||||
$dumper = new ContextualizedDumper($dumper, [new SourceContextProvider()]);
|
||||
|
||||
self::$handler = function ($var) use ($cloner, $dumper) {
|
||||
$dumper->dump($cloner->cloneVar($var));
|
||||
};
|
||||
}
|
||||
|
||||
return (self::$handler)($var);
|
||||
}
|
||||
|
||||
public static function setHandler(callable $callable = null)
|
||||
{
|
||||
$prevHandler = self::$handler;
|
||||
self::$handler = $callable;
|
||||
|
||||
return $prevHandler;
|
||||
}
|
||||
}
|
||||
53
vendor/symfony/var-dumper/composer.json
vendored
53
vendor/symfony/var-dumper/composer.json
vendored
@@ -1,53 +0,0 @@
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"type": "library",
|
||||
"description": "Symfony mechanism for exploring and dumping PHP variables",
|
||||
"keywords": ["dump", "debug"],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2.5",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-iconv": "*",
|
||||
"symfony/console": "^4.4|^5.0",
|
||||
"symfony/process": "^4.4|^5.0",
|
||||
"twig/twig": "^2.4|^3.0"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<5.4.3",
|
||||
"symfony/console": "<4.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
|
||||
"ext-intl": "To show region name in time zone dump",
|
||||
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [ "Resources/functions/dump.php" ],
|
||||
"psr-4": { "Symfony\\Component\\VarDumper\\": "" },
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"bin": [
|
||||
"Resources/bin/var-dump-server"
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.0-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user