update2
This commit is contained in:
parent
98419bd18d
commit
8a69e45efa
4919 changed files with 28311 additions and 224136 deletions
0
pfosten/vendor/symfony/var-dumper/.gitignore
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/.gitignore
vendored
Executable file → Normal file
6
pfosten/vendor/symfony/var-dumper/CHANGELOG.md
vendored
Executable file → Normal file
6
pfosten/vendor/symfony/var-dumper/CHANGELOG.md
vendored
Executable file → Normal file
|
|
@ -1,6 +1,12 @@
|
|||
CHANGELOG
|
||||
=========
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
* added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth
|
||||
* deprecated `MongoCaster`
|
||||
|
||||
2.7.0
|
||||
-----
|
||||
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Caster/AmqpCaster.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/AmqpCaster.php
vendored
Executable file → Normal file
8
pfosten/vendor/symfony/var-dumper/Caster/ArgsStub.php
vendored
Executable file → Normal file
8
pfosten/vendor/symfony/var-dumper/Caster/ArgsStub.php
vendored
Executable file → Normal file
|
|
@ -35,10 +35,10 @@ class ArgsStub extends EnumStub
|
|||
|
||||
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);
|
||||
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 (array('...') === $params) {
|
||||
|
|
|
|||
23
pfosten/vendor/symfony/var-dumper/Caster/Caster.php
vendored
Executable file → Normal file
23
pfosten/vendor/symfony/var-dumper/Caster/Caster.php
vendored
Executable file → Normal file
|
|
@ -49,7 +49,7 @@ class Caster
|
|||
public static function castObject($obj, $class, $hasDebugInfo = false)
|
||||
{
|
||||
if ($class instanceof \ReflectionClass) {
|
||||
@trigger_error(sprintf('Passing a ReflectionClass to %s() is deprecated since version 3.3 and will be unsupported in 4.0. Pass the class name as string instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('Passing a ReflectionClass to "%s()" is deprecated since Symfony 3.3 and will be unsupported in 4.0. Pass the class name as string instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
$hasDebugInfo = $class->hasMethod('__debugInfo');
|
||||
$class = $class->name;
|
||||
}
|
||||
|
|
@ -65,11 +65,20 @@ class Caster
|
|||
}
|
||||
|
||||
if ($a) {
|
||||
static $publicProperties = array();
|
||||
|
||||
$i = 0;
|
||||
$prefixedKeys = array();
|
||||
foreach ($a as $k => $v) {
|
||||
if (isset($k[0]) && "\0" !== $k[0] && !property_exists($class, $k)) {
|
||||
$prefixedKeys[$i] = self::PREFIX_DYNAMIC.$k;
|
||||
if (isset($k[0]) ? "\0" !== $k[0] : \PHP_VERSION_ID >= 70200) {
|
||||
if (!isset($publicProperties[$class])) {
|
||||
foreach (get_class_vars($class) as $prop => $v) {
|
||||
$publicProperties[$class][$prop] = 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");
|
||||
}
|
||||
|
|
@ -109,14 +118,14 @@ class Caster
|
|||
|
||||
if (null === $v) {
|
||||
$type |= self::EXCLUDE_NULL & $filter;
|
||||
}
|
||||
if (empty($v)) {
|
||||
$type |= self::EXCLUDE_EMPTY & $filter;
|
||||
} elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || array() === $v) {
|
||||
$type |= self::EXCLUDE_EMPTY & $filter;
|
||||
}
|
||||
if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !in_array($k, $listedProperties, true)) {
|
||||
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)) {
|
||||
if ((self::EXCLUDE_VERBOSE & $filter) && \in_array($k, $listedProperties, true)) {
|
||||
$type |= self::EXCLUDE_VERBOSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
16
pfosten/vendor/symfony/var-dumper/Caster/ClassStub.php
vendored
Executable file → Normal file
16
pfosten/vendor/symfony/var-dumper/Caster/ClassStub.php
vendored
Executable file → Normal file
|
|
@ -19,8 +19,6 @@ namespace Symfony\Component\VarDumper\Caster;
|
|||
class ClassStub extends ConstStub
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string A PHP identifier, e.g. a class, method, interface, etc. name
|
||||
* @param callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier
|
||||
*/
|
||||
|
|
@ -29,7 +27,7 @@ class ClassStub extends ConstStub
|
|||
$this->value = $identifier;
|
||||
|
||||
if (0 < $i = strrpos($identifier, '\\')) {
|
||||
$this->attr['ellipsis'] = strlen($identifier) - $i;
|
||||
$this->attr['ellipsis'] = \strlen($identifier) - $i;
|
||||
$this->attr['ellipsis-type'] = 'class';
|
||||
$this->attr['ellipsis-tail'] = 1;
|
||||
}
|
||||
|
|
@ -38,9 +36,9 @@ class ClassStub extends ConstStub
|
|||
if (null !== $callable) {
|
||||
if ($callable instanceof \Closure) {
|
||||
$r = new \ReflectionFunction($callable);
|
||||
} elseif (is_object($callable)) {
|
||||
} elseif (\is_object($callable)) {
|
||||
$r = array($callable, '__invoke');
|
||||
} elseif (is_array($callable)) {
|
||||
} elseif (\is_array($callable)) {
|
||||
$r = $callable;
|
||||
} elseif (false !== $i = strpos($callable, '::')) {
|
||||
$r = array(substr($callable, 0, $i), substr($callable, 2 + $i));
|
||||
|
|
@ -53,7 +51,7 @@ class ClassStub extends ConstStub
|
|||
$r = new \ReflectionClass($identifier);
|
||||
}
|
||||
|
||||
if (is_array($r)) {
|
||||
if (\is_array($r)) {
|
||||
try {
|
||||
$r = new \ReflectionMethod($r[0], $r[1]);
|
||||
} catch (\ReflectionException $e) {
|
||||
|
|
@ -72,13 +70,13 @@ class ClassStub extends ConstStub
|
|||
|
||||
public static function wrapCallable($callable)
|
||||
{
|
||||
if (is_object($callable) || !is_callable($callable)) {
|
||||
if (\is_object($callable) || !\is_callable($callable)) {
|
||||
return $callable;
|
||||
}
|
||||
|
||||
if (!is_array($callable)) {
|
||||
if (!\is_array($callable)) {
|
||||
$callable = new static($callable);
|
||||
} elseif (is_string($callable[0])) {
|
||||
} elseif (\is_string($callable[0])) {
|
||||
$callable[0] = new static($callable[0]);
|
||||
} else {
|
||||
$callable[1] = new static($callable[1], $callable);
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Caster/ConstStub.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/ConstStub.php
vendored
Executable file → Normal file
2
pfosten/vendor/symfony/var-dumper/Caster/CutArrayStub.php
vendored
Executable file → Normal file
2
pfosten/vendor/symfony/var-dumper/Caster/CutArrayStub.php
vendored
Executable file → Normal file
|
|
@ -25,6 +25,6 @@ class CutArrayStub extends CutStub
|
|||
parent::__construct($value);
|
||||
|
||||
$this->preservedSubset = array_intersect_key($value, array_flip($preservedKeys));
|
||||
$this->cut -= count($this->preservedSubset);
|
||||
$this->cut -= \count($this->preservedSubset);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
pfosten/vendor/symfony/var-dumper/Caster/CutStub.php
vendored
Executable file → Normal file
8
pfosten/vendor/symfony/var-dumper/Caster/CutStub.php
vendored
Executable file → Normal file
|
|
@ -24,17 +24,17 @@ class CutStub extends Stub
|
|||
{
|
||||
$this->value = $value;
|
||||
|
||||
switch (gettype($value)) {
|
||||
switch (\gettype($value)) {
|
||||
case 'object':
|
||||
$this->type = self::TYPE_OBJECT;
|
||||
$this->class = get_class($value);
|
||||
$this->class = \get_class($value);
|
||||
$this->cut = -1;
|
||||
break;
|
||||
|
||||
case 'array':
|
||||
$this->type = self::TYPE_ARRAY;
|
||||
$this->class = self::ARRAY_ASSOC;
|
||||
$this->cut = $this->value = count($value);
|
||||
$this->cut = $this->value = \count($value);
|
||||
break;
|
||||
|
||||
case 'resource':
|
||||
|
|
@ -51,7 +51,7 @@ class CutStub extends Stub
|
|||
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->cut = self::STRING_BINARY === $this->class ? \strlen($value) : mb_strlen($value, 'UTF-8');
|
||||
$this->value = '';
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Caster/DOMCaster.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/DOMCaster.php
vendored
Executable file → Normal file
2
pfosten/vendor/symfony/var-dumper/Caster/DoctrineCaster.php
vendored
Executable file → Normal file
2
pfosten/vendor/symfony/var-dumper/Caster/DoctrineCaster.php
vendored
Executable file → Normal file
|
|
@ -12,8 +12,8 @@
|
|||
namespace Symfony\Component\VarDumper\Caster;
|
||||
|
||||
use Doctrine\Common\Proxy\Proxy as CommonProxy;
|
||||
use Doctrine\ORM\Proxy\Proxy as OrmProxy;
|
||||
use Doctrine\ORM\PersistentCollection;
|
||||
use Doctrine\ORM\Proxy\Proxy as OrmProxy;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Caster/EnumStub.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/EnumStub.php
vendored
Executable file → Normal file
56
pfosten/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
vendored
Executable file → Normal file
56
pfosten/vendor/symfony/var-dumper/Caster/ExceptionCaster.php
vendored
Executable file → Normal file
|
|
@ -12,8 +12,8 @@
|
|||
namespace Symfony\Component\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\Debug\Exception\SilencedErrorContext;
|
||||
use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
use Symfony\Component\VarDumper\Exception\ThrowingCasterException;
|
||||
|
||||
/**
|
||||
* Casts common Exception classes to array representation.
|
||||
|
|
@ -71,8 +71,8 @@ class ExceptionCaster
|
|||
|
||||
if (isset($a[$xPrefix.'previous'], $a[$trace]) && $a[$xPrefix.'previous'] instanceof \Exception) {
|
||||
$b = (array) $a[$xPrefix.'previous'];
|
||||
self::traceUnshift($b[$xPrefix.'trace'], get_class($a[$xPrefix.'previous']), $b[$prefix.'file'], $b[$prefix.'line']);
|
||||
$a[$trace] = new TraceStub($b[$xPrefix.'trace'], false, 0, -count($a[$trace]->value));
|
||||
self::traceUnshift($b[$xPrefix.'trace'], \get_class($a[$xPrefix.'previous']), $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']);
|
||||
|
|
@ -83,7 +83,6 @@ class ExceptionCaster
|
|||
public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$sPrefix = "\0".SilencedErrorContext::class."\0";
|
||||
$xPrefix = "\0Exception\0";
|
||||
|
||||
if (!isset($a[$s = $sPrefix.'severity'])) {
|
||||
return $a;
|
||||
|
|
@ -93,12 +92,17 @@ class ExceptionCaster
|
|||
$a[$s] = new ConstStub(self::$errorTypes[$a[$s]], $a[$s]);
|
||||
}
|
||||
|
||||
$trace = array(
|
||||
$trace = array(array(
|
||||
'file' => $a[$sPrefix.'file'],
|
||||
'line' => $a[$sPrefix.'line'],
|
||||
);
|
||||
unset($a[$sPrefix.'file'], $a[$sPrefix.'line']);
|
||||
$a[Caster::PREFIX_VIRTUAL.'trace'] = new TraceStub(array($trace));
|
||||
));
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
@ -114,7 +118,7 @@ class ExceptionCaster
|
|||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a = array();
|
||||
$j = count($frames);
|
||||
$j = \count($frames);
|
||||
if (0 > $i = $trace->sliceOffset) {
|
||||
$i = max(0, $j + $i);
|
||||
}
|
||||
|
|
@ -123,6 +127,7 @@ class ExceptionCaster
|
|||
}
|
||||
$lastCall = isset($frames[$i]['function']) ? (isset($frames[$i]['class']) ? $frames[0]['class'].$frames[$i]['type'] : '').$frames[$i]['function'].'()' : '';
|
||||
$frames[] = array('function' => '');
|
||||
$collapse = false;
|
||||
|
||||
for ($j += $trace->numberingOffset - $i++; isset($frames[$i]); ++$i, --$j) {
|
||||
$f = $frames[$i];
|
||||
|
|
@ -141,6 +146,13 @@ class ExceptionCaster
|
|||
$f = self::castFrameStub($frame, array(), $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];
|
||||
|
|
@ -158,12 +170,12 @@ class ExceptionCaster
|
|||
} else {
|
||||
$label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$lastCall;
|
||||
}
|
||||
$a[$label] = $frame;
|
||||
$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);
|
||||
$a = \array_slice($a, 0, $trace->sliceLength, true);
|
||||
}
|
||||
|
||||
return $a;
|
||||
|
|
@ -187,19 +199,20 @@ class ExceptionCaster
|
|||
$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['file'] = substr($f['file'], 0, -\strlen($match[0]));
|
||||
$f['line'] = (int) $match[1];
|
||||
}
|
||||
$caller = isset($f['function']) ? sprintf('in %s() on line %d', (isset($f['class']) ? $f['class'].$f['type'] : '').$f['function'], $f['line']) : null;
|
||||
$src = $f['line'];
|
||||
$srcKey = $f['file'];
|
||||
$ellipsis = (new LinkStub($srcKey, 0))->attr;
|
||||
$ellipsisTail = isset($ellipsis['ellipsis-tail']) ? $ellipsis['ellipsis-tail'] : 0;
|
||||
$ellipsis = isset($ellipsis['ellipsis']) ? $ellipsis['ellipsis'] : 0;
|
||||
$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']));
|
||||
$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() : '');
|
||||
|
|
@ -218,11 +231,14 @@ class ExceptionCaster
|
|||
$src = self::extractSource(file_get_contents($f['file']), $f['line'], self::$srcContext, $caller, 'php', $f['file']);
|
||||
$srcKey .= ':'.$f['line'];
|
||||
if ($ellipsis) {
|
||||
$ellipsis += 1 + strlen($f['line']);
|
||||
$ellipsis += 1 + \strlen($f['line']);
|
||||
}
|
||||
}
|
||||
$srcAttr .= '&separator= ';
|
||||
} else {
|
||||
$srcAttr .= '&separator=:';
|
||||
}
|
||||
$srcAttr = $ellipsis ? 'ellipsis-type=path&ellipsis='.$ellipsis.'&ellipsis-tail='.$ellipsisTail : '';
|
||||
$srcAttr .= $ellipsis ? '&ellipsis-type=path&ellipsis='.$ellipsis.'&ellipsis-tail='.$ellipsisTail : '';
|
||||
self::$framesCache[$cacheKey] = $a[$prefix.'src'] = new EnumStub(array("\0~$srcAttr\0$srcKey" => $src));
|
||||
}
|
||||
}
|
||||
|
|
@ -252,7 +268,7 @@ class ExceptionCaster
|
|||
$trace = array();
|
||||
}
|
||||
|
||||
if (!($filter & Caster::EXCLUDE_VERBOSE)) {
|
||||
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']);
|
||||
}
|
||||
|
|
@ -325,7 +341,7 @@ class ExceptionCaster
|
|||
}
|
||||
}
|
||||
$c->attr['lang'] = $lang;
|
||||
$srcLines[sprintf("\0~%d\0", $i + $line - $srcContext)] = $c;
|
||||
$srcLines[sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c;
|
||||
}
|
||||
|
||||
return new EnumStub($srcLines);
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Caster/FrameStub.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/FrameStub.php
vendored
Executable file → Normal file
32
pfosten/vendor/symfony/var-dumper/Caster/LinkStub.php
vendored
Executable file → Normal file
32
pfosten/vendor/symfony/var-dumper/Caster/LinkStub.php
vendored
Executable file → Normal file
|
|
@ -18,6 +18,8 @@ namespace Symfony\Component\VarDumper\Caster;
|
|||
*/
|
||||
class LinkStub extends ConstStub
|
||||
{
|
||||
public $inVendor = false;
|
||||
|
||||
private static $vendorRoots;
|
||||
private static $composerRoots;
|
||||
|
||||
|
|
@ -28,7 +30,7 @@ class LinkStub extends ConstStub
|
|||
if (null === $href) {
|
||||
$href = $label;
|
||||
}
|
||||
if (!is_string($href)) {
|
||||
if (!\is_string($href)) {
|
||||
return;
|
||||
}
|
||||
if (0 === strpos($href, 'file://')) {
|
||||
|
|
@ -50,12 +52,12 @@ class LinkStub extends ConstStub
|
|||
if ($label !== $this->attr['file'] = realpath($href) ?: $href) {
|
||||
return;
|
||||
}
|
||||
if ($composerRoot = $this->getComposerRoot($href, $inVendor)) {
|
||||
$this->attr['ellipsis'] = strlen($href) - strlen($composerRoot) + 1;
|
||||
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 + ($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-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;
|
||||
}
|
||||
|
|
@ -69,16 +71,16 @@ class LinkStub extends ConstStub
|
|||
foreach (get_declared_classes() as $class) {
|
||||
if ('C' === $class[0] && 0 === strpos($class, 'ComposerAutoloaderInit')) {
|
||||
$r = new \ReflectionClass($class);
|
||||
$v = dirname(dirname($r->getFileName()));
|
||||
$v = \dirname(\dirname($r->getFileName()));
|
||||
if (file_exists($v.'/composer/installed.json')) {
|
||||
self::$vendorRoots[] = $v.DIRECTORY_SEPARATOR;
|
||||
self::$vendorRoots[] = $v.\DIRECTORY_SEPARATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$inVendor = false;
|
||||
|
||||
if (isset(self::$composerRoots[$dir = dirname($file)])) {
|
||||
if (isset(self::$composerRoots[$dir = \dirname($file)])) {
|
||||
return self::$composerRoots[$dir];
|
||||
}
|
||||
|
||||
|
|
@ -89,14 +91,18 @@ class LinkStub extends ConstStub
|
|||
}
|
||||
|
||||
$parent = $dir;
|
||||
while (!file_exists($parent.'/composer.json')) {
|
||||
if ($parent === dirname($parent)) {
|
||||
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);
|
||||
$parent = \dirname($parent);
|
||||
}
|
||||
|
||||
return self::$composerRoots[$dir] = $parent.DIRECTORY_SEPARATOR;
|
||||
return self::$composerRoots[$dir] = $parent.\DIRECTORY_SEPARATOR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
pfosten/vendor/symfony/var-dumper/Caster/MongoCaster.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Caster/MongoCaster.php
vendored
Executable file → Normal file
|
|
@ -13,10 +13,14 @@ namespace Symfony\Component\VarDumper\Caster;
|
|||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
@trigger_error('The '.__NAMESPACE__.'\MongoCaster class is deprecated since Symfony 3.4 and will be removed in 4.0.', E_USER_DEPRECATED);
|
||||
|
||||
/**
|
||||
* Casts classes from the MongoDb extension to array representation.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @deprecated since version 3.4, to be removed in 4.0.
|
||||
*/
|
||||
class MongoCaster
|
||||
{
|
||||
|
|
|
|||
2
pfosten/vendor/symfony/var-dumper/Caster/PdoCaster.php
vendored
Executable file → Normal file
2
pfosten/vendor/symfony/var-dumper/Caster/PdoCaster.php
vendored
Executable file → Normal file
|
|
@ -70,7 +70,7 @@ class PdoCaster
|
|||
}
|
||||
|
||||
try {
|
||||
$attr[$k] = 'ERRMODE' === $k ? $errmode : $c->getAttribute(constant('PDO::ATTR_'.$k));
|
||||
$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]);
|
||||
}
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/PgSqlCaster.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Caster/RedisCaster.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Caster/RedisCaster.php
vendored
Executable file → Normal file
|
|
@ -30,7 +30,7 @@ class RedisCaster
|
|||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
if (defined('HHVM_VERSION_ID')) {
|
||||
if (\defined('HHVM_VERSION_ID')) {
|
||||
if (isset($a[Caster::PREFIX_PROTECTED.'serializer'])) {
|
||||
$ser = $a[Caster::PREFIX_PROTECTED.'serializer'];
|
||||
$a[Caster::PREFIX_PROTECTED.'serializer'] = isset(self::$serializer[$ser]) ? new ConstStub(self::$serializer[$ser], $ser) : $ser;
|
||||
|
|
@ -46,7 +46,7 @@ class RedisCaster
|
|||
}
|
||||
|
||||
$ser = $c->getOption(\Redis::OPT_SERIALIZER);
|
||||
$retry = defined('Redis::OPT_SCAN') ? $c->getOption(\Redis::OPT_SCAN) : 0;
|
||||
$retry = \defined('Redis::OPT_SCAN') ? $c->getOption(\Redis::OPT_SCAN) : 0;
|
||||
|
||||
return $a + array(
|
||||
$prefix.'isConnected' => $connected,
|
||||
|
|
|
|||
4
pfosten/vendor/symfony/var-dumper/Caster/ReflectionCaster.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Caster/ReflectionCaster.php
vendored
Executable file → Normal file
|
|
@ -122,7 +122,7 @@ class ReflectionCaster
|
|||
$function = new FrameStub($frame, false, true);
|
||||
$function = ExceptionCaster::castFrameStub($function, array(), $function, true);
|
||||
$a[$prefix.'executing'] = new EnumStub(array(
|
||||
$frame['class'].$frame['type'].$frame['function'].'()' => $function[$prefix.'src'],
|
||||
"\0~separator= \0".$frame['class'].$frame['type'].$frame['function'].'()' => $function[$prefix.'src'],
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -199,7 +199,7 @@ class ReflectionCaster
|
|||
|
||||
if ($v = $c->getStaticVariables()) {
|
||||
foreach ($v as $k => &$v) {
|
||||
if (is_object($v)) {
|
||||
if (\is_object($v)) {
|
||||
$a[$prefix.'use']['$'.$k] = new CutStub($v);
|
||||
} else {
|
||||
$a[$prefix.'use']['$'.$k] = &$v;
|
||||
|
|
|
|||
2
pfosten/vendor/symfony/var-dumper/Caster/ResourceCaster.php
vendored
Executable file → Normal file
2
pfosten/vendor/symfony/var-dumper/Caster/ResourceCaster.php
vendored
Executable file → Normal file
|
|
@ -50,7 +50,7 @@ class ResourceCaster
|
|||
|
||||
public static function castStreamContext($stream, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
return stream_context_get_params($stream);
|
||||
return @stream_context_get_params($stream) ?: $a;
|
||||
}
|
||||
|
||||
public static function castGd($gd, array $a, Stub $stub, $isNested)
|
||||
|
|
|
|||
58
pfosten/vendor/symfony/var-dumper/Caster/SplCaster.php
vendored
Executable file → Normal file
58
pfosten/vendor/symfony/var-dumper/Caster/SplCaster.php
vendored
Executable file → Normal file
|
|
@ -29,30 +29,12 @@ class SplCaster
|
|||
|
||||
public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$class = $stub->class;
|
||||
$flags = $c->getFlags();
|
||||
return self::castSplArray($c, $a, $stub, $isNested);
|
||||
}
|
||||
|
||||
$b = array(
|
||||
$prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST),
|
||||
$prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS),
|
||||
$prefix.'iteratorClass' => new ClassStub($c->getIteratorClass()),
|
||||
$prefix.'storage' => $c->getArrayCopy(),
|
||||
);
|
||||
|
||||
if ($class === 'ArrayObject') {
|
||||
$a = $b;
|
||||
} else {
|
||||
if (!($flags & \ArrayObject::STD_PROP_LIST)) {
|
||||
$c->setFlags(\ArrayObject::STD_PROP_LIST);
|
||||
$a = Caster::castObject($c, $class);
|
||||
$c->setFlags($flags);
|
||||
}
|
||||
|
||||
$a += $b;
|
||||
}
|
||||
|
||||
return $a;
|
||||
public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
return self::castSplArray($c, $a, $stub, $isNested);
|
||||
}
|
||||
|
||||
public static function castHeap(\Iterator $c, array $a, Stub $stub, $isNested)
|
||||
|
|
@ -184,10 +166,11 @@ class SplCaster
|
|||
$storage = array();
|
||||
unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967
|
||||
|
||||
foreach ($c as $obj) {
|
||||
$storage[spl_object_hash($obj)] = array(
|
||||
$clone = clone $c;
|
||||
foreach ($clone as $obj) {
|
||||
$storage[] = array(
|
||||
'object' => $obj,
|
||||
'info' => $c->getInfo(),
|
||||
'info' => $clone->getInfo(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -204,4 +187,27 @@ class SplCaster
|
|||
|
||||
return $a;
|
||||
}
|
||||
|
||||
private static function castSplArray($c, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$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 += array(
|
||||
$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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
pfosten/vendor/symfony/var-dumper/Caster/StubCaster.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Caster/StubCaster.php
vendored
Executable file → Normal file
|
|
@ -30,7 +30,7 @@ class StubCaster
|
|||
$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)) {
|
||||
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;
|
||||
}
|
||||
|
|
@ -49,7 +49,7 @@ class StubCaster
|
|||
public static function cutInternals($obj, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
if ($isNested) {
|
||||
$stub->cut += count($a);
|
||||
$stub->cut += \count($a);
|
||||
|
||||
return array();
|
||||
}
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Caster/SymfonyCaster.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/SymfonyCaster.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/TraceStub.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/TraceStub.php
vendored
Executable file → Normal file
48
pfosten/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
vendored
Executable file → Normal file
48
pfosten/vendor/symfony/var-dumper/Caster/XmlReaderCaster.php
vendored
Executable file → Normal file
|
|
@ -20,27 +20,27 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
|||
class XmlReaderCaster
|
||||
{
|
||||
private static $nodeTypes = array(
|
||||
\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',
|
||||
\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, $isNested)
|
||||
public static function castXmlReader(\XMLReader $reader, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$props = Caster::PREFIX_VIRTUAL.'parserProperties';
|
||||
$info = array(
|
||||
|
|
@ -49,17 +49,17 @@ class XmlReaderCaster
|
|||
'nodeType' => new ConstStub(self::$nodeTypes[$reader->nodeType], $reader->nodeType),
|
||||
'depth' => $reader->depth,
|
||||
'isDefault' => $reader->isDefault,
|
||||
'isEmptyElement' => \XmlReader::NONE === $reader->nodeType ? null : $reader->isEmptyElement,
|
||||
'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 => array(
|
||||
'LOADDTD' => $reader->getParserProperty(\XmlReader::LOADDTD),
|
||||
'DEFAULTATTRS' => $reader->getParserProperty(\XmlReader::DEFAULTATTRS),
|
||||
'VALIDATE' => $reader->getParserProperty(\XmlReader::VALIDATE),
|
||||
'SUBST_ENTITIES' => $reader->getParserProperty(\XmlReader::SUBST_ENTITIES),
|
||||
'LOADDTD' => $reader->getParserProperty(\XMLReader::LOADDTD),
|
||||
'DEFAULTATTRS' => $reader->getParserProperty(\XMLReader::DEFAULTATTRS),
|
||||
'VALIDATE' => $reader->getParserProperty(\XMLReader::VALIDATE),
|
||||
'SUBST_ENTITIES' => $reader->getParserProperty(\XMLReader::SUBST_ENTITIES),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Caster/XmlResourceCaster.php
vendored
Executable file → Normal file
48
pfosten/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
vendored
Executable file → Normal file
48
pfosten/vendor/symfony/var-dumper/Cloner/AbstractCloner.php
vendored
Executable file → Normal file
|
|
@ -95,6 +95,7 @@ abstract class AbstractCloner implements ClonerInterface
|
|||
'AMQPEnvelope' => array('Symfony\Component\VarDumper\Caster\AmqpCaster', 'castEnvelope'),
|
||||
|
||||
'ArrayObject' => array('Symfony\Component\VarDumper\Caster\SplCaster', 'castArrayObject'),
|
||||
'ArrayIterator' => array('Symfony\Component\VarDumper\Caster\SplCaster', 'castArrayIterator'),
|
||||
'SplDoublyLinkedList' => array('Symfony\Component\VarDumper\Caster\SplCaster', 'castDoublyLinkedList'),
|
||||
'SplFileInfo' => array('Symfony\Component\VarDumper\Caster\SplCaster', 'castFileInfo'),
|
||||
'SplFileObject' => array('Symfony\Component\VarDumper\Caster\SplCaster', 'castFileObject'),
|
||||
|
|
@ -109,6 +110,11 @@ abstract class AbstractCloner implements ClonerInterface
|
|||
'Redis' => array('Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'),
|
||||
'RedisArray' => array('Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'),
|
||||
|
||||
'DateTimeInterface' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castDateTime'),
|
||||
'DateInterval' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castInterval'),
|
||||
'DateTimeZone' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castTimeZone'),
|
||||
'DatePeriod' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castPeriod'),
|
||||
|
||||
':curl' => array('Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'),
|
||||
':dba' => array('Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'),
|
||||
':dba persistent' => array('Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'),
|
||||
|
|
@ -127,6 +133,7 @@ abstract class AbstractCloner implements ClonerInterface
|
|||
|
||||
protected $maxItems = 2500;
|
||||
protected $maxString = -1;
|
||||
protected $minDepth = 1;
|
||||
protected $useExt;
|
||||
|
||||
private $casters = array();
|
||||
|
|
@ -145,7 +152,7 @@ abstract class AbstractCloner implements ClonerInterface
|
|||
$casters = static::$defaultCasters;
|
||||
}
|
||||
$this->addCasters($casters);
|
||||
$this->useExt = extension_loaded('symfony_debug');
|
||||
$this->useExt = \extension_loaded('symfony_debug');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -161,12 +168,12 @@ abstract class AbstractCloner implements ClonerInterface
|
|||
public function addCasters(array $casters)
|
||||
{
|
||||
foreach ($casters as $type => $callback) {
|
||||
$this->casters[strtolower($type)][] = is_string($callback) && false !== strpos($callback, '::') ? explode('::', $callback, 2) : $callback;
|
||||
$this->casters[strtolower($type)][] = \is_string($callback) && false !== strpos($callback, '::') ? explode('::', $callback, 2) : $callback;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the maximum number of items to clone past the first level in nested structures.
|
||||
* Sets the maximum number of items to clone past the minimum depth in nested structures.
|
||||
*
|
||||
* @param int $maxItems
|
||||
*/
|
||||
|
|
@ -185,6 +192,17 @@ abstract class AbstractCloner implements ClonerInterface
|
|||
$this->maxString = (int) $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.
|
||||
*
|
||||
* @param int $minDepth
|
||||
*/
|
||||
public function setMinDepth($minDepth)
|
||||
{
|
||||
$this->minDepth = (int) $minDepth;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clones a PHP variable.
|
||||
*
|
||||
|
|
@ -195,32 +213,32 @@ abstract class AbstractCloner implements ClonerInterface
|
|||
*/
|
||||
public function cloneVar($var, $filter = 0)
|
||||
{
|
||||
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context) {
|
||||
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) {
|
||||
if (E_RECOVERABLE_ERROR === $type || E_USER_ERROR === $type) {
|
||||
// Cloner never dies
|
||||
throw new \ErrorException($msg, 0, $type, $file, $line);
|
||||
}
|
||||
|
||||
if ($this->prevErrorHandler) {
|
||||
return call_user_func($this->prevErrorHandler, $type, $msg, $file, $line, $context);
|
||||
return \call_user_func($this->prevErrorHandler, $type, $msg, $file, $line, $context);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
$this->filter = $filter;
|
||||
|
||||
if ($gc = gc_enabled()) {
|
||||
gc_disable();
|
||||
}
|
||||
try {
|
||||
$data = $this->doClone($var);
|
||||
} catch (\Exception $e) {
|
||||
return new Data($this->doClone($var));
|
||||
} finally {
|
||||
if ($gc) {
|
||||
gc_enable();
|
||||
}
|
||||
restore_error_handler();
|
||||
$this->prevErrorHandler = null;
|
||||
}
|
||||
restore_error_handler();
|
||||
$this->prevErrorHandler = null;
|
||||
|
||||
if (isset($e)) {
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return new Data($data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Cloner/ClonerInterface.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Cloner/ClonerInterface.php
vendored
Executable file → Normal file
1
pfosten/vendor/symfony/var-dumper/Cloner/Cursor.php
vendored
Executable file → Normal file
1
pfosten/vendor/symfony/var-dumper/Cloner/Cursor.php
vendored
Executable file → Normal file
|
|
@ -39,4 +39,5 @@ class Cursor
|
|||
public $hashCut = 0;
|
||||
public $stop = false;
|
||||
public $attr = array();
|
||||
public $skipChildren = false;
|
||||
}
|
||||
|
|
|
|||
82
pfosten/vendor/symfony/var-dumper/Cloner/Data.php
vendored
Executable file → Normal file
82
pfosten/vendor/symfony/var-dumper/Cloner/Data.php
vendored
Executable file → Normal file
|
|
@ -26,7 +26,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
private $useRefHandles = -1;
|
||||
|
||||
/**
|
||||
* @param array $data A array as returned by ClonerInterface::cloneVar()
|
||||
* @param array $data An array as returned by ClonerInterface::cloneVar()
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
|
|
@ -34,7 +34,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string The type of the value.
|
||||
* @return string The type of the value
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
|
|
@ -44,7 +44,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
$item = $item->value;
|
||||
}
|
||||
if (!$item instanceof Stub) {
|
||||
return gettype($item);
|
||||
return \gettype($item);
|
||||
}
|
||||
if (Stub::TYPE_STRING === $item->type) {
|
||||
return 'string';
|
||||
|
|
@ -61,9 +61,9 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
}
|
||||
|
||||
/**
|
||||
* @param bool $recursive Whether values should be resolved recursively or not.
|
||||
* @param bool $recursive Whether values should be resolved recursively or not
|
||||
*
|
||||
* @return scalar|array|null|Data[] A native representation of the original value.
|
||||
* @return string|int|float|bool|array|null|Data[] A native representation of the original value
|
||||
*/
|
||||
public function getValue($recursive = false)
|
||||
{
|
||||
|
|
@ -72,7 +72,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
|
||||
$item = $item->value;
|
||||
}
|
||||
if (!$item instanceof Stub) {
|
||||
if (!($item = $this->getStub($item)) instanceof Stub) {
|
||||
return $item;
|
||||
}
|
||||
if (Stub::TYPE_STRING === $item->type) {
|
||||
|
|
@ -82,7 +82,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
$children = $item->position ? $this->data[$item->position] : array();
|
||||
|
||||
foreach ($children as $k => $v) {
|
||||
if ($recursive && !$v instanceof Stub) {
|
||||
if ($recursive && !($v = $this->getStub($v)) instanceof Stub) {
|
||||
continue;
|
||||
}
|
||||
$children[$k] = clone $this;
|
||||
|
|
@ -90,12 +90,12 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
$children[$k]->position = $item->position;
|
||||
|
||||
if ($recursive) {
|
||||
if ($v instanceof Stub && Stub::TYPE_REF === $v->type && $v->value instanceof Stub) {
|
||||
if (Stub::TYPE_REF === $v->type && ($v = $this->getStub($v->value)) instanceof Stub) {
|
||||
$recursive = (array) $recursive;
|
||||
if (isset($recursive[$v->value->position])) {
|
||||
if (isset($recursive[$v->position])) {
|
||||
continue;
|
||||
}
|
||||
$recursive[$v->value->position] = true;
|
||||
$recursive[$v->position] = true;
|
||||
}
|
||||
$children[$k] = $children[$k]->getValue($recursive);
|
||||
}
|
||||
|
|
@ -106,13 +106,13 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
|
||||
public function count()
|
||||
{
|
||||
return count($this->getValue());
|
||||
return \count($this->getValue());
|
||||
}
|
||||
|
||||
public function getIterator()
|
||||
{
|
||||
if (!is_array($value = $this->getValue())) {
|
||||
throw new \LogicException(sprintf('%s object holds non-iterable type "%s".', self::class, gettype($value)));
|
||||
if (!\is_array($value = $this->getValue())) {
|
||||
throw new \LogicException(sprintf('%s object holds non-iterable type "%s".', self::class, \gettype($value)));
|
||||
}
|
||||
|
||||
foreach ($value as $k => $v) {
|
||||
|
|
@ -123,7 +123,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
public function __get($key)
|
||||
{
|
||||
if (null !== $data = $this->seek($key)) {
|
||||
$item = $data->data[$data->position][$data->key];
|
||||
$item = $this->getStub($data->data[$data->position][$data->key]);
|
||||
|
||||
return $item instanceof Stub || array() === $item ? $data : $item;
|
||||
}
|
||||
|
|
@ -158,11 +158,11 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
{
|
||||
$value = $this->getValue();
|
||||
|
||||
if (!is_array($value)) {
|
||||
if (!\is_array($value)) {
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
return sprintf('%s (count=%d)', $this->getType(), count($value));
|
||||
return sprintf('%s (count=%d)', $this->getType(), \count($value));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -172,7 +172,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
*/
|
||||
public function getRawData()
|
||||
{
|
||||
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__));
|
||||
@trigger_error(sprintf('The "%s()" method is deprecated since Symfony 3.3 and will be removed in 4.0. Use the array or object access instead.', __METHOD__));
|
||||
|
||||
return $this->data;
|
||||
}
|
||||
|
|
@ -227,7 +227,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
*
|
||||
* @param string|int $key The key to seek to
|
||||
*
|
||||
* @return self|null A clone of $this of null if the key is not set
|
||||
* @return self|null A clone of $this or null if the key is not set
|
||||
*/
|
||||
public function seek($key)
|
||||
{
|
||||
|
|
@ -236,7 +236,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
if ($item instanceof Stub && Stub::TYPE_REF === $item->type && !$item->position) {
|
||||
$item = $item->value;
|
||||
}
|
||||
if (!$item instanceof Stub || !$item->position) {
|
||||
if (!($item = $this->getStub($item)) instanceof Stub || !$item->position) {
|
||||
return;
|
||||
}
|
||||
$keys = array($key);
|
||||
|
|
@ -247,6 +247,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
$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;
|
||||
|
|
@ -295,7 +296,10 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
|
||||
if (!$item instanceof Stub) {
|
||||
$cursor->attr = array();
|
||||
$type = gettype($item);
|
||||
$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)])) {
|
||||
|
|
@ -308,8 +312,8 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
$cursor->hardRefCount = $item->refCount;
|
||||
}
|
||||
$cursor->attr = $item->attr;
|
||||
$type = $item->class ?: gettype($item->value);
|
||||
$item = $item->value;
|
||||
$type = $item->class ?: \gettype($item->value);
|
||||
$item = $this->getStub($item->value);
|
||||
}
|
||||
if ($item instanceof Stub) {
|
||||
if ($item->refCount) {
|
||||
|
|
@ -330,7 +334,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
|
||||
if ($cursor->stop) {
|
||||
if ($cut >= 0) {
|
||||
$cut += count($children);
|
||||
$cut += \count($children);
|
||||
}
|
||||
$children = array();
|
||||
}
|
||||
|
|
@ -346,16 +350,22 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
$item = clone $item;
|
||||
$item->type = $item->class;
|
||||
$item->class = $item->value;
|
||||
// No break;
|
||||
// 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) {
|
||||
$cut = $this->dumpChildren($dumper, $cursor, $refs, $children, $cut, $item->type, null !== $item->class);
|
||||
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);
|
||||
$cut += \count($children);
|
||||
}
|
||||
$cursor->skipChildren = false;
|
||||
$dumper->leaveHash($cursor, $item->type, $item->class, $withChildren, $cut);
|
||||
break;
|
||||
|
||||
|
|
@ -391,7 +401,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
++$cursor->depth;
|
||||
$cursor->hashType = $hashType;
|
||||
$cursor->hashIndex = 0;
|
||||
$cursor->hashLength = count($children);
|
||||
$cursor->hashLength = \count($children);
|
||||
$cursor->hashCut = $hashCut;
|
||||
foreach ($children as $key => $child) {
|
||||
$cursor->hashKeyIsBinary = isset($key[0]) && !preg_match('//u', $key);
|
||||
|
|
@ -406,4 +416,22 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
6
pfosten/vendor/symfony/var-dumper/Cloner/DumperInterface.php
vendored
Executable file → Normal file
6
pfosten/vendor/symfony/var-dumper/Cloner/DumperInterface.php
vendored
Executable file → Normal file
|
|
@ -21,9 +21,9 @@ interface DumperInterface
|
|||
/**
|
||||
* Dumps a scalar value.
|
||||
*
|
||||
* @param Cursor $cursor The Cursor position in the dump
|
||||
* @param string $type The PHP type of the value being dumped
|
||||
* @param scalar $value The scalar value being dumped
|
||||
* @param Cursor $cursor The Cursor position in the dump
|
||||
* @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, $type, $value);
|
||||
|
||||
|
|
|
|||
36
pfosten/vendor/symfony/var-dumper/Cloner/Stub.php
vendored
Executable file → Normal file
36
pfosten/vendor/symfony/var-dumper/Cloner/Stub.php
vendored
Executable file → Normal file
|
|
@ -16,19 +16,19 @@ namespace Symfony\Component\VarDumper\Cloner;
|
|||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class Stub
|
||||
class Stub implements \Serializable
|
||||
{
|
||||
const TYPE_REF = 'ref';
|
||||
const TYPE_STRING = 'string';
|
||||
const TYPE_ARRAY = 'array';
|
||||
const TYPE_OBJECT = 'object';
|
||||
const TYPE_RESOURCE = 'resource';
|
||||
const TYPE_REF = 1;
|
||||
const TYPE_STRING = 2;
|
||||
const TYPE_ARRAY = 3;
|
||||
const TYPE_OBJECT = 4;
|
||||
const TYPE_RESOURCE = 5;
|
||||
|
||||
const STRING_BINARY = 'bin';
|
||||
const STRING_UTF8 = 'utf8';
|
||||
const STRING_BINARY = 1;
|
||||
const STRING_UTF8 = 2;
|
||||
|
||||
const ARRAY_ASSOC = 'assoc';
|
||||
const ARRAY_INDEXED = 'indexed';
|
||||
const ARRAY_ASSOC = 1;
|
||||
const ARRAY_INDEXED = 2;
|
||||
|
||||
public $type = self::TYPE_REF;
|
||||
public $class = '';
|
||||
|
|
@ -38,4 +38,20 @@ class Stub
|
|||
public $refCount = 0;
|
||||
public $position = 0;
|
||||
public $attr = array();
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
return \serialize(array($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr));
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
list($this->class, $this->position, $this->cut, $this->type, $this->value, $this->handle, $this->refCount, $this->attr) = \unserialize($serialized);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
255
pfosten/vendor/symfony/var-dumper/Cloner/VarCloner.php
vendored
Executable file → Normal file
255
pfosten/vendor/symfony/var-dumper/Cloner/VarCloner.php
vendored
Executable file → Normal file
|
|
@ -16,117 +16,148 @@ namespace Symfony\Component\VarDumper\Cloner;
|
|||
*/
|
||||
class VarCloner extends AbstractCloner
|
||||
{
|
||||
private static $gid;
|
||||
private static $hashMask = 0;
|
||||
private static $hashOffset = 0;
|
||||
private static $arrayCache = array();
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function doClone($var)
|
||||
{
|
||||
$useExt = $this->useExt;
|
||||
$len = 1; // Length of $queue
|
||||
$pos = 0; // Number of cloned items past the first level
|
||||
$pos = 0; // Number of cloned items past the minimum depth
|
||||
$refsCounter = 0; // Hard references counter
|
||||
$queue = array(array($var)); // This breadth-first queue is the return value
|
||||
$arrayRefs = array(); // Map of queue indexes to stub array objects
|
||||
$indexedArrays = array(); // Map of queue indexes that hold numerically indexed arrays
|
||||
$hardRefs = array(); // Map of original zval hashes to stub objects
|
||||
$objRefs = array(); // Map of original object handles to their stub object couterpart
|
||||
$resRefs = array(); // Map of original resource handles to their stub object couterpart
|
||||
$values = array(); // Map of stub objects' hashes 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) array(); // Unique object used to detect hard references
|
||||
$gid = uniqid(mt_rand(), true); // Unique string used to detect the special $GLOBALS variable
|
||||
$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
|
||||
$zval = array( // Main properties of the current value
|
||||
'type' => null,
|
||||
'zval_isref' => null,
|
||||
'zval_hash' => null,
|
||||
'array_count' => null,
|
||||
'object_class' => null,
|
||||
'object_handle' => null,
|
||||
'resource_type' => null,
|
||||
);
|
||||
|
||||
if (!self::$hashMask) {
|
||||
self::$gid = uniqid(mt_rand(), true); // Unique string used to detect the special $GLOBALS variable
|
||||
self::initHashMask();
|
||||
}
|
||||
$gid = self::$gid;
|
||||
$hashMask = self::$hashMask;
|
||||
$hashOffset = self::$hashOffset;
|
||||
$arrayStub = new Stub();
|
||||
$arrayStub->type = Stub::TYPE_ARRAY;
|
||||
$fromObjCast = false;
|
||||
|
||||
for ($i = 0; $i < $len; ++$i) {
|
||||
$indexed = true; // Whether the currently iterated array is numerically indexed or not
|
||||
$j = -1; // Position in the currently iterated array
|
||||
$fromObjCast = array_keys($queue[$i]);
|
||||
$fromObjCast = array_keys(array_flip($fromObjCast)) !== $fromObjCast;
|
||||
$refs = $vals = $fromObjCast ? array_values($queue[$i]) : $queue[$i];
|
||||
foreach ($queue[$i] as $k => $v) {
|
||||
// $k is the original key
|
||||
// $v is the original value or a stub object in case of hard references
|
||||
if ($k !== ++$j) {
|
||||
$indexed = false;
|
||||
// Detect when we move on to the next tree depth
|
||||
if ($i > $currentDepthFinalIndex) {
|
||||
++$currentDepth;
|
||||
$currentDepthFinalIndex = $len - 1;
|
||||
if ($currentDepth >= $minDepth) {
|
||||
$minimumDepthReached = true;
|
||||
}
|
||||
if ($fromObjCast) {
|
||||
$k = $j;
|
||||
}
|
||||
if ($useExt) {
|
||||
$zval = symfony_zval_info($k, $refs);
|
||||
} else {
|
||||
$refs[$k] = $cookie;
|
||||
if ($zval['zval_isref'] = $vals[$k] === $cookie) {
|
||||
$zval['zval_hash'] = $v instanceof Stub ? spl_object_hash($v) : null;
|
||||
}
|
||||
|
||||
$refs = $vals = $queue[$i];
|
||||
if (\PHP_VERSION_ID < 70200 && empty($indexedArrays[$i])) {
|
||||
// see https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts
|
||||
foreach ($vals as $k => $v) {
|
||||
if (\is_int($k)) {
|
||||
continue;
|
||||
}
|
||||
foreach (array($k => true) as $gk => $gv) {
|
||||
}
|
||||
if ($gk !== $k) {
|
||||
$fromObjCast = true;
|
||||
$refs = $vals = \array_values($queue[$i]);
|
||||
break;
|
||||
}
|
||||
$zval['type'] = gettype($v);
|
||||
}
|
||||
if ($zval['zval_isref']) {
|
||||
}
|
||||
foreach ($vals as $k => $v) {
|
||||
// $v is the original value or a stub object in case of hard references
|
||||
$refs[$k] = $cookie;
|
||||
if ($zvalIsRef = $vals[$k] === $cookie) {
|
||||
$vals[$k] = &$stub; // Break hard references to make $queue completely
|
||||
unset($stub); // independent from the original structure
|
||||
if (isset($hardRefs[$zval['zval_hash']])) {
|
||||
$vals[$k] = $useExt ? ($v = $hardRefs[$zval['zval_hash']]) : ($refs[$k] = $v);
|
||||
if ($v instanceof Stub && isset($hardRefs[\spl_object_hash($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_hash($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 ($zval['type']) {
|
||||
case 'string':
|
||||
if (isset($v[0]) && !preg_match('//u', $v)) {
|
||||
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) {
|
||||
if (0 <= $maxString && 0 < $cut = \strlen($v) - $maxString) {
|
||||
$stub->cut = $cut;
|
||||
$stub->value = substr($v, 0, -$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) {
|
||||
} 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');
|
||||
$stub->value = \mb_substr($v, 0, $maxString, 'UTF-8');
|
||||
} else {
|
||||
continue 2;
|
||||
}
|
||||
$a = null;
|
||||
break;
|
||||
|
||||
case 'integer':
|
||||
break;
|
||||
case \is_array($v):
|
||||
if (!$v) {
|
||||
continue 2;
|
||||
}
|
||||
$stub = $arrayStub;
|
||||
$stub->class = Stub::ARRAY_INDEXED;
|
||||
|
||||
case 'array':
|
||||
if ($v) {
|
||||
$stub = $arrayRefs[$len] = new Stub();
|
||||
$stub->type = Stub::TYPE_ARRAY;
|
||||
$stub->class = Stub::ARRAY_ASSOC;
|
||||
$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 = $v;
|
||||
$a[$gid] = true;
|
||||
|
||||
// Happens with copies of $GLOBALS
|
||||
|
|
@ -136,19 +167,21 @@ class VarCloner extends AbstractCloner
|
|||
foreach ($v as $gk => &$gv) {
|
||||
$a[$gk] = &$gv;
|
||||
}
|
||||
unset($gv);
|
||||
} else {
|
||||
$a = $v;
|
||||
}
|
||||
|
||||
$stub->value = $zval['array_count'] ?: count($a);
|
||||
} elseif (\PHP_VERSION_ID < 70200) {
|
||||
$indexedArrays[$len] = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'object':
|
||||
if (empty($objRefs[$h = $zval['object_handle'] ?: ($hashMask ^ hexdec(substr(spl_object_hash($v), $hashOffset, PHP_INT_SIZE)))])) {
|
||||
case \is_object($v):
|
||||
case $v instanceof \__PHP_Incomplete_Class:
|
||||
if (empty($objRefs[$h = $hashMask ^ \hexdec(\substr(\spl_object_hash($v), $hashOffset, \PHP_INT_SIZE))])) {
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_OBJECT;
|
||||
$stub->class = $zval['object_class'] ?: get_class($v);
|
||||
$stub->class = \get_class($v);
|
||||
$stub->value = $v;
|
||||
$stub->handle = $h;
|
||||
$a = $this->castObject($stub, 0 < $i);
|
||||
|
|
@ -156,18 +189,12 @@ class VarCloner extends AbstractCloner
|
|||
if (Stub::TYPE_OBJECT !== $stub->type || null === $stub->value) {
|
||||
break;
|
||||
}
|
||||
if ($useExt) {
|
||||
$zval['type'] = $stub->value;
|
||||
$zval = symfony_zval_info('type', $zval);
|
||||
$h = $zval['object_handle'];
|
||||
} else {
|
||||
$h = $hashMask ^ hexdec(substr(spl_object_hash($stub->value), $hashOffset, PHP_INT_SIZE));
|
||||
}
|
||||
$h = $hashMask ^ \hexdec(\substr(\spl_object_hash($stub->value), $hashOffset, \PHP_INT_SIZE));
|
||||
$stub->handle = $h;
|
||||
}
|
||||
$stub->value = null;
|
||||
if (0 <= $maxItems && $maxItems <= $pos) {
|
||||
$stub->cut = count($a);
|
||||
if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
|
||||
$stub->cut = \count($a);
|
||||
$a = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -180,21 +207,19 @@ class VarCloner extends AbstractCloner
|
|||
}
|
||||
break;
|
||||
|
||||
case 'resource':
|
||||
case 'unknown type':
|
||||
case 'resource (closed)':
|
||||
default: // resource
|
||||
if (empty($resRefs[$h = (int) $v])) {
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_RESOURCE;
|
||||
if ('Unknown' === $stub->class = $zval['resource_type'] ?: @get_resource_type($v)) {
|
||||
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) {
|
||||
$stub->cut = count($a);
|
||||
if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
|
||||
$stub->cut = \count($a);
|
||||
$a = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -208,69 +233,52 @@ class VarCloner extends AbstractCloner
|
|||
break;
|
||||
}
|
||||
|
||||
if (isset($stub)) {
|
||||
if ($zval['zval_isref']) {
|
||||
if ($useExt) {
|
||||
$vals[$k] = $hardRefs[$zval['zval_hash']] = $v = new Stub();
|
||||
$v->value = $stub;
|
||||
} else {
|
||||
$refs[$k] = new Stub();
|
||||
$refs[$k]->value = $stub;
|
||||
$h = spl_object_hash($refs[$k]);
|
||||
$vals[$k] = $hardRefs[$h] = &$refs[$k];
|
||||
$values[$h] = $v;
|
||||
}
|
||||
$vals[$k]->handle = ++$refsCounter;
|
||||
} else {
|
||||
$vals[$k] = $stub;
|
||||
}
|
||||
|
||||
if ($a) {
|
||||
if ($i && 0 <= $maxItems) {
|
||||
$k = count($a);
|
||||
if ($pos < $maxItems) {
|
||||
if ($maxItems < $pos += $k) {
|
||||
$a = array_slice($a, 0, $maxItems - $pos);
|
||||
if ($stub->cut >= 0) {
|
||||
$stub->cut += $pos - $maxItems;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($stub->cut >= 0) {
|
||||
$stub->cut += $k;
|
||||
}
|
||||
$stub = $a = null;
|
||||
unset($arrayRefs[$len]);
|
||||
continue;
|
||||
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;
|
||||
}
|
||||
$stub = $a = null;
|
||||
} elseif ($zval['zval_isref']) {
|
||||
if ($useExt) {
|
||||
$vals[$k] = $hardRefs[$zval['zval_hash']] = new Stub();
|
||||
$vals[$k]->value = $v;
|
||||
}
|
||||
|
||||
if ($arrayStub === $stub) {
|
||||
if ($arrayStub->cut) {
|
||||
$stub = array($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 {
|
||||
$refs[$k] = $vals[$k] = new Stub();
|
||||
$refs[$k]->value = $v;
|
||||
$h = spl_object_hash($refs[$k]);
|
||||
$hardRefs[$h] = &$refs[$k];
|
||||
$values[$h] = $v;
|
||||
self::$arrayCache[$arrayStub->class][$arrayStub->position] = $stub = array($arrayStub->class => $arrayStub->position);
|
||||
}
|
||||
$vals[$k]->handle = ++$refsCounter;
|
||||
}
|
||||
|
||||
if ($zvalIsRef) {
|
||||
$refs[$k]->value = $stub;
|
||||
} else {
|
||||
$vals[$k] = $stub;
|
||||
}
|
||||
}
|
||||
|
||||
if ($fromObjCast) {
|
||||
$fromObjCast = false;
|
||||
$refs = $vals;
|
||||
$vals = array();
|
||||
$j = -1;
|
||||
foreach ($queue[$i] as $k => $v) {
|
||||
foreach (array($k => $v) as $a => $v) {
|
||||
foreach (array($k => true) as $gk => $gv) {
|
||||
}
|
||||
if ($a !== $k) {
|
||||
if ($gk !== $k) {
|
||||
$vals = (object) $vals;
|
||||
$vals->{$k} = $refs[++$j];
|
||||
$vals = (array) $vals;
|
||||
|
|
@ -281,13 +289,6 @@ class VarCloner extends AbstractCloner
|
|||
}
|
||||
|
||||
$queue[$i] = $vals;
|
||||
|
||||
if (isset($arrayRefs[$i])) {
|
||||
if ($indexed) {
|
||||
$arrayRefs[$i]->class = Stub::ARRAY_INDEXED;
|
||||
}
|
||||
unset($arrayRefs[$i]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($values as $h => $v) {
|
||||
|
|
@ -303,13 +304,13 @@ class VarCloner extends AbstractCloner
|
|||
self::$hashOffset = 16 - PHP_INT_SIZE;
|
||||
self::$hashMask = -1;
|
||||
|
||||
if (defined('HHVM_VERSION')) {
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
self::$hashOffset += 16;
|
||||
} else {
|
||||
// check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below
|
||||
$obFuncs = array('ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush');
|
||||
foreach (debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
|
||||
if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && in_array($frame['function'], $obFuncs)) {
|
||||
if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) {
|
||||
$frame['line'] = 0;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
31
pfosten/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
vendored
Executable file → Normal file
31
pfosten/vendor/symfony/var-dumper/Dumper/AbstractDumper.php
vendored
Executable file → Normal file
|
|
@ -46,10 +46,10 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
|||
{
|
||||
$this->flags = (int) $flags;
|
||||
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
|
||||
$this->decimalPoint = (string) 0.5;
|
||||
$this->decimalPoint = $this->decimalPoint[1];
|
||||
$this->decimalPoint = localeconv();
|
||||
$this->decimalPoint = $this->decimalPoint['decimal_point'];
|
||||
$this->setOutput($output ?: static::$defaultOutput);
|
||||
if (!$output && is_string(static::$defaultOutput)) {
|
||||
if (!$output && \is_string(static::$defaultOutput)) {
|
||||
static::$defaultOutput = $this->outputStream;
|
||||
}
|
||||
}
|
||||
|
|
@ -65,11 +65,11 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
|||
{
|
||||
$prev = null !== $this->outputStream ? $this->outputStream : $this->lineDumper;
|
||||
|
||||
if (is_callable($output)) {
|
||||
if (\is_callable($output)) {
|
||||
$this->outputStream = null;
|
||||
$this->lineDumper = $output;
|
||||
} else {
|
||||
if (is_string($output)) {
|
||||
if (\is_string($output)) {
|
||||
$output = fopen($output, 'wb');
|
||||
}
|
||||
$this->outputStream = $output;
|
||||
|
|
@ -101,9 +101,9 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
|||
/**
|
||||
* Sets the indentation pad string.
|
||||
*
|
||||
* @param string $pad A string the will be prepended to dumped lines, repeated by nesting level
|
||||
* @param string $pad A string that will be prepended to dumped lines, repeated by nesting level
|
||||
*
|
||||
* @return string The indent pad
|
||||
* @return string The previous indent pad
|
||||
*/
|
||||
public function setIndentPad($pad)
|
||||
{
|
||||
|
|
@ -123,6 +123,13 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
|||
*/
|
||||
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');
|
||||
}
|
||||
|
|
@ -143,17 +150,21 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
|||
if ($output) {
|
||||
$this->setOutput($prevOutput);
|
||||
}
|
||||
if ($locale) {
|
||||
setlocale(LC_NUMERIC, $locale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dumps the current line.
|
||||
*
|
||||
* @param int $depth The recursive depth in the dumped structure for the line being dumped
|
||||
* @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($depth)
|
||||
{
|
||||
call_user_func($this->lineDumper, $this->line, $depth, $this->indentPad);
|
||||
\call_user_func($this->lineDumper, $this->line, $depth, $this->indentPad);
|
||||
$this->line = '';
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +195,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
|||
return $s;
|
||||
}
|
||||
|
||||
if (!function_exists('iconv')) {
|
||||
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.');
|
||||
}
|
||||
|
||||
|
|
|
|||
153
pfosten/vendor/symfony/var-dumper/Dumper/CliDumper.php
vendored
Executable file → Normal file
153
pfosten/vendor/symfony/var-dumper/Dumper/CliDumper.php
vendored
Executable file → Normal file
|
|
@ -12,6 +12,7 @@
|
|||
namespace Symfony\Component\VarDumper\Dumper;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Cursor;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* CliDumper dumps variables for command line output.
|
||||
|
|
@ -51,6 +52,9 @@ class CliDumper extends AbstractDumper
|
|||
"\033" => '\e',
|
||||
);
|
||||
|
||||
protected $collapseNextHash = false;
|
||||
protected $expandNextHash = false;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
@ -58,7 +62,7 @@ class CliDumper extends AbstractDumper
|
|||
{
|
||||
parent::__construct($output, $charset, $flags);
|
||||
|
||||
if ('\\' === DIRECTORY_SEPARATOR && 'ON' !== @getenv('ConEmuANSI') && 'xterm' !== @getenv('TERM')) {
|
||||
if ('\\' === \DIRECTORY_SEPARATOR && !$this->isWindowsTrueColor()) {
|
||||
// Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI
|
||||
$this->setStyles(array(
|
||||
'default' => '31',
|
||||
|
|
@ -182,7 +186,7 @@ class CliDumper extends AbstractDumper
|
|||
unset($str[1]);
|
||||
$str[0] .= "\n";
|
||||
}
|
||||
$m = count($str) - 1;
|
||||
$m = \count($str) - 1;
|
||||
$i = $lineCut = 0;
|
||||
|
||||
if (self::DUMP_STRING_LENGTH & $this->flags) {
|
||||
|
|
@ -253,6 +257,11 @@ class CliDumper extends AbstractDumper
|
|||
{
|
||||
$this->dumpKey($cursor);
|
||||
|
||||
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).' {' : '{';
|
||||
|
|
@ -328,8 +337,9 @@ class CliDumper extends AbstractDumper
|
|||
break;
|
||||
}
|
||||
$style = 'index';
|
||||
// no break
|
||||
case Cursor::HASH_ASSOC:
|
||||
if (is_int($key)) {
|
||||
if (\is_int($key)) {
|
||||
$this->line .= $this->style($style, $key).' => ';
|
||||
} else {
|
||||
$this->line .= $bin.'"'.$this->style($style, $key).'" => ';
|
||||
|
|
@ -338,7 +348,7 @@ class CliDumper extends AbstractDumper
|
|||
|
||||
case Cursor::HASH_RESOURCE:
|
||||
$key = "\0~\0".$key;
|
||||
// No break;
|
||||
// no break
|
||||
case Cursor::HASH_OBJECT:
|
||||
if (!isset($key[0]) || "\0" !== $key[0]) {
|
||||
$this->line .= '+'.$bin.$this->style('public', $key).': ';
|
||||
|
|
@ -368,7 +378,15 @@ class CliDumper extends AbstractDumper
|
|||
break;
|
||||
}
|
||||
|
||||
$this->line .= $bin.$this->style($style, $key[1], $attr).': ';
|
||||
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, array('class' => '')).'": ';
|
||||
|
|
@ -397,6 +415,21 @@ class CliDumper extends AbstractDumper
|
|||
$this->colors = $this->supportsColors();
|
||||
}
|
||||
|
||||
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']);
|
||||
}
|
||||
|
||||
return $this->style('default', $prefix).$this->style($style, $value);
|
||||
}
|
||||
|
||||
$style = $this->styles[$style];
|
||||
|
||||
$map = static::$controlCharsMap;
|
||||
|
|
@ -406,7 +439,7 @@ class CliDumper extends AbstractDumper
|
|||
$s = $startCchr;
|
||||
$c = $c[$i = 0];
|
||||
do {
|
||||
$s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', ord($c[$i]));
|
||||
$s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', \ord($c[$i]));
|
||||
} while (isset($c[++$i]));
|
||||
|
||||
return $s.$endCchr;
|
||||
|
|
@ -414,12 +447,12 @@ class CliDumper extends AbstractDumper
|
|||
|
||||
if ($this->colors) {
|
||||
if ($cchrCount && "\033" === $value[0]) {
|
||||
$value = substr($value, strlen($startCchr));
|
||||
$value = substr($value, \strlen($startCchr));
|
||||
} else {
|
||||
$value = "\033[{$style}m".$value;
|
||||
}
|
||||
if ($cchrCount && $endCchr === substr($value, -strlen($endCchr))) {
|
||||
$value = substr($value, 0, -strlen($endCchr));
|
||||
if ($cchrCount && $endCchr === substr($value, -\strlen($endCchr))) {
|
||||
$value = substr($value, 0, -\strlen($endCchr));
|
||||
} else {
|
||||
$value .= "\033[{$this->styles['default']}m";
|
||||
}
|
||||
|
|
@ -434,14 +467,14 @@ class CliDumper extends AbstractDumper
|
|||
protected function supportsColors()
|
||||
{
|
||||
if ($this->outputStream !== static::$defaultOutput) {
|
||||
return @(is_resource($this->outputStream) && function_exists('posix_isatty') && posix_isatty($this->outputStream));
|
||||
return $this->hasColorSupport($this->outputStream);
|
||||
}
|
||||
if (null !== static::$defaultColors) {
|
||||
return static::$defaultColors;
|
||||
}
|
||||
if (isset($_SERVER['argv'][1])) {
|
||||
$colors = $_SERVER['argv'];
|
||||
$i = count($colors);
|
||||
$i = \count($colors);
|
||||
while (--$i > 0) {
|
||||
if (isset($colors[$i][5])) {
|
||||
switch ($colors[$i]) {
|
||||
|
|
@ -462,22 +495,10 @@ class CliDumper extends AbstractDumper
|
|||
}
|
||||
}
|
||||
|
||||
if ('\\' === DIRECTORY_SEPARATOR) {
|
||||
static::$defaultColors = @(
|
||||
'10.0.10586' === PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
|
||||
|| false !== getenv('ANSICON')
|
||||
|| 'ON' === getenv('ConEmuANSI')
|
||||
|| 'xterm' === getenv('TERM')
|
||||
);
|
||||
} elseif (function_exists('posix_isatty')) {
|
||||
$h = stream_get_meta_data($this->outputStream) + array('wrapper_type' => null);
|
||||
$h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'wb') : $this->outputStream;
|
||||
static::$defaultColors = @posix_isatty($h);
|
||||
} else {
|
||||
static::$defaultColors = false;
|
||||
}
|
||||
$h = stream_get_meta_data($this->outputStream) + array('wrapper_type' => null);
|
||||
$h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'wb') : $this->outputStream;
|
||||
|
||||
return static::$defaultColors;
|
||||
return static::$defaultColors = $this->hasColorSupport($h);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -493,12 +514,84 @@ class CliDumper extends AbstractDumper
|
|||
|
||||
protected function endValue(Cursor $cursor)
|
||||
{
|
||||
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 .= ',';
|
||||
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
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function hasColorSupport($stream)
|
||||
{
|
||||
if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) {
|
||||
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');
|
||||
}
|
||||
|
||||
if (\function_exists('stream_isatty')) {
|
||||
return @stream_isatty($stream);
|
||||
}
|
||||
|
||||
if (\function_exists('posix_isatty')) {
|
||||
return @posix_isatty($stream);
|
||||
}
|
||||
|
||||
$stat = @fstat($stream);
|
||||
// Check if formatted mode is S_IFCHR
|
||||
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function isWindowsTrueColor()
|
||||
{
|
||||
$result = 183 <= getenv('ANSICON_VER')
|
||||
|| 'ON' === getenv('ConEmuANSI')
|
||||
|| 'xterm' === getenv('TERM')
|
||||
|| 'Hyper' === getenv('TERM_PROGRAM');
|
||||
|
||||
if (!$result && \PHP_VERSION_ID >= 70200) {
|
||||
$version = sprintf(
|
||||
'%s.%s.%s',
|
||||
PHP_WINDOWS_VERSION_MAJOR,
|
||||
PHP_WINDOWS_VERSION_MINOR,
|
||||
PHP_WINDOWS_VERSION_BUILD
|
||||
);
|
||||
$result = $version >= '10.0.15063';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
5
pfosten/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
vendored
Executable file → Normal file
5
pfosten/vendor/symfony/var-dumper/Dumper/DataDumperInterface.php
vendored
Executable file → Normal file
|
|
@ -20,10 +20,5 @@ use Symfony\Component\VarDumper\Cloner\Data;
|
|||
*/
|
||||
interface DataDumperInterface
|
||||
{
|
||||
/**
|
||||
* Dumps a Data object.
|
||||
*
|
||||
* @param Data $data A Data object
|
||||
*/
|
||||
public function dump(Data $data);
|
||||
}
|
||||
|
|
|
|||
82
pfosten/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
vendored
Executable file → Normal file
82
pfosten/vendor/symfony/var-dumper/Dumper/HtmlDumper.php
vendored
Executable file → Normal file
|
|
@ -155,24 +155,31 @@ if (!doc.addEventListener) {
|
|||
function toggle(a, recursive) {
|
||||
var s = a.nextSibling || {}, oldClass = s.className, arrow, newClass;
|
||||
|
||||
if ('sf-dump-compact' == oldClass) {
|
||||
if (/\bsf-dump-compact\b/.test(oldClass)) {
|
||||
arrow = '▼';
|
||||
newClass = 'sf-dump-expanded';
|
||||
} else if ('sf-dump-expanded' == oldClass) {
|
||||
} else if (/\bsf-dump-expanded\b/.test(oldClass)) {
|
||||
arrow = '▶';
|
||||
newClass = 'sf-dump-compact';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (doc.createEvent && s.dispatchEvent) {
|
||||
var event = doc.createEvent('Event');
|
||||
event.initEvent('sf-dump-expanded' === newClass ? 'sfbeforedumpexpand' : 'sfbeforedumpcollapse', true, false);
|
||||
|
||||
s.dispatchEvent(event);
|
||||
}
|
||||
|
||||
a.lastChild.innerHTML = arrow;
|
||||
s.className = newClass;
|
||||
s.className = s.className.replace(/\bsf-dump-(compact|expanded)\b/, newClass);
|
||||
|
||||
if (recursive) {
|
||||
try {
|
||||
a = s.querySelectorAll('.'+oldClass);
|
||||
for (s = 0; s < a.length; ++s) {
|
||||
if (a[s].className !== newClass) {
|
||||
if (-1 == a[s].className.indexOf(newClass)) {
|
||||
a[s].className = newClass;
|
||||
a[s].previousSibling.lastChild.innerHTML = arrow;
|
||||
}
|
||||
|
|
@ -187,7 +194,7 @@ function toggle(a, recursive) {
|
|||
function collapse(a, recursive) {
|
||||
var s = a.nextSibling || {}, oldClass = s.className;
|
||||
|
||||
if ('sf-dump-expanded' == oldClass) {
|
||||
if (/\bsf-dump-expanded\b/.test(oldClass)) {
|
||||
toggle(a, recursive);
|
||||
|
||||
return true;
|
||||
|
|
@ -199,7 +206,7 @@ function collapse(a, recursive) {
|
|||
function expand(a, recursive) {
|
||||
var s = a.nextSibling || {}, oldClass = s.className;
|
||||
|
||||
if ('sf-dump-compact' == oldClass) {
|
||||
if (/\bsf-dump-compact\b/.test(oldClass)) {
|
||||
toggle(a, recursive);
|
||||
|
||||
return true;
|
||||
|
|
@ -254,8 +261,8 @@ function highlight(root, activeNode, nodes) {
|
|||
|
||||
function resetHighlightedNodes(root) {
|
||||
Array.from(root.querySelectorAll('.sf-dump-str, .sf-dump-key, .sf-dump-public, .sf-dump-protected, .sf-dump-private')).forEach(function (strNode) {
|
||||
strNode.className = strNode.className.replace(/\b sf-dump-highlight\b/, '');
|
||||
strNode.className = strNode.className.replace(/\b sf-dump-highlight-active\b/, '');
|
||||
strNode.className = strNode.className.replace(/\bsf-dump-highlight\b/, '');
|
||||
strNode.className = strNode.className.replace(/\bsf-dump-highlight-active\b/, '');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -303,6 +310,9 @@ return function (root, x) {
|
|||
|
||||
return "concat(" + parts.join(",") + ", '')";
|
||||
}
|
||||
function xpathHasClass(className) {
|
||||
return "contains(concat(' ', normalize-space(@class), ' '), ' " + className +" ')";
|
||||
}
|
||||
addEventListener(root, 'mouseover', function (e) {
|
||||
if ('' != refStyle.innerHTML) {
|
||||
refStyle.innerHTML = '';
|
||||
|
|
@ -334,7 +344,7 @@ return function (root, x) {
|
|||
if (f && t && f[0] !== t[0]) {
|
||||
r.innerHTML = r.innerHTML.replace(new RegExp('^'+f[0].replace(rxEsc, '\\$1'), 'mg'), t[0]);
|
||||
}
|
||||
if ('sf-dump-compact' == r.className) {
|
||||
if (/\bsf-dump-compact\b/.test(r.className)) {
|
||||
toggle(s, isCtrlKey(e));
|
||||
}
|
||||
}
|
||||
|
|
@ -352,7 +362,7 @@ return function (root, x) {
|
|||
} else if (/\bsf-dump-str-toggle\b/.test(a.className)) {
|
||||
e.preventDefault();
|
||||
e = a.parentNode.parentNode;
|
||||
e.className = e.className.replace(/sf-dump-str-(expand|collapse)/, a.parentNode.className);
|
||||
e.className = e.className.replace(/\bsf-dump-str-(expand|collapse)\b/, a.parentNode.className);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -366,7 +376,6 @@ return function (root, x) {
|
|||
for (i = 0; i < len; ++i) {
|
||||
elt = t[i];
|
||||
if ('SAMP' == elt.tagName) {
|
||||
elt.className = 'sf-dump-expanded';
|
||||
a = elt.previousSibling || {};
|
||||
if ('A' != a.tagName) {
|
||||
a = doc.createElement('A');
|
||||
|
|
@ -378,15 +387,18 @@ return function (root, x) {
|
|||
a.title = (a.title ? a.title+'\n[' : '[')+keyHint+'+click] Expand all children';
|
||||
a.innerHTML += '<span>▼</span>';
|
||||
a.className += ' sf-dump-toggle';
|
||||
|
||||
x = 1;
|
||||
if ('sf-dump' != elt.parentNode.className) {
|
||||
x += elt.parentNode.getAttribute('data-depth')/1;
|
||||
}
|
||||
elt.setAttribute('data-depth', x);
|
||||
if (x > options.maxDepth) {
|
||||
var className = elt.className;
|
||||
elt.className = 'sf-dump-expanded';
|
||||
if (className ? 'sf-dump-expanded' !== className : (x > options.maxDepth)) {
|
||||
toggle(a);
|
||||
}
|
||||
} else if ('sf-dump-ref' == elt.className && (a = elt.getAttribute('href'))) {
|
||||
} else if (/\bsf-dump-ref\b/.test(elt.className) && (a = elt.getAttribute('href'))) {
|
||||
a = a.substr(1);
|
||||
elt.className += ' '+a;
|
||||
|
||||
|
|
@ -425,7 +437,7 @@ return function (root, x) {
|
|||
if (this.isEmpty()) {
|
||||
return this.current();
|
||||
}
|
||||
this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : this.idx;
|
||||
this.idx = this.idx < (this.nodes.length - 1) ? this.idx + 1 : 0;
|
||||
|
||||
return this.current();
|
||||
},
|
||||
|
|
@ -433,7 +445,7 @@ return function (root, x) {
|
|||
if (this.isEmpty()) {
|
||||
return this.current();
|
||||
}
|
||||
this.idx = this.idx > 0 ? this.idx - 1 : this.idx;
|
||||
this.idx = this.idx > 0 ? this.idx - 1 : (this.nodes.length - 1);
|
||||
|
||||
return this.current();
|
||||
},
|
||||
|
|
@ -507,7 +519,15 @@ return function (root, x) {
|
|||
return;
|
||||
}
|
||||
|
||||
var xpathResult = doc.evaluate('//pre[@id="' + root.id + '"]//span[@class="sf-dump-str" or @class="sf-dump-key" or @class="sf-dump-public" or @class="sf-dump-protected" or @class="sf-dump-private"][contains(child::text(), ' + xpathString(searchQuery) + ')]', document, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
|
||||
var classMatches = [
|
||||
"sf-dump-str",
|
||||
"sf-dump-key",
|
||||
"sf-dump-public",
|
||||
"sf-dump-protected",
|
||||
"sf-dump-private",
|
||||
].map(xpathHasClass).join(' or ');
|
||||
|
||||
var xpathResult = doc.evaluate('.//span[' + classMatches + '][contains(translate(child::text(), ' + xpathString(searchQuery.toUpperCase()) + ', ' + xpathString(searchQuery.toLowerCase()) + '), ' + xpathString(searchQuery.toLowerCase()) + ')]', root, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
|
||||
|
||||
while (node = xpathResult.iterateNext()) state.nodes.push(node);
|
||||
|
||||
|
|
@ -518,8 +538,7 @@ return function (root, x) {
|
|||
Array.from(search.querySelectorAll('.sf-dump-search-input-next, .sf-dump-search-input-previous')).forEach(function (btn) {
|
||||
addEventListener(btn, 'click', function (e) {
|
||||
e.preventDefault();
|
||||
var direction = -1 !== e.target.className.indexOf('next') ? 'next' : 'previous';
|
||||
'next' === direction ? state.next() : state.previous();
|
||||
-1 !== e.target.className.indexOf('next') ? state.next() : state.previous();
|
||||
searchInput.focus();
|
||||
collapseAll(root);
|
||||
showCurrent(state);
|
||||
|
|
@ -728,15 +747,25 @@ EOHTML
|
|||
{
|
||||
parent::enterHash($cursor, $type, $class, false);
|
||||
|
||||
if ($cursor->skipChildren) {
|
||||
$cursor->skipChildren = false;
|
||||
$eol = ' class=sf-dump-compact>';
|
||||
} elseif ($this->expandNextHash) {
|
||||
$this->expandNextHash = false;
|
||||
$eol = ' class=sf-dump-expanded>';
|
||||
} else {
|
||||
$eol = '>';
|
||||
}
|
||||
|
||||
if ($hasChild) {
|
||||
$this->line .= '<samp';
|
||||
if ($cursor->refIndex) {
|
||||
$r = Cursor::HASH_OBJECT !== $type ? 1 - (Cursor::HASH_RESOURCE !== $type) : 2;
|
||||
$r .= $r && 0 < $cursor->softRefHandle ? $cursor->softRefHandle : $cursor->refIndex;
|
||||
|
||||
$this->line .= sprintf('<samp id=%s-ref%s>', $this->dumpId, $r);
|
||||
} else {
|
||||
$this->line .= '<samp>';
|
||||
$this->line .= sprintf(' id=%s-ref%s', $this->dumpId, $r);
|
||||
}
|
||||
$this->line .= $eol;
|
||||
$this->dumpLine($cursor->depth);
|
||||
}
|
||||
}
|
||||
|
|
@ -797,10 +826,10 @@ EOHTML
|
|||
}
|
||||
$label = esc(substr($value, -$attr['ellipsis']));
|
||||
$style = str_replace(' title="', " title=\"$v\n", $style);
|
||||
$v = sprintf('<span class=%s>%s</span>', $class, substr($v, 0, -strlen($label)));
|
||||
$v = sprintf('<span class=%s>%s</span>', $class, substr($v, 0, -\strlen($label)));
|
||||
|
||||
if (!empty($attr['ellipsis-tail'])) {
|
||||
$tail = strlen(esc(substr($value, -$attr['ellipsis'], $attr['ellipsis-tail'])));
|
||||
$tail = \strlen(esc(substr($value, -$attr['ellipsis'], $attr['ellipsis-tail'])));
|
||||
$v .= sprintf('<span class=sf-dump-ellipsis>%s</span>%s', substr($label, 0, $tail), substr($label, $tail));
|
||||
} else {
|
||||
$v .= $label;
|
||||
|
|
@ -811,7 +840,7 @@ EOHTML
|
|||
$s = '<span class=sf-dump-default>';
|
||||
$c = $c[$i = 0];
|
||||
do {
|
||||
$s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', ord($c[$i]));
|
||||
$s .= isset($map[$c[$i]]) ? $map[$c[$i]] : sprintf('\x%02X', \ord($c[$i]));
|
||||
} while (isset($c[++$i]));
|
||||
|
||||
return $s.'</span>';
|
||||
|
|
@ -821,7 +850,8 @@ EOHTML
|
|||
$attr['href'] = $href;
|
||||
}
|
||||
if (isset($attr['href'])) {
|
||||
$v = sprintf('<a href="%s" target="_blank" rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $v);
|
||||
$target = isset($attr['file']) ? '' : ' target="_blank"';
|
||||
$v = sprintf('<a href="%s"%s rel="noopener noreferrer">%s</a>', esc($this->utf8Encode($attr['href'])), $target, $v);
|
||||
}
|
||||
if (isset($attr['lang'])) {
|
||||
$v = sprintf('<code class="%s">%s</code>', esc($attr['lang']), $v);
|
||||
|
|
@ -865,7 +895,7 @@ EOHTML
|
|||
$options = $this->extraDisplayOptions + $this->displayOptions;
|
||||
|
||||
if ($fmt = $options['fileLinkFormat']) {
|
||||
return is_string($fmt) ? strtr($fmt, array('%f' => $file, '%l' => $line)) : $fmt->format($file, $line);
|
||||
return \is_string($fmt) ? strtr($fmt, array('%f' => $file, '%l' => $line)) : $fmt->format($file, $line);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
2
pfosten/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php
vendored
Executable file → Normal file
2
pfosten/vendor/symfony/var-dumper/Exception/ThrowingCasterException.php
vendored
Executable file → Normal file
|
|
@ -21,6 +21,6 @@ class ThrowingCasterException extends \Exception
|
|||
*/
|
||||
public function __construct(\Exception $prev)
|
||||
{
|
||||
parent::__construct('Unexpected '.get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev);
|
||||
parent::__construct('Unexpected '.\get_class($prev).' thrown from a caster: '.$prev->getMessage(), 0, $prev);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
pfosten/vendor/symfony/var-dumper/LICENSE
vendored
Executable file → Normal file
2
pfosten/vendor/symfony/var-dumper/LICENSE
vendored
Executable file → Normal file
|
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2014-2017 Fabien Potencier
|
||||
Copyright (c) 2014-2018 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
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/README.md
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/README.md
vendored
Executable file → Normal file
6
pfosten/vendor/symfony/var-dumper/Resources/functions/dump.php
vendored
Executable file → Normal file
6
pfosten/vendor/symfony/var-dumper/Resources/functions/dump.php
vendored
Executable file → Normal file
|
|
@ -20,5 +20,11 @@ if (!function_exists('dump')) {
|
|||
foreach (func_get_args() as $var) {
|
||||
VarDumper::dump($var);
|
||||
}
|
||||
|
||||
if (1 < func_num_args()) {
|
||||
return func_get_args();
|
||||
}
|
||||
|
||||
return $var;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
24
pfosten/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php
vendored
Executable file → Normal file
24
pfosten/vendor/symfony/var-dumper/Test/VarDumperTestTrait.php
vendored
Executable file → Normal file
|
|
@ -19,17 +19,29 @@ use Symfony\Component\VarDumper\Dumper\CliDumper;
|
|||
*/
|
||||
trait VarDumperTestTrait
|
||||
{
|
||||
public function assertDumpEquals($dump, $data, $message = '')
|
||||
public function assertDumpEquals($dump, $data, $filter = 0, $message = '')
|
||||
{
|
||||
$this->assertSame(rtrim($dump), $this->getDump($data), $message);
|
||||
if (\is_string($filter)) {
|
||||
@trigger_error(sprintf('The $message argument of the "%s()" method at the 3rd position is deprecated since Symfony 3.4 and will be moved at the 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED);
|
||||
$message = $filter;
|
||||
$filter = 0;
|
||||
}
|
||||
|
||||
$this->assertSame(rtrim($dump), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
public function assertDumpMatchesFormat($dump, $data, $message = '')
|
||||
public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '')
|
||||
{
|
||||
$this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data), $message);
|
||||
if (\is_string($filter)) {
|
||||
@trigger_error(sprintf('The $message argument of the "%s()" method at the 3rd position is deprecated since Symfony 3.4 and will be moved at the 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED);
|
||||
$message = $filter;
|
||||
$filter = 0;
|
||||
}
|
||||
|
||||
$this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
protected function getDump($data, $key = null)
|
||||
protected function getDump($data, $key = null, $filter = 0)
|
||||
{
|
||||
$flags = getenv('DUMP_LIGHT_ARRAY') ? CliDumper::DUMP_LIGHT_ARRAY : 0;
|
||||
$flags |= getenv('DUMP_STRING_LENGTH') ? CliDumper::DUMP_STRING_LENGTH : 0;
|
||||
|
|
@ -38,7 +50,7 @@ trait VarDumperTestTrait
|
|||
$cloner->setMaxItems(-1);
|
||||
$dumper = new CliDumper(null, null, $flags);
|
||||
$dumper->setColors(false);
|
||||
$data = $cloner->cloneVar($data)->withRefHandles(false);
|
||||
$data = $cloner->cloneVar($data, $filter)->withRefHandles(false);
|
||||
if (null !== $key && null === $data = $data->seek($key)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/CasterTest.php
vendored
Executable file → Normal file
109
pfosten/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php
vendored
Executable file → Normal file
109
pfosten/vendor/symfony/var-dumper/Tests/Caster/ExceptionCasterTest.php
vendored
Executable file → Normal file
|
|
@ -12,6 +12,7 @@
|
|||
namespace Symfony\Component\VarDumper\Tests\Caster;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarDumper\Caster\Caster;
|
||||
use Symfony\Component\VarDumper\Caster\ExceptionCaster;
|
||||
use Symfony\Component\VarDumper\Caster\FrameStub;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
|
|
@ -43,22 +44,15 @@ Exception {
|
|||
#message: "foo"
|
||||
#code: 0
|
||||
#file: "%sExceptionCasterTest.php"
|
||||
#line: 27
|
||||
#line: 28
|
||||
trace: {
|
||||
%sExceptionCasterTest.php:27: {
|
||||
: {
|
||||
: return new \Exception(''.$msg);
|
||||
: }
|
||||
}
|
||||
%sExceptionCasterTest.php:%d: {
|
||||
: $ref = array('foo');
|
||||
: $e = $this->getTestException('foo', $ref);
|
||||
:
|
||||
arguments: {
|
||||
$msg: "foo"
|
||||
&$ref: array:1 [ …1]
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:28 {
|
||||
› {
|
||||
› return new \Exception(''.$msg);
|
||||
› }
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:40 { …}
|
||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testDefaultSettings() {}
|
||||
%A
|
||||
EODUMP;
|
||||
|
||||
|
|
@ -72,19 +66,13 @@ EODUMP;
|
|||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
{
|
||||
%sExceptionCasterTest.php:27: {
|
||||
: {
|
||||
: return new \Exception(''.$msg);
|
||||
: }
|
||||
}
|
||||
%sExceptionCasterTest.php:%d: {
|
||||
: {
|
||||
: $e = $this->getTestException(2);
|
||||
:
|
||||
arguments: {
|
||||
$msg: 2
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:28 {
|
||||
› {
|
||||
› return new \Exception(''.$msg);
|
||||
› }
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:65 { …}
|
||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testSeek() {}
|
||||
%A
|
||||
EODUMP;
|
||||
|
||||
|
|
@ -101,18 +89,15 @@ Exception {
|
|||
#message: "1"
|
||||
#code: 0
|
||||
#file: "%sExceptionCasterTest.php"
|
||||
#line: 27
|
||||
#line: 28
|
||||
trace: {
|
||||
%sExceptionCasterTest.php:27: {
|
||||
: {
|
||||
: return new \Exception(''.$msg);
|
||||
: }
|
||||
}
|
||||
%sExceptionCasterTest.php:%d: {
|
||||
: {
|
||||
: $e = $this->getTestException(1);
|
||||
: ExceptionCaster::$traceArgs = false;
|
||||
%sExceptionCasterTest.php:28 {
|
||||
› {
|
||||
› return new \Exception(''.$msg);
|
||||
› }
|
||||
}
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:84 { …}
|
||||
Symfony\Component\VarDumper\Tests\Caster\ExceptionCasterTest->testNoArgs() {}
|
||||
%A
|
||||
EODUMP;
|
||||
|
||||
|
|
@ -129,10 +114,10 @@ Exception {
|
|||
#message: "1"
|
||||
#code: 0
|
||||
#file: "%sExceptionCasterTest.php"
|
||||
#line: 27
|
||||
#line: 28
|
||||
trace: {
|
||||
%sExceptionCasterTest.php: 27
|
||||
%sExceptionCasterTest.php: %d
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:28
|
||||
%s%eTests%eCaster%eExceptionCasterTest.php:%d
|
||||
%A
|
||||
EODUMP;
|
||||
|
||||
|
|
@ -141,6 +126,10 @@ EODUMP;
|
|||
|
||||
public function testHtmlDump()
|
||||
{
|
||||
if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
|
||||
$this->markTestSkipped('A custom file_link_format is defined.');
|
||||
}
|
||||
|
||||
$e = $this->getTestException(1);
|
||||
ExceptionCaster::$srcContext = -1;
|
||||
|
||||
|
|
@ -157,10 +146,10 @@ EODUMP;
|
|||
#<span class=sf-dump-protected title="Protected property">code</span>: <span class=sf-dump-num>0</span>
|
||||
#<span class=sf-dump-protected title="Protected property">file</span>: "<span class=sf-dump-str title="%sExceptionCasterTest.php
|
||||
%d characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eCaster%eExceptionCasterTest.php</span>"
|
||||
#<span class=sf-dump-protected title="Protected property">line</span>: <span class=sf-dump-num>27</span>
|
||||
#<span class=sf-dump-protected title="Protected property">line</span>: <span class=sf-dump-num>28</span>
|
||||
<span class=sf-dump-meta>trace</span>: {<samp>
|
||||
<span class=sf-dump-meta title="%sExceptionCasterTest.php
|
||||
Stack level %d."><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eCaster%eExceptionCasterTest.php</span>: <span class=sf-dump-num>27</span>
|
||||
Stack level %d."><span class="sf-dump-ellipsis sf-dump-ellipsis-path">%s%eVarDumper</span><span class=sf-dump-ellipsis>%e</span>Tests%eCaster%eExceptionCasterTest.php</span>:<span class=sf-dump-num>28</span>
|
||||
…%d
|
||||
</samp>}
|
||||
</samp>}
|
||||
|
|
@ -175,16 +164,16 @@ EODUMP;
|
|||
*/
|
||||
public function testFrameWithTwig()
|
||||
{
|
||||
require_once dirname(__DIR__).'/Fixtures/Twig.php';
|
||||
require_once \dirname(__DIR__).'/Fixtures/Twig.php';
|
||||
|
||||
$f = array(
|
||||
new FrameStub(array(
|
||||
'file' => dirname(__DIR__).'/Fixtures/Twig.php',
|
||||
'file' => \dirname(__DIR__).'/Fixtures/Twig.php',
|
||||
'line' => 20,
|
||||
'class' => '__TwigTemplate_VarDumperFixture_u75a09',
|
||||
)),
|
||||
new FrameStub(array(
|
||||
'file' => dirname(__DIR__).'/Fixtures/Twig.php',
|
||||
'file' => \dirname(__DIR__).'/Fixtures/Twig.php',
|
||||
'line' => 21,
|
||||
'class' => '__TwigTemplate_VarDumperFixture_u75a09',
|
||||
'object' => new \__TwigTemplate_VarDumperFixture_u75a09(null, __FILE__),
|
||||
|
|
@ -196,10 +185,10 @@ array:2 [
|
|||
0 => {
|
||||
class: "__TwigTemplate_VarDumperFixture_u75a09"
|
||||
src: {
|
||||
%sTwig.php:1: {
|
||||
:
|
||||
: foo bar
|
||||
: twig source
|
||||
%sTwig.php:1 {
|
||||
›
|
||||
› foo bar
|
||||
› twig source
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -209,10 +198,10 @@ array:2 [
|
|||
%A
|
||||
}
|
||||
src: {
|
||||
%sExceptionCasterTest.php:2: {
|
||||
: foo bar
|
||||
: twig source
|
||||
:
|
||||
%sExceptionCasterTest.php:2 {
|
||||
› foo bar
|
||||
› twig source
|
||||
›
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -222,4 +211,20 @@ EODUMP;
|
|||
|
||||
$this->assertDumpMatchesFormat($expectedDump, $f);
|
||||
}
|
||||
|
||||
public function testExcludeVerbosity()
|
||||
{
|
||||
$e = $this->getTestException('foo');
|
||||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
Exception {
|
||||
#message: "foo"
|
||||
#code: 0
|
||||
#file: "%sExceptionCasterTest.php"
|
||||
#line: 28
|
||||
}
|
||||
EODUMP;
|
||||
|
||||
$this->assertDumpMatchesFormat($expectedDump, $e, Caster::EXCLUDE_VERBOSE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/PdoCasterTest.php
vendored
Executable file → Normal file
7
pfosten/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php
vendored
Executable file → Normal file
7
pfosten/vendor/symfony/var-dumper/Tests/Caster/RedisCasterTest.php
vendored
Executable file → Normal file
|
|
@ -26,7 +26,7 @@ class RedisCasterTest extends TestCase
|
|||
{
|
||||
$redis = new \Redis();
|
||||
|
||||
if (defined('HHVM_VERSION_ID')) {
|
||||
if (\defined('HHVM_VERSION_ID')) {
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
#host: ""
|
||||
|
|
@ -52,7 +52,7 @@ EODUMP;
|
|||
self::markTestSkipped($e['message']);
|
||||
}
|
||||
|
||||
if (defined('HHVM_VERSION_ID')) {
|
||||
if (\defined('HHVM_VERSION_ID')) {
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
#host: "127.0.0.1"
|
||||
|
|
@ -61,8 +61,7 @@ Redis {
|
|||
EODUMP;
|
||||
} else {
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
+"socket": Redis Socket Buffer resource
|
||||
Redis {%A
|
||||
isConnected: true
|
||||
host: "127.0.0.1"
|
||||
port: 6379
|
||||
|
|
|
|||
59
pfosten/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php
vendored
Executable file → Normal file
59
pfosten/vendor/symfony/var-dumper/Tests/Caster/ReflectionCasterTest.php
vendored
Executable file → Normal file
|
|
@ -12,6 +12,7 @@
|
|||
namespace Symfony\Component\VarDumper\Tests\Caster;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarDumper\Caster\Caster;
|
||||
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
|
||||
use Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo;
|
||||
use Symfony\Component\VarDumper\Tests\Fixtures\NotLoadableClass;
|
||||
|
|
@ -77,13 +78,27 @@ Closure {
|
|||
\$b: & 123
|
||||
}
|
||||
file: "%sReflectionCasterTest.php"
|
||||
line: "67 to 67"
|
||||
line: "68 to 68"
|
||||
}
|
||||
EOTXT
|
||||
, $var
|
||||
);
|
||||
}
|
||||
|
||||
public function testClosureCasterExcludingVerbosity()
|
||||
{
|
||||
$var = function () {};
|
||||
|
||||
$expectedDump = <<<EOTXT
|
||||
Closure {
|
||||
class: "Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest"
|
||||
this: Symfony\Component\VarDumper\Tests\Caster\ReflectionCasterTest { …}
|
||||
}
|
||||
EOTXT;
|
||||
|
||||
$this->assertDumpEquals($expectedDump, $var, Caster::EXCLUDE_VERBOSE);
|
||||
}
|
||||
|
||||
public function testReflectionParameter()
|
||||
{
|
||||
$var = new \ReflectionParameter(__NAMESPACE__.'\reflectionParameterFixture', 0);
|
||||
|
|
@ -148,7 +163,7 @@ EOTXT
|
|||
*/
|
||||
public function testGenerator()
|
||||
{
|
||||
if (extension_loaded('xdebug')) {
|
||||
if (\extension_loaded('xdebug')) {
|
||||
$this->markTestSkipped('xdebug is active');
|
||||
}
|
||||
|
||||
|
|
@ -159,11 +174,11 @@ EOTXT
|
|||
Generator {
|
||||
this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …}
|
||||
executing: {
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz(): {
|
||||
%sGeneratorDemo.php:14: {
|
||||
: {
|
||||
: yield from bar();
|
||||
: }
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo->baz() {
|
||||
%sGeneratorDemo.php:14 {
|
||||
› {
|
||||
› yield from bar();
|
||||
› }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -182,31 +197,23 @@ array:2 [
|
|||
0 => ReflectionGenerator {
|
||||
this: Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo { …}
|
||||
trace: {
|
||||
%sGeneratorDemo.php:9: {
|
||||
: {
|
||||
: yield 1;
|
||||
: }
|
||||
}
|
||||
%sGeneratorDemo.php:20: {
|
||||
: {
|
||||
: yield from GeneratorDemo::foo();
|
||||
: }
|
||||
}
|
||||
%sGeneratorDemo.php:14: {
|
||||
: {
|
||||
: yield from bar();
|
||||
: }
|
||||
%s%eTests%eFixtures%eGeneratorDemo.php:9 {
|
||||
› {
|
||||
› yield 1;
|
||||
› }
|
||||
}
|
||||
%s%eTests%eFixtures%eGeneratorDemo.php:20 { …}
|
||||
%s%eTests%eFixtures%eGeneratorDemo.php:14 { …}
|
||||
}
|
||||
closed: false
|
||||
}
|
||||
1 => Generator {
|
||||
executing: {
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo(): {
|
||||
%sGeneratorDemo.php:10: {
|
||||
: yield 1;
|
||||
: }
|
||||
:
|
||||
Symfony\Component\VarDumper\Tests\Fixtures\GeneratorDemo::foo() {
|
||||
%sGeneratorDemo.php:10 {
|
||||
› yield 1;
|
||||
› }
|
||||
›
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
66
pfosten/vendor/symfony/var-dumper/Tests/Caster/SplCasterTest.php
vendored
Executable file → Normal file
66
pfosten/vendor/symfony/var-dumper/Tests/Caster/SplCasterTest.php
vendored
Executable file → Normal file
|
|
@ -144,4 +144,70 @@ EOTXT;
|
|||
array(\SplDoublyLinkedList::IT_MODE_LIFO | \SplDoublyLinkedList::IT_MODE_DELETE, 'IT_MODE_LIFO | IT_MODE_DELETE'),
|
||||
);
|
||||
}
|
||||
|
||||
public function testCastObjectStorageIsntModified()
|
||||
{
|
||||
$var = new \SplObjectStorage();
|
||||
$var->attach(new \stdClass());
|
||||
$var->rewind();
|
||||
$current = $var->current();
|
||||
|
||||
$this->assertDumpMatchesFormat('%A', $var);
|
||||
$this->assertSame($current, $var->current());
|
||||
}
|
||||
|
||||
public function testCastObjectStorageDumpsInfo()
|
||||
{
|
||||
$var = new \SplObjectStorage();
|
||||
$var->attach(new \stdClass(), new \DateTime());
|
||||
|
||||
$this->assertDumpMatchesFormat('%ADateTime%A', $var);
|
||||
}
|
||||
|
||||
public function testCastArrayObject()
|
||||
{
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
$this->markTestSkipped('HHVM as different internal details.');
|
||||
}
|
||||
$var = new \ArrayObject(array(123));
|
||||
$var->foo = 234;
|
||||
|
||||
$expected = <<<EOTXT
|
||||
ArrayObject {
|
||||
+"foo": 234
|
||||
flag::STD_PROP_LIST: false
|
||||
flag::ARRAY_AS_PROPS: false
|
||||
iteratorClass: "ArrayIterator"
|
||||
storage: array:1 [
|
||||
0 => 123
|
||||
]
|
||||
}
|
||||
EOTXT;
|
||||
$this->assertDumpEquals($expected, $var);
|
||||
}
|
||||
|
||||
public function testArrayIterator()
|
||||
{
|
||||
if (\defined('HHVM_VERSION')) {
|
||||
$this->markTestSkipped('HHVM as different internal details.');
|
||||
}
|
||||
$var = new MyArrayIterator(array(234));
|
||||
|
||||
$expected = <<<EOTXT
|
||||
Symfony\Component\VarDumper\Tests\Caster\MyArrayIterator {
|
||||
-foo: 123
|
||||
flag::STD_PROP_LIST: false
|
||||
flag::ARRAY_AS_PROPS: false
|
||||
storage: array:1 [
|
||||
0 => 234
|
||||
]
|
||||
}
|
||||
EOTXT;
|
||||
$this->assertDumpEquals($expected, $var);
|
||||
}
|
||||
}
|
||||
|
||||
class MyArrayIterator extends \ArrayIterator
|
||||
{
|
||||
private $foo = 123;
|
||||
}
|
||||
|
|
|
|||
27
pfosten/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php
vendored
Executable file → Normal file
27
pfosten/vendor/symfony/var-dumper/Tests/Caster/StubCasterTest.php
vendored
Executable file → Normal file
|
|
@ -100,7 +100,28 @@ EODUMP;
|
|||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sStubCasterTest.php:0" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="55 characters">Symfony\Component\VarDumper\Tests\Caster\StubCasterTest</span></a>"
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sStubCasterTest.php:0" rel="noopener noreferrer"><span class=sf-dump-str title="55 characters">Symfony\Component\VarDumper\Tests\Caster\StubCasterTest</span></a>"
|
||||
</samp>]
|
||||
</bar>
|
||||
EODUMP;
|
||||
|
||||
$this->assertStringMatchesFormat($expectedDump, $dump);
|
||||
}
|
||||
|
||||
public function testLinkStubWithNoFileLink()
|
||||
{
|
||||
$var = array(new LinkStub('example.com', 0, 'http://example.com'));
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$dumper = new HtmlDumper();
|
||||
$dumper->setDumpHeader('<foo></foo>');
|
||||
$dumper->setDumpBoundaries('<bar>', '</bar>');
|
||||
$dumper->setDisplayOptions(array('fileLinkFormat' => '%f:%l'));
|
||||
$dump = $dumper->dump($cloner->cloneVar($var), true);
|
||||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
|
||||
<span class=sf-dump-index>0</span> => "<a href="http://example.com" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="11 characters">example.com</span></a>"
|
||||
</samp>]
|
||||
</bar>
|
||||
EODUMP;
|
||||
|
|
@ -120,7 +141,7 @@ EODUMP;
|
|||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:10" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:10" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
|
||||
</samp>]
|
||||
</bar>
|
||||
EODUMP;
|
||||
|
|
@ -161,7 +182,7 @@ EODUMP;
|
|||
|
||||
$expectedDump = <<<'EODUMP'
|
||||
<foo></foo><bar><span class=sf-dump-note>array:1</span> [<samp>
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:5" target="_blank" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
|
||||
<span class=sf-dump-index>0</span> => "<a href="%sFooInterface.php:5" rel="noopener noreferrer"><span class=sf-dump-str title="5 characters">hello</span></a>"
|
||||
</samp>]
|
||||
</bar>
|
||||
EODUMP;
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Caster/XmlReaderCasterTest.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Tests/Cloner/DataTest.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/Tests/Cloner/DataTest.php
vendored
Executable file → Normal file
|
|
@ -26,14 +26,14 @@ class DataTest extends TestCase
|
|||
$clonedValues = array();
|
||||
|
||||
$this->assertInstanceOf(Data::class, $data);
|
||||
$this->assertCount(count($values), $data);
|
||||
$this->assertCount(\count($values), $data);
|
||||
$this->assertFalse(isset($data->{0}));
|
||||
$this->assertFalse(isset($data[0]));
|
||||
|
||||
foreach ($data as $k => $v) {
|
||||
$this->assertTrue(isset($data->{$k}));
|
||||
$this->assertTrue(isset($data[$k]));
|
||||
$this->assertSame(gettype($values[$k]), $data->seek($k)->getType());
|
||||
$this->assertSame(\gettype($values[$k]), $data->seek($k)->getType());
|
||||
$this->assertSame($values[$k], $data->seek($k)->getValue());
|
||||
$this->assertSame($values[$k], $data->{$k});
|
||||
$this->assertSame($values[$k], $data[$k]);
|
||||
|
|
|
|||
215
pfosten/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php
vendored
Executable file → Normal file
215
pfosten/vendor/symfony/var-dumper/Tests/Cloner/VarClonerTest.php
vendored
Executable file → Normal file
|
|
@ -33,19 +33,9 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
[0] => Array
|
||||
(
|
||||
[type] => array
|
||||
[class] => assoc
|
||||
[value] => 1
|
||||
[cut] => 0
|
||||
[handle] => 0
|
||||
[refCount] => 0
|
||||
[position] => 1
|
||||
[attr] => Array
|
||||
(
|
||||
)
|
||||
|
||||
[1] => 1
|
||||
)
|
||||
|
||||
)
|
||||
|
|
@ -84,7 +74,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => object
|
||||
[type] => 4
|
||||
[class] => stdClass
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
|
|
@ -103,7 +93,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
(
|
||||
[\000+\0001] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => object
|
||||
[type] => 4
|
||||
[class] => stdClass
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
|
|
@ -118,7 +108,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
|
||||
[\000+\0002] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => object
|
||||
[type] => 4
|
||||
[class] => stdClass
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
|
|
@ -152,13 +142,181 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
[useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
)
|
||||
|
||||
EOTXT;
|
||||
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
||||
}
|
||||
|
||||
public function testLimits()
|
||||
{
|
||||
// Level 0:
|
||||
$data = array(
|
||||
// Level 1:
|
||||
array(
|
||||
// Level 2:
|
||||
array(
|
||||
// Level 3:
|
||||
'Level 3 Item 0',
|
||||
'Level 3 Item 1',
|
||||
'Level 3 Item 2',
|
||||
'Level 3 Item 3',
|
||||
),
|
||||
array(
|
||||
'Level 3 Item 4',
|
||||
'Level 3 Item 5',
|
||||
'Level 3 Item 6',
|
||||
),
|
||||
array(
|
||||
'Level 3 Item 7',
|
||||
),
|
||||
),
|
||||
array(
|
||||
array(
|
||||
'Level 3 Item 8',
|
||||
),
|
||||
'Level 2 Item 0',
|
||||
),
|
||||
array(
|
||||
'Level 2 Item 1',
|
||||
),
|
||||
'Level 1 Item 0',
|
||||
array(
|
||||
// Test setMaxString:
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
|
||||
'SHORT',
|
||||
),
|
||||
);
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$cloner->setMinDepth(2);
|
||||
$cloner->setMaxItems(5);
|
||||
$cloner->setMaxString(20);
|
||||
$clone = $cloner->cloneVar($data);
|
||||
|
||||
$expected = <<<EOTXT
|
||||
Symfony\Component\VarDumper\Cloner\Data Object
|
||||
(
|
||||
[data:Symfony\Component\VarDumper\Cloner\Data:private] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[2] => 1
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[2] => 2
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[2] => 3
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[2] => 4
|
||||
)
|
||||
|
||||
[3] => Level 1 Item 0
|
||||
[4] => Array
|
||||
(
|
||||
[2] => 5
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[2] => 6
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[0] => 2
|
||||
[2] => 7
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[0] => 1
|
||||
[2] => 0
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[3] => Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[0] => 1
|
||||
[2] => 0
|
||||
)
|
||||
|
||||
[1] => Level 2 Item 0
|
||||
)
|
||||
|
||||
[4] => Array
|
||||
(
|
||||
[0] => Level 2 Item 1
|
||||
)
|
||||
|
||||
[5] => Array
|
||||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => 2
|
||||
[class] => 2
|
||||
[value] => ABCDEFGHIJKLMNOPQRST
|
||||
[cut] => 6
|
||||
[handle] => 0
|
||||
[refCount] => 0
|
||||
[position] => 0
|
||||
[attr] => Array
|
||||
(
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[1] => SHORT
|
||||
)
|
||||
|
||||
[6] => Array
|
||||
(
|
||||
[0] => Level 3 Item 0
|
||||
[1] => Level 3 Item 1
|
||||
[2] => Level 3 Item 2
|
||||
[3] => Level 3 Item 3
|
||||
)
|
||||
|
||||
[7] => Array
|
||||
(
|
||||
[0] => Level 3 Item 4
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
[position:Symfony\Component\VarDumper\Cloner\Data:private] => 0
|
||||
[key:Symfony\Component\VarDumper\Cloner\Data:private] => 0
|
||||
[maxDepth:Symfony\Component\VarDumper\Cloner\Data:private] => 20
|
||||
[maxItemsPerDepth:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
[useRefHandles:Symfony\Component\VarDumper\Cloner\Data:private] => -1
|
||||
)
|
||||
|
||||
EOTXT;
|
||||
$this->assertStringMatchesFormat($expected, print_r($clone, true));
|
||||
}
|
||||
|
||||
public function testJsonCast()
|
||||
{
|
||||
if (ini_get('xdebug.overload_var_dump') == 2) {
|
||||
if (2 == ini_get('xdebug.overload_var_dump')) {
|
||||
$this->markTestSkipped('xdebug is active');
|
||||
}
|
||||
|
||||
|
|
@ -174,24 +332,9 @@ object(Symfony\Component\VarDumper\Cloner\Data)#%i (6) {
|
|||
[0]=>
|
||||
array(1) {
|
||||
[0]=>
|
||||
object(Symfony\Component\VarDumper\Cloner\Stub)#%i (8) {
|
||||
["type"]=>
|
||||
string(5) "array"
|
||||
["class"]=>
|
||||
string(5) "assoc"
|
||||
["value"]=>
|
||||
array(1) {
|
||||
[1]=>
|
||||
int(1)
|
||||
["cut"]=>
|
||||
int(0)
|
||||
["handle"]=>
|
||||
int(0)
|
||||
["refCount"]=>
|
||||
int(0)
|
||||
["position"]=>
|
||||
int(1)
|
||||
["attr"]=>
|
||||
array(0) {
|
||||
}
|
||||
}
|
||||
}
|
||||
[1]=>
|
||||
|
|
@ -199,7 +342,7 @@ object(Symfony\Component\VarDumper\Cloner\Data)#%i (6) {
|
|||
["1"]=>
|
||||
object(Symfony\Component\VarDumper\Cloner\Stub)#%i (8) {
|
||||
["type"]=>
|
||||
string(6) "object"
|
||||
int(4)
|
||||
["class"]=>
|
||||
string(8) "stdClass"
|
||||
["value"]=>
|
||||
|
|
@ -233,7 +376,7 @@ object(Symfony\Component\VarDumper\Cloner\Data)#%i (6) {
|
|||
EOTXT;
|
||||
ob_start();
|
||||
var_dump($clone);
|
||||
$this->assertStringMatchesFormat($expected, ob_get_clean());
|
||||
$this->assertStringMatchesFormat(\PHP_VERSION_ID >= 70200 ? str_replace('"1"', '1', $expected) : $expected, ob_get_clean());
|
||||
}
|
||||
|
||||
public function testCaster()
|
||||
|
|
@ -259,7 +402,7 @@ Symfony\Component\VarDumper\Cloner\Data Object
|
|||
(
|
||||
[0] => Symfony\Component\VarDumper\Cloner\Stub Object
|
||||
(
|
||||
[type] => object
|
||||
[type] => 4
|
||||
[class] => %s
|
||||
[value] =>
|
||||
[cut] => 0
|
||||
|
|
|
|||
119
pfosten/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php
vendored
Executable file → Normal file
119
pfosten/vendor/symfony/var-dumper/Tests/Dumper/CliDumperTest.php
vendored
Executable file → Normal file
|
|
@ -48,7 +48,7 @@ class CliDumperTest extends TestCase
|
|||
$intMax = PHP_INT_MAX;
|
||||
$res = (int) $var['res'];
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$r = \defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
array:24 [
|
||||
|
|
@ -86,7 +86,7 @@ array:24 [
|
|||
default: null
|
||||
}
|
||||
}
|
||||
file: "{$var['file']}"
|
||||
file: "%s%eTests%eFixtures%edumb-var.php"
|
||||
line: "{$var['line']} to {$var['line']}"
|
||||
}
|
||||
"line" => {$var['line']}
|
||||
|
|
@ -130,6 +130,36 @@ EOTXT
|
|||
$this->assertSame($expected, $dump);
|
||||
}
|
||||
|
||||
public function testDumpWithCommaFlagsAndExceptionCodeExcerpt()
|
||||
{
|
||||
$dumper = new CliDumper(null, null, CliDumper::DUMP_TRAILING_COMMA);
|
||||
$dumper->setColors(false);
|
||||
$cloner = new VarCloner();
|
||||
|
||||
$ex = new \RuntimeException('foo');
|
||||
|
||||
$dump = $dumper->dump($cloner->cloneVar($ex)->withRefHandles(false), true);
|
||||
|
||||
$this->assertStringMatchesFormat(<<<'EOTXT'
|
||||
RuntimeException {
|
||||
#message: "foo"
|
||||
#code: 0
|
||||
#file: "%ACliDumperTest.php"
|
||||
#line: %d
|
||||
trace: {
|
||||
%ACliDumperTest.php:%d {
|
||||
›
|
||||
› $ex = new \RuntimeException('foo');
|
||||
›
|
||||
}
|
||||
%A
|
||||
}
|
||||
}
|
||||
|
||||
EOTXT
|
||||
, $dump);
|
||||
}
|
||||
|
||||
public function provideDumpWithCommaFlagTests()
|
||||
{
|
||||
$expected = <<<'EOTXT'
|
||||
|
|
@ -200,8 +230,22 @@ EOTXT
|
|||
$var[] = &$v;
|
||||
$var[''] = 2;
|
||||
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
if (\PHP_VERSION_ID >= 70200) {
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
array:4 [
|
||||
0 => {}
|
||||
1 => &1 null
|
||||
2 => &1 null
|
||||
"" => 2
|
||||
]
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
} else {
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
array:4 [
|
||||
"0" => {}
|
||||
"1" => &1 null
|
||||
|
|
@ -209,9 +253,10 @@ array:4 [
|
|||
"" => 2
|
||||
]
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
,
|
||||
$var
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function testObjectCast()
|
||||
|
|
@ -219,21 +264,33 @@ EOTXT
|
|||
$var = (object) array(1 => 1);
|
||||
$var->{1} = 2;
|
||||
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
if (\PHP_VERSION_ID >= 70200) {
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
{
|
||||
+"1": 2
|
||||
}
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
} else {
|
||||
$this->assertDumpMatchesFormat(
|
||||
<<<'EOTXT'
|
||||
{
|
||||
+1: 1
|
||||
+"1": 2
|
||||
}
|
||||
EOTXT
|
||||
,
|
||||
$var
|
||||
);
|
||||
,
|
||||
$var
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function testClosedResource()
|
||||
{
|
||||
if (defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
||||
if (\defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
||||
|
|
@ -327,37 +384,23 @@ EOTXT
|
|||
$dumper->dump($data, $out);
|
||||
$out = stream_get_contents($out, -1, 0);
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$r = \defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
stream resource {@{$ref}
|
||||
⚠: Symfony\Component\VarDumper\Exception\ThrowingCasterException {{$r}
|
||||
#message: "Unexpected Exception thrown from a caster: Foobar"
|
||||
trace: {
|
||||
%sTwig.php:2: {
|
||||
: foo bar
|
||||
: twig source
|
||||
:
|
||||
%sTwig.php:2 {
|
||||
› foo bar
|
||||
› twig source
|
||||
›
|
||||
}
|
||||
%sTemplate.php:%d: {
|
||||
: try {
|
||||
: \$this->doDisplay(\$context, \$blocks);
|
||||
: } catch (Twig%sError \$e) {
|
||||
}
|
||||
%sTemplate.php:%d: {
|
||||
: {
|
||||
: \$this->displayWithErrorHandling(\$this->env->mergeGlobals(\$context), array_merge(\$this->blocks, \$blocks));
|
||||
: }
|
||||
}
|
||||
%sTemplate.php:%d: {
|
||||
: try {
|
||||
: \$this->display(\$context);
|
||||
: } catch (%s \$e) {
|
||||
}
|
||||
%sCliDumperTest.php:%d: {
|
||||
%A
|
||||
}
|
||||
}
|
||||
%s%eTemplate.php:%d { …}
|
||||
%s%eTemplate.php:%d { …}
|
||||
%s%eTemplate.php:%d { …}
|
||||
%s%eTests%eDumper%eCliDumperTest.php:%d { …}
|
||||
%A }
|
||||
}
|
||||
%Awrapper_type: "PHP"
|
||||
stream_type: "MEMORY"
|
||||
|
|
@ -386,7 +429,7 @@ EOTXT
|
|||
$data = $cloner->cloneVar($var);
|
||||
$out = $dumper->dump($data, true);
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$r = \defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
{{$r}
|
||||
|
|
|
|||
6
pfosten/vendor/symfony/var-dumper/Tests/Dumper/HtmlDumperTest.php
vendored
Executable file → Normal file
6
pfosten/vendor/symfony/var-dumper/Tests/Dumper/HtmlDumperTest.php
vendored
Executable file → Normal file
|
|
@ -22,6 +22,10 @@ class HtmlDumperTest extends TestCase
|
|||
{
|
||||
public function testGet()
|
||||
{
|
||||
if (ini_get('xdebug.file_link_format') || get_cfg_var('xdebug.file_link_format')) {
|
||||
$this->markTestSkipped('A custom file_link_format is defined.');
|
||||
}
|
||||
|
||||
require __DIR__.'/../Fixtures/dumb-var.php';
|
||||
|
||||
$dumper = new HtmlDumper('php://output');
|
||||
|
|
@ -47,7 +51,7 @@ class HtmlDumperTest extends TestCase
|
|||
$dumpId = $dumpId[0];
|
||||
$res = (int) $var['res'];
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '<a class=sf-dump-ref>#%d</a>';
|
||||
$r = \defined('HHVM_VERSION') ? '' : '<a class=sf-dump-ref>#%d</a>';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
<foo></foo><bar><span class=sf-dump-note>array:24</span> [<samp>
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/FooInterface.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/FooInterface.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/GeneratorDemo.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/GeneratorDemo.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/NotLoadableClass.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/NotLoadableClass.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/Twig.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/Twig.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/dumb-var.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/dumb-var.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/xml_reader.xml
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Fixtures/xml_reader.xml
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/Tests/Test/VarDumperTestTraitTest.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/VarDumper.php
vendored
Executable file → Normal file
4
pfosten/vendor/symfony/var-dumper/VarDumper.php
vendored
Executable file → Normal file
|
|
@ -29,13 +29,13 @@ class VarDumper
|
|||
{
|
||||
if (null === self::$handler) {
|
||||
$cloner = new VarCloner();
|
||||
$dumper = 'cli' === PHP_SAPI ? new CliDumper() : new HtmlDumper();
|
||||
$dumper = \in_array(\PHP_SAPI, array('cli', 'phpdbg'), true) ? new CliDumper() : new HtmlDumper();
|
||||
self::$handler = function ($var) use ($cloner, $dumper) {
|
||||
$dumper->dump($cloner->cloneVar($var));
|
||||
};
|
||||
}
|
||||
|
||||
return call_user_func(self::$handler, $var);
|
||||
return \call_user_func(self::$handler, $var);
|
||||
}
|
||||
|
||||
public static function setHandler(callable $callable = null)
|
||||
|
|
|
|||
5
pfosten/vendor/symfony/var-dumper/composer.json
vendored
Executable file → Normal file
5
pfosten/vendor/symfony/var-dumper/composer.json
vendored
Executable file → Normal file
|
|
@ -16,7 +16,7 @@
|
|||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"php": "^5.5.9|>=7.0.8",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
},
|
||||
"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",
|
||||
"ext-symfony_debug": ""
|
||||
},
|
||||
"autoload": {
|
||||
|
|
@ -40,7 +41,7 @@
|
|||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.3-dev"
|
||||
"dev-master": "3.4-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
0
pfosten/vendor/symfony/var-dumper/phpunit.xml.dist
vendored
Executable file → Normal file
0
pfosten/vendor/symfony/var-dumper/phpunit.xml.dist
vendored
Executable file → Normal file
Loading…
Add table
Add a link
Reference in a new issue