mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-12-04 22:13:54 +09:00
update to laravel 5.7 and try getting autologin saved
This commit is contained in:
19
vendor/symfony/var-dumper/CHANGELOG.md
vendored
19
vendor/symfony/var-dumper/CHANGELOG.md
vendored
@@ -1,6 +1,25 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
4.1.0
|
||||
-----
|
||||
|
||||
* added a `ServerDumper` to send serialized Data clones to a server
|
||||
* added a `ServerDumpCommand` and `DumpServer` to run a server collecting
|
||||
and displaying dumps on a single place with multiple formats support
|
||||
* added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support
|
||||
|
||||
4.0.0
|
||||
-----
|
||||
|
||||
* support for passing `\ReflectionClass` instances to the `Caster::castObject()`
|
||||
method has been dropped, pass class names as strings instead
|
||||
* the `Data::getRawData()` method has been removed
|
||||
* the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$context = null`
|
||||
argument and moves `$message = ''` argument at 4th position.
|
||||
* the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$context = null`
|
||||
argument and moves `$message = ''` argument at 4th position.
|
||||
|
||||
3.4.0
|
||||
-----
|
||||
|
||||
|
||||
12
vendor/symfony/var-dumper/Caster/ArgsStub.php
vendored
12
vendor/symfony/var-dumper/Caster/ArgsStub.php
vendored
@@ -22,7 +22,7 @@ class ArgsStub extends EnumStub
|
||||
{
|
||||
private static $parameters = array();
|
||||
|
||||
public function __construct(array $args, $function, $class)
|
||||
public function __construct(array $args, string $function, ?string $class)
|
||||
{
|
||||
list($variadic, $params) = self::getParameters($function, $class);
|
||||
|
||||
@@ -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) {
|
||||
@@ -68,7 +68,7 @@ class ArgsStub extends EnumStub
|
||||
if ($v->isPassedByReference()) {
|
||||
$k = '&'.$k;
|
||||
}
|
||||
if (method_exists($v, 'isVariadic') && $v->isVariadic()) {
|
||||
if ($v->isVariadic()) {
|
||||
$variadic .= $k;
|
||||
} else {
|
||||
$params[] = $k;
|
||||
|
||||
9
vendor/symfony/var-dumper/Caster/Caster.php
vendored
9
vendor/symfony/var-dumper/Caster/Caster.php
vendored
@@ -48,11 +48,6 @@ 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 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;
|
||||
}
|
||||
if ($hasDebugInfo) {
|
||||
$a = $obj->__debugInfo();
|
||||
} elseif ($obj instanceof \Closure) {
|
||||
@@ -122,10 +117,10 @@ class Caster
|
||||
} 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
vendor/symfony/var-dumper/Caster/ClassStub.php
vendored
16
vendor/symfony/var-dumper/Caster/ClassStub.php
vendored
@@ -22,12 +22,12 @@ class ClassStub extends ConstStub
|
||||
* @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
|
||||
*/
|
||||
public function __construct($identifier, $callable = null)
|
||||
public function __construct(string $identifier, $callable = null)
|
||||
{
|
||||
$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;
|
||||
}
|
||||
@@ -36,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));
|
||||
@@ -51,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) {
|
||||
@@ -70,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);
|
||||
|
||||
@@ -20,7 +20,7 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
*/
|
||||
class ConstStub extends Stub
|
||||
{
|
||||
public function __construct($name, $value)
|
||||
public function __construct(string $name, $value)
|
||||
{
|
||||
$this->class = $name;
|
||||
$this->value = $value;
|
||||
|
||||
@@ -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
vendor/symfony/var-dumper/Caster/CutStub.php
vendored
8
vendor/symfony/var-dumper/Caster/CutStub.php
vendored
@@ -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;
|
||||
}
|
||||
|
||||
19
vendor/symfony/var-dumper/Caster/DateCaster.php
vendored
19
vendor/symfony/var-dumper/Caster/DateCaster.php
vendored
@@ -20,6 +20,8 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
*/
|
||||
class DateCaster
|
||||
{
|
||||
private const PERIOD_LIMIT = 3;
|
||||
|
||||
public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, $isNested, $filter)
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
@@ -61,12 +63,7 @@ class DateCaster
|
||||
$format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : '');
|
||||
}
|
||||
|
||||
if (\PHP_VERSION_ID >= 70100 && isset($i->f)) {
|
||||
$format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : '';
|
||||
} else {
|
||||
$format .= $i->h || $i->i || $i->s ? '%H:%I:%S' : '';
|
||||
}
|
||||
|
||||
$format .= $i->h || $i->i || $i->s || $i->f ? '%H:%I:'.self::formatSeconds($i->s, substr($i->f, 2)) : '';
|
||||
$format = '%R ' === $format ? '0s' : $format;
|
||||
|
||||
return $i->format(rtrim($format));
|
||||
@@ -76,7 +73,7 @@ class DateCaster
|
||||
{
|
||||
$location = $timeZone->getLocation();
|
||||
$formatted = (new \DateTime('now', $timeZone))->format($location ? 'e (P)' : 'P');
|
||||
$title = $location && extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code'], \Locale::getDefault()) : '';
|
||||
$title = $location && \extension_loaded('intl') ? \Locale::getDisplayRegion('-'.$location['country_code']) : '';
|
||||
|
||||
$z = array(Caster::PREFIX_VIRTUAL.'timezone' => new ConstStub($formatted, $title));
|
||||
|
||||
@@ -85,14 +82,10 @@ class DateCaster
|
||||
|
||||
public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, $isNested, $filter)
|
||||
{
|
||||
if (defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) { // see https://bugs.php.net/bug.php?id=71635
|
||||
return $a;
|
||||
}
|
||||
|
||||
$dates = array();
|
||||
if (\PHP_VERSION_ID >= 70107) { // see https://bugs.php.net/bug.php?id=74639
|
||||
foreach (clone $p as $i => $d) {
|
||||
if (3 === $i) {
|
||||
if (self::PERIOD_LIMIT === $i) {
|
||||
$now = new \DateTimeImmutable();
|
||||
$dates[] = sprintf('%s more', ($end = $p->getEndDate())
|
||||
? ceil(($end->format('U.u') - $d->format('U.u')) / ($now->add($p->getDateInterval())->format('U.u') - $now->format('U.u')))
|
||||
@@ -124,6 +117,6 @@ class DateCaster
|
||||
|
||||
private static function formatSeconds($s, $us)
|
||||
{
|
||||
return sprintf('%02d.%s', $s, 0 === ($len = strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us));
|
||||
return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ class EnumStub extends Stub
|
||||
{
|
||||
public $dumpKeys = true;
|
||||
|
||||
public function __construct(array $values, $dumpKeys = true)
|
||||
public function __construct(array $values, bool $dumpKeys = true)
|
||||
{
|
||||
$this->value = $values;
|
||||
$this->dumpKeys = $dumpKeys;
|
||||
|
||||
@@ -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']);
|
||||
@@ -118,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);
|
||||
}
|
||||
@@ -175,7 +175,7 @@ class ExceptionCaster
|
||||
$lastCall = $call;
|
||||
}
|
||||
if (null !== $trace->sliceLength) {
|
||||
$a = array_slice($a, 0, $trace->sliceLength, true);
|
||||
$a = \array_slice($a, 0, $trace->sliceLength, true);
|
||||
}
|
||||
|
||||
return $a;
|
||||
@@ -199,7 +199,7 @@ 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;
|
||||
@@ -212,7 +212,7 @@ class ExceptionCaster
|
||||
|
||||
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() : '');
|
||||
@@ -231,7 +231,7 @@ 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= ';
|
||||
|
||||
@@ -21,7 +21,7 @@ class FrameStub extends EnumStub
|
||||
public $keepArgs;
|
||||
public $inTraceStub;
|
||||
|
||||
public function __construct(array $frame, $keepArgs = true, $inTraceStub = false)
|
||||
public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false)
|
||||
{
|
||||
$this->value = $frame;
|
||||
$this->keepArgs = $keepArgs;
|
||||
|
||||
30
vendor/symfony/var-dumper/Caster/GmpCaster.php
vendored
Normal file
30
vendor/symfony/var-dumper/Caster/GmpCaster.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* Casts GMP objects to array representation.
|
||||
*
|
||||
* @author Hamza Amrouche <hamza.simperfit@gmail.com>
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
class GmpCaster
|
||||
{
|
||||
public static function castGmp(\GMP $gmp, array $a, Stub $stub, $isNested, $filter): array
|
||||
{
|
||||
$a[Caster::PREFIX_VIRTUAL.'value'] = new ConstStub(gmp_strval($gmp), gmp_strval($gmp));
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
24
vendor/symfony/var-dumper/Caster/LinkStub.php
vendored
24
vendor/symfony/var-dumper/Caster/LinkStub.php
vendored
@@ -23,14 +23,14 @@ class LinkStub extends ConstStub
|
||||
private static $vendorRoots;
|
||||
private static $composerRoots;
|
||||
|
||||
public function __construct($label, $line = 0, $href = null)
|
||||
public function __construct($label, int $line = 0, $href = null)
|
||||
{
|
||||
$this->value = $label;
|
||||
|
||||
if (null === $href) {
|
||||
$href = $label;
|
||||
}
|
||||
if (!is_string($href)) {
|
||||
if (!\is_string($href)) {
|
||||
return;
|
||||
}
|
||||
if (0 === strpos($href, 'file://')) {
|
||||
@@ -53,11 +53,11 @@ class LinkStub extends ConstStub
|
||||
return;
|
||||
}
|
||||
if ($composerRoot = $this->getComposerRoot($href, $this->inVendor)) {
|
||||
$this->attr['ellipsis'] = strlen($href) - strlen($composerRoot) + 1;
|
||||
$this->attr['ellipsis'] = \strlen($href) - \strlen($composerRoot) + 1;
|
||||
$this->attr['ellipsis-type'] = 'path';
|
||||
$this->attr['ellipsis-tail'] = 1 + ($this->inVendor ? 2 + strlen(implode(array_slice(explode(DIRECTORY_SEPARATOR, substr($href, 1 - $this->attr['ellipsis'])), 0, 2))) : 0);
|
||||
} elseif (3 < count($ellipsis = explode(DIRECTORY_SEPARATOR, $href))) {
|
||||
$this->attr['ellipsis'] = 2 + strlen(implode(array_slice($ellipsis, -2)));
|
||||
$this->attr['ellipsis-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;
|
||||
}
|
||||
@@ -71,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];
|
||||
}
|
||||
|
||||
@@ -96,13 +96,13 @@ class LinkStub extends ConstStub
|
||||
// open_basedir restriction in effect
|
||||
break;
|
||||
}
|
||||
if ($parent === dirname($parent)) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
38
vendor/symfony/var-dumper/Caster/MongoCaster.php
vendored
38
vendor/symfony/var-dumper/Caster/MongoCaster.php
vendored
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Caster;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
@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
|
||||
{
|
||||
public static function castCursor(\MongoCursorInterface $cursor, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
if ($info = $cursor->info()) {
|
||||
foreach ($info as $k => $v) {
|
||||
$a[Caster::PREFIX_VIRTUAL.$k] = $v;
|
||||
}
|
||||
}
|
||||
$a[Caster::PREFIX_VIRTUAL.'dead'] = $cursor->dead();
|
||||
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
@@ -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]);
|
||||
}
|
||||
|
||||
11
vendor/symfony/var-dumper/Caster/RedisCaster.php
vendored
11
vendor/symfony/var-dumper/Caster/RedisCaster.php
vendored
@@ -30,15 +30,6 @@ class RedisCaster
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
if (!$connected = $c->isConnected()) {
|
||||
return $a + array(
|
||||
$prefix.'isConnected' => $connected,
|
||||
@@ -46,7 +37,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,
|
||||
|
||||
@@ -36,7 +36,6 @@ class ReflectionCaster
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$c = new \ReflectionFunction($c);
|
||||
|
||||
$stub->class = 'Closure'; // HHVM generates unique class names for closures
|
||||
$a = static::castFunctionAbstract($c, $a, $stub, $isNested, $filter);
|
||||
|
||||
if (isset($a[$prefix.'parameters'])) {
|
||||
@@ -86,7 +85,7 @@ class ReflectionCaster
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
$a += array(
|
||||
$prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : $c->__toString(),
|
||||
$prefix.'name' => $c->getName(),
|
||||
$prefix.'allowsNull' => $c->allowsNull(),
|
||||
$prefix.'isBuiltin' => $c->isBuiltin(),
|
||||
);
|
||||
@@ -173,7 +172,7 @@ class ReflectionCaster
|
||||
|
||||
if (isset($a[$prefix.'returnType'])) {
|
||||
$v = $a[$prefix.'returnType'];
|
||||
$v = $v instanceof \ReflectionNamedType ? $v->getName() : $v->__toString();
|
||||
$v = $v->getName();
|
||||
$a[$prefix.'returnType'] = new ClassStub($a[$prefix.'returnType']->allowsNull() ? '?'.$v : $v, array(class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', ''));
|
||||
}
|
||||
if (isset($a[$prefix.'class'])) {
|
||||
@@ -185,7 +184,7 @@ class ReflectionCaster
|
||||
|
||||
foreach ($c->getParameters() as $v) {
|
||||
$k = '$'.$v->name;
|
||||
if (method_exists($v, 'isVariadic') && $v->isVariadic()) {
|
||||
if ($v->isVariadic()) {
|
||||
$k = '...'.$k;
|
||||
}
|
||||
if ($v->isPassedByReference()) {
|
||||
@@ -199,7 +198,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;
|
||||
@@ -213,9 +212,6 @@ class ReflectionCaster
|
||||
self::addExtra($a, $c);
|
||||
}
|
||||
|
||||
// Added by HHVM
|
||||
unset($a[Caster::PREFIX_DYNAMIC.'static']);
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
@@ -230,9 +226,6 @@ class ReflectionCaster
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
|
||||
// Added by HHVM
|
||||
unset($a['info']);
|
||||
|
||||
self::addMap($a, $c, array(
|
||||
'position' => 'getPosition',
|
||||
'isVariadic' => 'isVariadic',
|
||||
@@ -240,12 +233,8 @@ class ReflectionCaster
|
||||
'allowsNull' => 'allowsNull',
|
||||
));
|
||||
|
||||
if (method_exists($c, 'getType')) {
|
||||
if ($v = $c->getType()) {
|
||||
$a[$prefix.'typeHint'] = $v instanceof \ReflectionNamedType ? $v->getName() : $v->__toString();
|
||||
}
|
||||
} elseif (preg_match('/^(?:[^ ]++ ){4}([a-zA-Z_\x7F-\xFF][^ ]++)/', $c, $v)) {
|
||||
$a[$prefix.'typeHint'] = $v[1];
|
||||
if ($v = $c->getType()) {
|
||||
$a[$prefix.'typeHint'] = $v->getName();
|
||||
}
|
||||
|
||||
if (isset($a[$prefix.'typeHint'])) {
|
||||
@@ -257,17 +246,13 @@ class ReflectionCaster
|
||||
|
||||
try {
|
||||
$a[$prefix.'default'] = $v = $c->getDefaultValue();
|
||||
if (method_exists($c, 'isDefaultValueConstant') && $c->isDefaultValueConstant()) {
|
||||
if ($c->isDefaultValueConstant()) {
|
||||
$a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v);
|
||||
}
|
||||
if (null === $v) {
|
||||
unset($a[$prefix.'allowsNull']);
|
||||
}
|
||||
} catch (\ReflectionException $e) {
|
||||
if (isset($a[$prefix.'typeHint']) && $c->allowsNull() && !class_exists('ReflectionNamedType', false)) {
|
||||
$a[$prefix.'default'] = null;
|
||||
unset($a[$prefix.'allowsNull']);
|
||||
}
|
||||
}
|
||||
|
||||
return $a;
|
||||
|
||||
53
vendor/symfony/var-dumper/Caster/SplCaster.php
vendored
53
vendor/symfony/var-dumper/Caster/SplCaster.php
vendored
@@ -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 ('ArrayObject' === $class) {
|
||||
$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)
|
||||
@@ -186,7 +168,7 @@ class SplCaster
|
||||
|
||||
$clone = clone $c;
|
||||
foreach ($clone as $obj) {
|
||||
$storage[spl_object_hash($obj)] = array(
|
||||
$storage[] = array(
|
||||
'object' => $obj,
|
||||
'info' => $clone->getInfo(),
|
||||
);
|
||||
@@ -205,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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class TraceStub extends Stub
|
||||
public $sliceLength;
|
||||
public $numberingOffset;
|
||||
|
||||
public function __construct(array $trace, $keepArgs = true, $sliceOffset = 0, $sliceLength = null, $numberingOffset = 0)
|
||||
public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, int $sliceLength = null, int $numberingOffset = 0)
|
||||
{
|
||||
$this->value = $trace;
|
||||
$this->keepArgs = $keepArgs;
|
||||
|
||||
@@ -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'),
|
||||
@@ -104,8 +105,6 @@ abstract class AbstractCloner implements ClonerInterface
|
||||
'SplPriorityQueue' => array('Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'),
|
||||
'OuterIterator' => array('Symfony\Component\VarDumper\Caster\SplCaster', 'castOuterIterator'),
|
||||
|
||||
'MongoCursorInterface' => array('Symfony\Component\VarDumper\Caster\MongoCaster', 'castCursor'),
|
||||
|
||||
'Redis' => array('Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedis'),
|
||||
'RedisArray' => array('Symfony\Component\VarDumper\Caster\RedisCaster', 'castRedisArray'),
|
||||
|
||||
@@ -114,6 +113,8 @@ abstract class AbstractCloner implements ClonerInterface
|
||||
'DateTimeZone' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castTimeZone'),
|
||||
'DatePeriod' => array('Symfony\Component\VarDumper\Caster\DateCaster', 'castPeriod'),
|
||||
|
||||
'GMP' => array('Symfony\Component\VarDumper\Caster\GmpCaster', 'castGmp'),
|
||||
|
||||
':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'),
|
||||
@@ -133,7 +134,6 @@ abstract class AbstractCloner implements ClonerInterface
|
||||
protected $maxItems = 2500;
|
||||
protected $maxString = -1;
|
||||
protected $minDepth = 1;
|
||||
protected $useExt;
|
||||
|
||||
private $casters = array();
|
||||
private $prevErrorHandler;
|
||||
@@ -151,7 +151,6 @@ abstract class AbstractCloner implements ClonerInterface
|
||||
$casters = static::$defaultCasters;
|
||||
}
|
||||
$this->addCasters($casters);
|
||||
$this->useExt = extension_loaded('symfony_debug');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -167,7 +166,7 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,7 +218,7 @@ abstract class AbstractCloner implements ClonerInterface
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
34
vendor/symfony/var-dumper/Cloner/Data.php
vendored
34
vendor/symfony/var-dumper/Cloner/Data.php
vendored
@@ -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';
|
||||
@@ -63,7 +63,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
/**
|
||||
* @param bool $recursive Whether values should be resolved recursively or not
|
||||
*
|
||||
* @return string|int|float|bool|array|null|Data[] A native representation of the original value
|
||||
* @return string|int|float|bool|array|Data[]|null A native representation of the original value
|
||||
*/
|
||||
public function getValue($recursive = false)
|
||||
{
|
||||
@@ -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) {
|
||||
@@ -158,23 +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 array The raw data structure
|
||||
*
|
||||
* @deprecated since version 3.3. Use array or object access instead.
|
||||
*/
|
||||
public function getRawData()
|
||||
{
|
||||
@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;
|
||||
return sprintf('%s (count=%d)', $this->getType(), \count($value));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -312,7 +300,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
$cursor->hardRefCount = $item->refCount;
|
||||
}
|
||||
$cursor->attr = $item->attr;
|
||||
$type = $item->class ?: gettype($item->value);
|
||||
$type = $item->class ?: \gettype($item->value);
|
||||
$item = $this->getStub($item->value);
|
||||
}
|
||||
if ($item instanceof Stub) {
|
||||
@@ -334,7 +322,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
|
||||
if ($cursor->stop) {
|
||||
if ($cut >= 0) {
|
||||
$cut += count($children);
|
||||
$cut += \count($children);
|
||||
}
|
||||
$children = array();
|
||||
}
|
||||
@@ -363,7 +351,7 @@ class Data implements \ArrayAccess, \Countable, \IteratorAggregate
|
||||
$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);
|
||||
@@ -401,7 +389,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);
|
||||
|
||||
50
vendor/symfony/var-dumper/Cloner/VarCloner.php
vendored
50
vendor/symfony/var-dumper/Cloner/VarCloner.php
vendored
@@ -17,8 +17,6 @@ namespace Symfony\Component\VarDumper\Cloner;
|
||||
class VarCloner extends AbstractCloner
|
||||
{
|
||||
private static $gid;
|
||||
private static $hashMask = 0;
|
||||
private static $hashOffset = 0;
|
||||
private static $arrayCache = array();
|
||||
|
||||
/**
|
||||
@@ -31,10 +29,10 @@ class VarCloner extends AbstractCloner
|
||||
$refsCounter = 0; // Hard references counter
|
||||
$queue = array(array($var)); // This breadth-first queue is the return value
|
||||
$indexedArrays = array(); // Map of queue indexes that hold numerically indexed arrays
|
||||
$hardRefs = array(); // Map of original zval hashes to stub objects
|
||||
$hardRefs = array(); // Map of original zval ids 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
|
||||
$values = array(); // Map of stub objects' ids to original values
|
||||
$maxItems = $this->maxItems;
|
||||
$maxString = $this->maxString;
|
||||
$minDepth = $this->minDepth;
|
||||
@@ -46,13 +44,9 @@ class VarCloner extends AbstractCloner
|
||||
$stub = null; // Stub capturing the main properties of an original item value
|
||||
// or null if the original value is used directly
|
||||
|
||||
if (!self::$hashMask) {
|
||||
self::$gid = uniqid(mt_rand(), true); // Unique string used to detect the special $GLOBALS variable
|
||||
self::initHashMask();
|
||||
if (!$gid = self::$gid) {
|
||||
$gid = self::$gid = uniqid(mt_rand(), true); // Unique string used to detect the special $GLOBALS variable
|
||||
}
|
||||
$gid = self::$gid;
|
||||
$hashMask = self::$hashMask;
|
||||
$hashOffset = self::$hashOffset;
|
||||
$arrayStub = new Stub();
|
||||
$arrayStub->type = Stub::TYPE_ARRAY;
|
||||
$fromObjCast = false;
|
||||
@@ -89,7 +83,7 @@ class VarCloner extends AbstractCloner
|
||||
if ($zvalIsRef = $vals[$k] === $cookie) {
|
||||
$vals[$k] = &$stub; // Break hard references to make $queue completely
|
||||
unset($stub); // independent from the original structure
|
||||
if ($v instanceof Stub && isset($hardRefs[\spl_object_hash($v)])) {
|
||||
if ($v instanceof Stub && isset($hardRefs[\spl_object_id($v)])) {
|
||||
$vals[$k] = $refs[$k] = $v;
|
||||
if ($v->value instanceof Stub && (Stub::TYPE_OBJECT === $v->value->type || Stub::TYPE_RESOURCE === $v->value->type)) {
|
||||
++$v->value->refCount;
|
||||
@@ -99,7 +93,7 @@ class VarCloner extends AbstractCloner
|
||||
}
|
||||
$refs[$k] = $vals[$k] = new Stub();
|
||||
$refs[$k]->value = $v;
|
||||
$h = \spl_object_hash($refs[$k]);
|
||||
$h = \spl_object_id($refs[$k]);
|
||||
$hardRefs[$h] = &$refs[$k];
|
||||
$values[$h] = $v;
|
||||
$vals[$k]->handle = ++$refsCounter;
|
||||
@@ -178,7 +172,7 @@ class VarCloner extends AbstractCloner
|
||||
|
||||
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))])) {
|
||||
if (empty($objRefs[$h = \spl_object_id($v)])) {
|
||||
$stub = new Stub();
|
||||
$stub->type = Stub::TYPE_OBJECT;
|
||||
$stub->class = \get_class($v);
|
||||
@@ -189,8 +183,7 @@ class VarCloner extends AbstractCloner
|
||||
if (Stub::TYPE_OBJECT !== $stub->type || null === $stub->value) {
|
||||
break;
|
||||
}
|
||||
$h = $hashMask ^ \hexdec(\substr(\spl_object_hash($stub->value), $hashOffset, \PHP_INT_SIZE));
|
||||
$stub->handle = $h;
|
||||
$stub->handle = $h = \spl_object_id($stub->value);
|
||||
}
|
||||
$stub->value = null;
|
||||
if (0 <= $maxItems && $maxItems <= $pos && $minimumDepthReached) {
|
||||
@@ -297,31 +290,4 @@ class VarCloner extends AbstractCloner
|
||||
|
||||
return $queue;
|
||||
}
|
||||
|
||||
private static function initHashMask()
|
||||
{
|
||||
$obj = (object) array();
|
||||
self::$hashOffset = 16 - PHP_INT_SIZE;
|
||||
self::$hashMask = -1;
|
||||
|
||||
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)) {
|
||||
$frame['line'] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!empty($frame['line'])) {
|
||||
ob_start();
|
||||
debug_zval_dump($obj);
|
||||
self::$hashMask = (int) substr(ob_get_clean(), 17);
|
||||
}
|
||||
}
|
||||
|
||||
self::$hashMask ^= hexdec(substr(spl_object_hash($obj), self::$hashOffset, PHP_INT_SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
81
vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
vendored
Normal file
81
vendor/symfony/var-dumper/Command/Descriptor/CliDescriptor.php
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Command\Descriptor;
|
||||
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
|
||||
/**
|
||||
* Describe collected data clones for cli output.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class CliDescriptor implements DumpDescriptorInterface
|
||||
{
|
||||
private $dumper;
|
||||
private $lastIdentifier;
|
||||
|
||||
public function __construct(CliDumper $dumper)
|
||||
{
|
||||
$this->dumper = $dumper;
|
||||
}
|
||||
|
||||
public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void
|
||||
{
|
||||
$io = $output instanceof SymfonyStyle ? $output : new SymfonyStyle(new ArrayInput(array()), $output);
|
||||
$this->dumper->setColors($output->isDecorated());
|
||||
|
||||
$rows = array(array('date', date('r', $context['timestamp'])));
|
||||
$lastIdentifier = $this->lastIdentifier;
|
||||
$this->lastIdentifier = $clientId;
|
||||
|
||||
$section = "Received from client #$clientId";
|
||||
if (isset($context['request'])) {
|
||||
$request = $context['request'];
|
||||
$this->lastIdentifier = $request['identifier'];
|
||||
$section = sprintf('%s %s', $request['method'], $request['uri']);
|
||||
if ($controller = $request['controller']) {
|
||||
$rows[] = array('controller', rtrim($this->dumper->dump($controller, true), "\n"));
|
||||
}
|
||||
} elseif (isset($context['cli'])) {
|
||||
$this->lastIdentifier = $context['cli']['identifier'];
|
||||
$section = '$ '.$context['cli']['command_line'];
|
||||
}
|
||||
|
||||
if ($this->lastIdentifier !== $lastIdentifier) {
|
||||
$io->section($section);
|
||||
}
|
||||
|
||||
if (isset($context['source'])) {
|
||||
$source = $context['source'];
|
||||
$rows[] = array('source', sprintf('%s on line %d', $source['name'], $source['line']));
|
||||
$file = $source['file_relative'] ?? $source['file'];
|
||||
$rows[] = array('file', $file);
|
||||
$fileLink = $source['file_link'] ?? null;
|
||||
}
|
||||
|
||||
$io->table(array(), $rows);
|
||||
|
||||
if (isset($fileLink)) {
|
||||
$io->writeln(array('<info>Open source in your IDE/browser:</info>', $fileLink));
|
||||
$io->newLine();
|
||||
}
|
||||
|
||||
$this->dumper->dump($data);
|
||||
$io->newLine();
|
||||
}
|
||||
}
|
||||
23
vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php
vendored
Normal file
23
vendor/symfony/var-dumper/Command/Descriptor/DumpDescriptorInterface.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Command\Descriptor;
|
||||
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
|
||||
/**
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
interface DumpDescriptorInterface
|
||||
{
|
||||
public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void;
|
||||
}
|
||||
119
vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
vendored
Normal file
119
vendor/symfony/var-dumper/Command/Descriptor/HtmlDescriptor.php
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Command\Descriptor;
|
||||
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
||||
|
||||
/**
|
||||
* Describe collected data clones for html output.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class HtmlDescriptor implements DumpDescriptorInterface
|
||||
{
|
||||
private $dumper;
|
||||
private $initialized = false;
|
||||
|
||||
public function __construct(HtmlDumper $dumper)
|
||||
{
|
||||
$this->dumper = $dumper;
|
||||
}
|
||||
|
||||
public function describe(OutputInterface $output, Data $data, array $context, int $clientId): void
|
||||
{
|
||||
if (!$this->initialized) {
|
||||
$styles = file_get_contents(__DIR__.'/../../Resources/css/htmlDescriptor.css');
|
||||
$scripts = file_get_contents(__DIR__.'/../../Resources/js/htmlDescriptor.js');
|
||||
$output->writeln("<style>$styles</style><script>$scripts</script>");
|
||||
$this->initialized = true;
|
||||
}
|
||||
|
||||
$title = '-';
|
||||
if (isset($context['request'])) {
|
||||
$request = $context['request'];
|
||||
$controller = "<span class='dumped-tag'>{$this->dumper->dump($request['controller'], true, array('maxDepth' => 0))}</span>";
|
||||
$title = sprintf('<code>%s</code> <a href="%s">%s</a>', $request['method'], $uri = $request['uri'], $uri);
|
||||
$dedupIdentifier = $request['identifier'];
|
||||
} elseif (isset($context['cli'])) {
|
||||
$title = '<code>$ </code>'.$context['cli']['command_line'];
|
||||
$dedupIdentifier = $context['cli']['identifier'];
|
||||
} else {
|
||||
$dedupIdentifier = uniqid('', true);
|
||||
}
|
||||
|
||||
$sourceDescription = '';
|
||||
if (isset($context['source'])) {
|
||||
$source = $context['source'];
|
||||
$projectDir = $source['project_dir'];
|
||||
$sourceDescription = sprintf('%s on line %d', $source['name'], $source['line']);
|
||||
if (isset($source['file_link'])) {
|
||||
$sourceDescription = sprintf('<a href="%s">%s</a>', $source['file_link'], $sourceDescription);
|
||||
}
|
||||
}
|
||||
|
||||
$isoDate = $this->extractDate($context, 'c');
|
||||
$tags = array_filter(array(
|
||||
'controller' => $controller ?? null,
|
||||
'project dir' => $projectDir ?? null,
|
||||
));
|
||||
|
||||
$output->writeln(<<<HTML
|
||||
<article data-dedup-id="$dedupIdentifier">
|
||||
<header>
|
||||
<div class="row">
|
||||
<h2 class="col">$title</h2>
|
||||
<time class="col text-small" title="$isoDate" datetime="$isoDate">
|
||||
{$this->extractDate($context)}
|
||||
</time>
|
||||
</div>
|
||||
{$this->renderTags($tags)}
|
||||
</header>
|
||||
<section class="body">
|
||||
<p class="text-small">
|
||||
$sourceDescription
|
||||
</p>
|
||||
{$this->dumper->dump($data, true)}
|
||||
</section>
|
||||
</article>
|
||||
HTML
|
||||
);
|
||||
}
|
||||
|
||||
private function extractDate(array $context, string $format = 'r'): string
|
||||
{
|
||||
return date($format, $context['timestamp']);
|
||||
}
|
||||
|
||||
private function renderTags(array $tags): string
|
||||
{
|
||||
if (!$tags) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$renderedTags = '';
|
||||
foreach ($tags as $key => $value) {
|
||||
$renderedTags .= sprintf('<li><span class="badge">%s</span>%s</li>', $key, $value);
|
||||
}
|
||||
|
||||
return <<<HTML
|
||||
<div class="row">
|
||||
<ul class="tags">
|
||||
$renderedTags
|
||||
</ul>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
99
vendor/symfony/var-dumper/Command/ServerDumpCommand.php
vendored
Normal file
99
vendor/symfony/var-dumper/Command/ServerDumpCommand.php
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor;
|
||||
use Symfony\Component\VarDumper\Command\Descriptor\DumpDescriptorInterface;
|
||||
use Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
||||
use Symfony\Component\VarDumper\Server\DumpServer;
|
||||
|
||||
/**
|
||||
* Starts a dump server to collect and output dumps on a single place with multiple formats support.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class ServerDumpCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'server:dump';
|
||||
|
||||
private $server;
|
||||
|
||||
/** @var DumpDescriptorInterface[] */
|
||||
private $descriptors;
|
||||
|
||||
public function __construct(DumpServer $server, array $descriptors = array())
|
||||
{
|
||||
$this->server = $server;
|
||||
$this->descriptors = $descriptors + array(
|
||||
'cli' => new CliDescriptor(new CliDumper()),
|
||||
'html' => new HtmlDescriptor(new HtmlDumper()),
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$availableFormats = implode(', ', array_keys($this->descriptors));
|
||||
|
||||
$this
|
||||
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli')
|
||||
->setDescription('Starts a dump server that collects and displays dumps in a single place')
|
||||
->setHelp(<<<'EOF'
|
||||
<info>%command.name%</info> starts a dump server that collects and displays
|
||||
dumps in a single place for debugging you application:
|
||||
|
||||
<info>php %command.full_name%</info>
|
||||
|
||||
You can consult dumped data in HTML format in your browser by providing the <comment>--format=html</comment> option
|
||||
and redirecting the output to a file:
|
||||
|
||||
<info>php %command.full_name% --format="html" > dump.html</info>
|
||||
|
||||
EOF
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$format = $input->getOption('format');
|
||||
|
||||
if (!$descriptor = $this->descriptors[$format] ?? null) {
|
||||
throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $format));
|
||||
}
|
||||
|
||||
$errorIo = $io->getErrorStyle();
|
||||
$errorIo->title('Symfony Var Dumper Server');
|
||||
|
||||
$this->server->start();
|
||||
|
||||
$errorIo->success(sprintf('Server listening on %s', $this->server->getHost()));
|
||||
$errorIo->comment('Quit the server with CONTROL-C.');
|
||||
|
||||
$this->server->listen(function (Data $data, array $context, int $clientId) use ($descriptor, $io) {
|
||||
$descriptor->describe($io, $data, $context, $clientId);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -42,14 +42,14 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
||||
* @param string $charset The default character encoding to use for non-UTF8 strings
|
||||
* @param int $flags A bit field of static::DUMP_* constants to fine tune dumps representation
|
||||
*/
|
||||
public function __construct($output = null, $charset = null, $flags = 0)
|
||||
public function __construct($output = null, string $charset = null, int $flags = 0)
|
||||
{
|
||||
$this->flags = (int) $flags;
|
||||
$this->flags = $flags;
|
||||
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
|
||||
$this->decimalPoint = localeconv();
|
||||
$this->decimalPoint = $this->decimalPoint['decimal_point'];
|
||||
$this->setOutput($output ?: static::$defaultOutput);
|
||||
if (!$output && is_string(static::$defaultOutput)) {
|
||||
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;
|
||||
@@ -164,7 +164,7 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
|
||||
*/
|
||||
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 = '';
|
||||
}
|
||||
|
||||
@@ -195,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.');
|
||||
}
|
||||
|
||||
|
||||
41
vendor/symfony/var-dumper/Dumper/CliDumper.php
vendored
41
vendor/symfony/var-dumper/Dumper/CliDumper.php
vendored
@@ -58,11 +58,11 @@ class CliDumper extends AbstractDumper
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct($output = null, $charset = null, $flags = 0)
|
||||
public function __construct($output = null, string $charset = null, int $flags = 0)
|
||||
{
|
||||
parent::__construct($output, $charset, $flags);
|
||||
|
||||
if ('\\' === DIRECTORY_SEPARATOR && !$this->isWindowsTrueColor()) {
|
||||
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',
|
||||
@@ -186,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) {
|
||||
@@ -339,7 +339,7 @@ class CliDumper extends AbstractDumper
|
||||
$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).'" => ';
|
||||
@@ -417,8 +417,8 @@ class CliDumper extends AbstractDumper
|
||||
|
||||
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 ('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']);
|
||||
@@ -439,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;
|
||||
@@ -447,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";
|
||||
}
|
||||
@@ -474,7 +474,7 @@ class CliDumper extends AbstractDumper
|
||||
}
|
||||
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]) {
|
||||
@@ -537,23 +537,27 @@ class CliDumper extends AbstractDumper
|
||||
*/
|
||||
private function hasColorSupport($stream)
|
||||
{
|
||||
if (!is_resource($stream) || 'stream' !== get_resource_type($stream)) {
|
||||
if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (DIRECTORY_SEPARATOR === '\\') {
|
||||
return (function_exists('sapi_windows_vt100_support')
|
||||
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')) {
|
||||
if (\function_exists('stream_isatty')) {
|
||||
return @stream_isatty($stream);
|
||||
}
|
||||
|
||||
if (function_exists('posix_isatty')) {
|
||||
if (\function_exists('posix_isatty')) {
|
||||
return @posix_isatty($stream);
|
||||
}
|
||||
|
||||
@@ -575,9 +579,10 @@ class CliDumper extends AbstractDumper
|
||||
{
|
||||
$result = 183 <= getenv('ANSICON_VER')
|
||||
|| 'ON' === getenv('ConEmuANSI')
|
||||
|| 'xterm' === getenv('TERM');
|
||||
|| 'xterm' === getenv('TERM')
|
||||
|| 'Hyper' === getenv('TERM_PROGRAM');
|
||||
|
||||
if (!$result && PHP_VERSION_ID >= 70200) {
|
||||
if (!$result && \PHP_VERSION_ID >= 70200) {
|
||||
$version = sprintf(
|
||||
'%s.%s.%s',
|
||||
PHP_WINDOWS_VERSION_MAJOR,
|
||||
|
||||
32
vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php
vendored
Normal file
32
vendor/symfony/var-dumper/Dumper/ContextProvider/CliContextProvider.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
|
||||
|
||||
/**
|
||||
* Tries to provide context on CLI.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
final class CliContextProvider implements ContextProviderInterface
|
||||
{
|
||||
public function getContext(): ?array
|
||||
{
|
||||
if ('cli' !== \PHP_SAPI) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return array(
|
||||
'command_line' => $commandLine = implode(' ', $_SERVER['argv']),
|
||||
'identifier' => hash('crc32b', $commandLine.$_SERVER['REQUEST_TIME_FLOAT']),
|
||||
);
|
||||
}
|
||||
}
|
||||
25
vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php
vendored
Normal file
25
vendor/symfony/var-dumper/Dumper/ContextProvider/ContextProviderInterface.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
|
||||
|
||||
/**
|
||||
* Interface to provide contextual data about dump data clones sent to a server.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
interface ContextProviderInterface
|
||||
{
|
||||
/**
|
||||
* @return array|null Context data or null if unable to provide any context
|
||||
*/
|
||||
public function getContext(): ?array;
|
||||
}
|
||||
49
vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
vendored
Normal file
49
vendor/symfony/var-dumper/Dumper/ContextProvider/RequestContextProvider.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
|
||||
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
|
||||
/**
|
||||
* Tries to provide context from a request.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
final class RequestContextProvider implements ContextProviderInterface
|
||||
{
|
||||
private $requestStack;
|
||||
private $cloner;
|
||||
|
||||
public function __construct(RequestStack $requestStack)
|
||||
{
|
||||
$this->requestStack = $requestStack;
|
||||
$this->cloner = new VarCloner();
|
||||
$this->cloner->setMaxItems(0);
|
||||
}
|
||||
|
||||
public function getContext(): ?array
|
||||
{
|
||||
if (null === $request = $this->requestStack->getCurrentRequest()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$controller = $request->attributes->get('_controller');
|
||||
|
||||
return array(
|
||||
'uri' => $request->getUri(),
|
||||
'method' => $request->getMethod(),
|
||||
'controller' => $controller ? $this->cloner->cloneVar($controller) : $controller,
|
||||
'identifier' => spl_object_hash($request),
|
||||
);
|
||||
}
|
||||
}
|
||||
126
vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
vendored
Normal file
126
vendor/symfony/var-dumper/Dumper/ContextProvider/SourceContextProvider.php
vendored
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Dumper\ContextProvider;
|
||||
|
||||
use Symfony\Component\HttpKernel\Debug\FileLinkFormatter;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\HtmlDumper;
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
use Twig\Template;
|
||||
|
||||
/**
|
||||
* Tries to provide context from sources (class name, file, line, code excerpt, ...).
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
final class SourceContextProvider implements ContextProviderInterface
|
||||
{
|
||||
private $limit;
|
||||
private $charset;
|
||||
private $projectDir;
|
||||
private $fileLinkFormatter;
|
||||
|
||||
public function __construct(string $charset = null, string $projectDir = null, FileLinkFormatter $fileLinkFormatter = null, int $limit = 9)
|
||||
{
|
||||
$this->charset = $charset;
|
||||
$this->projectDir = $projectDir;
|
||||
$this->fileLinkFormatter = $fileLinkFormatter;
|
||||
$this->limit = $limit;
|
||||
}
|
||||
|
||||
public function getContext(): ?array
|
||||
{
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS, $this->limit);
|
||||
|
||||
$file = $trace[1]['file'];
|
||||
$line = $trace[1]['line'];
|
||||
$name = false;
|
||||
$fileExcerpt = false;
|
||||
|
||||
for ($i = 2; $i < $this->limit; ++$i) {
|
||||
if (isset($trace[$i]['class'], $trace[$i]['function'])
|
||||
&& 'dump' === $trace[$i]['function']
|
||||
&& VarDumper::class === $trace[$i]['class']
|
||||
) {
|
||||
$file = $trace[$i]['file'];
|
||||
$line = $trace[$i]['line'];
|
||||
|
||||
while (++$i < $this->limit) {
|
||||
if (isset($trace[$i]['function'], $trace[$i]['file']) && empty($trace[$i]['class']) && 0 !== strpos($trace[$i]['function'], 'call_user_func')) {
|
||||
$file = $trace[$i]['file'];
|
||||
$line = $trace[$i]['line'];
|
||||
|
||||
break;
|
||||
} elseif (isset($trace[$i]['object']) && $trace[$i]['object'] instanceof Template) {
|
||||
$template = $trace[$i]['object'];
|
||||
$name = $template->getTemplateName();
|
||||
$src = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getCode() : (method_exists($template, 'getSource') ? $template->getSource() : false);
|
||||
$info = $template->getDebugInfo();
|
||||
if (isset($info[$trace[$i - 1]['line']])) {
|
||||
$line = $info[$trace[$i - 1]['line']];
|
||||
$file = method_exists($template, 'getSourceContext') ? $template->getSourceContext()->getPath() : null;
|
||||
|
||||
if ($src) {
|
||||
$src = explode("\n", $src);
|
||||
$fileExcerpt = array();
|
||||
|
||||
for ($i = max($line - 3, 1), $max = min($line + 3, \count($src)); $i <= $max; ++$i) {
|
||||
$fileExcerpt[] = '<li'.($i === $line ? ' class="selected"' : '').'><code>'.$this->htmlEncode($src[$i - 1]).'</code></li>';
|
||||
}
|
||||
|
||||
$fileExcerpt = '<ol start="'.max($line - 3, 1).'">'.implode("\n", $fileExcerpt).'</ol>';
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (false === $name) {
|
||||
$name = str_replace('\\', '/', $file);
|
||||
$name = substr($name, strrpos($name, '/') + 1);
|
||||
}
|
||||
|
||||
$context = array('name' => $name, 'file' => $file, 'line' => $line);
|
||||
$context['file_excerpt'] = $fileExcerpt;
|
||||
|
||||
if (null !== $this->projectDir) {
|
||||
$context['project_dir'] = $this->projectDir;
|
||||
if (0 === strpos($file, $this->projectDir)) {
|
||||
$context['file_relative'] = ltrim(substr($file, \strlen($this->projectDir)), \DIRECTORY_SEPARATOR);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->fileLinkFormatter && $fileLink = $this->fileLinkFormatter->format($context['file'], $context['line'])) {
|
||||
$context['file_link'] = $fileLink;
|
||||
}
|
||||
|
||||
return $context;
|
||||
}
|
||||
|
||||
private function htmlEncode(string $s): string
|
||||
{
|
||||
$html = '';
|
||||
|
||||
$dumper = new HtmlDumper(function ($line) use (&$html) { $html .= $line; }, $this->charset);
|
||||
$dumper->setDumpHeader('');
|
||||
$dumper->setDumpBoundaries('', '');
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$dumper->dump($cloner->cloneVar($s));
|
||||
|
||||
return substr(strip_tags($html), 1, -1);
|
||||
}
|
||||
}
|
||||
10
vendor/symfony/var-dumper/Dumper/HtmlDumper.php
vendored
10
vendor/symfony/var-dumper/Dumper/HtmlDumper.php
vendored
@@ -56,7 +56,7 @@ class HtmlDumper extends CliDumper
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function __construct($output = null, $charset = null, $flags = 0)
|
||||
public function __construct($output = null, string $charset = null, int $flags = 0)
|
||||
{
|
||||
AbstractDumper::__construct($output, $charset, $flags);
|
||||
$this->dumpId = 'sf-dump-'.mt_rand();
|
||||
@@ -826,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;
|
||||
@@ -840,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>';
|
||||
@@ -895,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;
|
||||
|
||||
53
vendor/symfony/var-dumper/Dumper/ServerDumper.php
vendored
Normal file
53
vendor/symfony/var-dumper/Dumper/ServerDumper.php
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Dumper;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
use Symfony\Component\VarDumper\Server\Connection;
|
||||
|
||||
/**
|
||||
* ServerDumper forwards serialized Data clones to a server.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
class ServerDumper implements DataDumperInterface
|
||||
{
|
||||
private $connection;
|
||||
private $wrappedDumper;
|
||||
|
||||
/**
|
||||
* @param string $host The server host
|
||||
* @param DataDumperInterface|null $wrappedDumper A wrapped instance used whenever we failed contacting the server
|
||||
* @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
|
||||
*/
|
||||
public function __construct(string $host, DataDumperInterface $wrappedDumper = null, array $contextProviders = array())
|
||||
{
|
||||
$this->connection = new Connection($host, $contextProviders);
|
||||
$this->wrappedDumper = $wrappedDumper;
|
||||
}
|
||||
|
||||
public function getContextProviders(): array
|
||||
{
|
||||
return $this->connection->getContextProviders();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function dump(Data $data)
|
||||
{
|
||||
if (!$this->connection->write($data) && $this->wrappedDumper) {
|
||||
$this->wrappedDumper->dump($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
63
vendor/symfony/var-dumper/Resources/bin/var-dump-server
vendored
Executable file
63
vendor/symfony/var-dumper/Resources/bin/var-dump-server
vendored
Executable file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Starts a dump server to collect and output dumps on a single place with multiple formats support.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Logger\ConsoleLogger;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
use Symfony\Component\VarDumper\Command\ServerDumpCommand;
|
||||
use Symfony\Component\VarDumper\Server\DumpServer;
|
||||
|
||||
function includeIfExists(string $file): bool
|
||||
{
|
||||
return file_exists($file) && include $file;
|
||||
}
|
||||
|
||||
if (
|
||||
!includeIfExists(__DIR__ . '/../../../../autoload.php') &&
|
||||
!includeIfExists(__DIR__ . '/../../vendor/autoload.php') &&
|
||||
!includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php')
|
||||
) {
|
||||
fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!class_exists(Application::class)) {
|
||||
fwrite(STDERR, 'You need the "symfony/console" component in order to run the VarDumper server.'.PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$input = new ArgvInput();
|
||||
$output = new ConsoleOutput();
|
||||
$defaultHost = '127.0.0.1:9912';
|
||||
$host = $input->getParameterOption(['--host'], $_SERVER['VAR_DUMPER_SERVER'] ?? $defaultHost, true);
|
||||
$logger = interface_exists(LoggerInterface::class) ? new ConsoleLogger($output->getErrorOutput()) : null;
|
||||
|
||||
$app = new Application();
|
||||
|
||||
$app->getDefinition()->addOption(
|
||||
new InputOption('--host', null, InputOption::VALUE_REQUIRED, 'The address the server should listen to', $defaultHost)
|
||||
);
|
||||
|
||||
$app->add($command = new ServerDumpCommand(new DumpServer($host, $logger)))
|
||||
->getApplication()
|
||||
->setDefaultCommand($command->getName(), true)
|
||||
->run($input, $output)
|
||||
;
|
||||
129
vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css
vendored
Normal file
129
vendor/symfony/var-dumper/Resources/css/htmlDescriptor.css
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
justify-content: flex-end;
|
||||
max-width: 1140px;
|
||||
margin: auto;
|
||||
padding: 15px;
|
||||
word-wrap: break-word;
|
||||
background-color: #F9F9F9;
|
||||
color: #222;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
a {
|
||||
color: #218BC3;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.text-small {
|
||||
font-size: 12px !important;
|
||||
}
|
||||
article {
|
||||
margin: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
article > header > .row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: baseline;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
article > header > .row > .col {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
article > header > .row > h2 {
|
||||
font-size: 14px;
|
||||
color: #222;
|
||||
font-weight: normal;
|
||||
font-family: "Lucida Console", monospace, sans-serif;
|
||||
word-break: break-all;
|
||||
margin: 20px 5px 0 0;
|
||||
user-select: all;
|
||||
}
|
||||
article > header > .row > h2 > code {
|
||||
white-space: nowrap;
|
||||
user-select: none;
|
||||
color: #cc2255;
|
||||
background-color: #f7f7f9;
|
||||
border: 1px solid #e1e1e8;
|
||||
border-radius: 3px;
|
||||
margin-right: 5px;
|
||||
padding: 0 3px;
|
||||
}
|
||||
article > header > .row > time.col {
|
||||
flex: 0;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
color: #999;
|
||||
font-style: italic;
|
||||
}
|
||||
article > header ul.tags {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
article > header ul.tags > li {
|
||||
user-select: all;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
article > header ul.tags > li > span.badge {
|
||||
display: inline-block;
|
||||
padding: .25em .4em;
|
||||
margin-right: 5px;
|
||||
border-radius: 4px;
|
||||
background-color: #6c757d3b;
|
||||
color: #524d4d;
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
line-height: 1;
|
||||
white-space: nowrap;
|
||||
vertical-align: baseline;
|
||||
user-select: none;
|
||||
}
|
||||
article > section.body {
|
||||
border: 1px solid #d8d8d8;
|
||||
background: #FFF;
|
||||
padding: 10px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
pre.sf-dump {
|
||||
border-radius: 3px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
.dumped-tag > .sf-dump {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
padding: 1px 5px;
|
||||
line-height: 1.4;
|
||||
vertical-align: top;
|
||||
background-color: transparent;
|
||||
user-select: auto;
|
||||
}
|
||||
.dumped-tag > pre.sf-dump,
|
||||
.dumped-tag > .sf-dump-default {
|
||||
color: #CC7832;
|
||||
background: none;
|
||||
}
|
||||
.dumped-tag > .sf-dump .sf-dump-str { color: #629755; }
|
||||
.dumped-tag > .sf-dump .sf-dump-private,
|
||||
.dumped-tag > .sf-dump .sf-dump-protected,
|
||||
.dumped-tag > .sf-dump .sf-dump-public { color: #262626; }
|
||||
.dumped-tag > .sf-dump .sf-dump-note { color: #6897BB; }
|
||||
.dumped-tag > .sf-dump .sf-dump-key { color: #789339; }
|
||||
.dumped-tag > .sf-dump .sf-dump-ref { color: #6E6E6E; }
|
||||
.dumped-tag > .sf-dump .sf-dump-ellipsis { color: #CC7832; max-width: 100em; }
|
||||
.dumped-tag > .sf-dump .sf-dump-ellipsis-path { max-width: 5em; }
|
||||
@@ -15,10 +15,12 @@ if (!function_exists('dump')) {
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
function dump($var)
|
||||
function dump($var, ...$moreVars)
|
||||
{
|
||||
foreach (func_get_args() as $var) {
|
||||
VarDumper::dump($var);
|
||||
VarDumper::dump($var);
|
||||
|
||||
foreach ($moreVars as $v) {
|
||||
VarDumper::dump($v);
|
||||
}
|
||||
|
||||
if (1 < func_num_args()) {
|
||||
@@ -28,3 +30,16 @@ if (!function_exists('dump')) {
|
||||
return $var;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('dd')) {
|
||||
function dd($var, ...$moreVars)
|
||||
{
|
||||
VarDumper::dump($var);
|
||||
|
||||
foreach ($moreVars as $v) {
|
||||
VarDumper::dump($v);
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
10
vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js
vendored
Normal file
10
vendor/symfony/var-dumper/Resources/js/htmlDescriptor.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
let prev = null;
|
||||
Array.from(document.getElementsByTagName('article')).reverse().forEach(function (article) {
|
||||
const dedupId = article.dataset.dedupId;
|
||||
if (dedupId === prev) {
|
||||
article.getElementsByTagName('header')[0].classList.add('hidden');
|
||||
}
|
||||
prev = dedupId;
|
||||
});
|
||||
});
|
||||
97
vendor/symfony/var-dumper/Server/Connection.php
vendored
Normal file
97
vendor/symfony/var-dumper/Server/Connection.php
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Server;
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
|
||||
/**
|
||||
* Forwards serialized Data clones to a server.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*/
|
||||
class Connection
|
||||
{
|
||||
private $host;
|
||||
private $contextProviders;
|
||||
private $socket;
|
||||
|
||||
/**
|
||||
* @param string $host The server host
|
||||
* @param ContextProviderInterface[] $contextProviders Context providers indexed by context name
|
||||
*/
|
||||
public function __construct(string $host, array $contextProviders = array())
|
||||
{
|
||||
if (false === strpos($host, '://')) {
|
||||
$host = 'tcp://'.$host;
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
$this->contextProviders = $contextProviders;
|
||||
}
|
||||
|
||||
public function getContextProviders(): array
|
||||
{
|
||||
return $this->contextProviders;
|
||||
}
|
||||
|
||||
public function write(Data $data): bool
|
||||
{
|
||||
$socketIsFresh = !$this->socket;
|
||||
if (!$this->socket = $this->socket ?: $this->createSocket()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$context = array('timestamp' => microtime(true));
|
||||
foreach ($this->contextProviders as $name => $provider) {
|
||||
$context[$name] = $provider->getContext();
|
||||
}
|
||||
$context = array_filter($context);
|
||||
$encodedPayload = base64_encode(serialize(array($data, $context)))."\n";
|
||||
|
||||
set_error_handler(array(self::class, 'nullErrorHandler'));
|
||||
try {
|
||||
if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) {
|
||||
return true;
|
||||
}
|
||||
if (!$socketIsFresh) {
|
||||
stream_socket_shutdown($this->socket, STREAM_SHUT_RDWR);
|
||||
fclose($this->socket);
|
||||
$this->socket = $this->createSocket();
|
||||
}
|
||||
if (-1 !== stream_socket_sendto($this->socket, $encodedPayload)) {
|
||||
return true;
|
||||
}
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static function nullErrorHandler($t, $m)
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
|
||||
private function createSocket()
|
||||
{
|
||||
set_error_handler(array(self::class, 'nullErrorHandler'));
|
||||
try {
|
||||
return stream_socket_client($this->host, $errno, $errstr, 3, STREAM_CLIENT_CONNECT | STREAM_CLIENT_ASYNC_CONNECT);
|
||||
} finally {
|
||||
restore_error_handler();
|
||||
}
|
||||
|
||||
return $socket;
|
||||
}
|
||||
}
|
||||
107
vendor/symfony/var-dumper/Server/DumpServer.php
vendored
Normal file
107
vendor/symfony/var-dumper/Server/DumpServer.php
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Server;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
|
||||
/**
|
||||
* A server collecting Data clones sent by a ServerDumper.
|
||||
*
|
||||
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class DumpServer
|
||||
{
|
||||
private $host;
|
||||
private $socket;
|
||||
private $logger;
|
||||
|
||||
public function __construct(string $host, LoggerInterface $logger = null)
|
||||
{
|
||||
if (false === strpos($host, '://')) {
|
||||
$host = 'tcp://'.$host;
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public function start(): void
|
||||
{
|
||||
if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) {
|
||||
throw new \RuntimeException(sprintf('Server start failed on "%s": %s %s.', $this->host, $errstr, $errno));
|
||||
}
|
||||
}
|
||||
|
||||
public function listen(callable $callback): void
|
||||
{
|
||||
if (null === $this->socket) {
|
||||
$this->start();
|
||||
}
|
||||
|
||||
foreach ($this->getMessages() as $clientId => $message) {
|
||||
$payload = @unserialize(base64_decode($message), array('allowed_classes' => array(Data::class, Stub::class)));
|
||||
|
||||
// Impossible to decode the message, give up.
|
||||
if (false === $payload) {
|
||||
if ($this->logger) {
|
||||
$this->logger->warning('Unable to decode a message from {clientId} client.', array('clientId' => $clientId));
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!\is_array($payload) || \count($payload) < 2 || !$payload[0] instanceof Data || !\is_array($payload[1])) {
|
||||
if ($this->logger) {
|
||||
$this->logger->warning('Invalid payload from {clientId} client. Expected an array of two elements (Data $data, array $context)', array('clientId' => $clientId));
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
list($data, $context) = $payload;
|
||||
|
||||
$callback($data, $context, $clientId);
|
||||
}
|
||||
}
|
||||
|
||||
public function getHost(): string
|
||||
{
|
||||
return $this->host;
|
||||
}
|
||||
|
||||
private function getMessages(): iterable
|
||||
{
|
||||
$sockets = array((int) $this->socket => $this->socket);
|
||||
$write = array();
|
||||
|
||||
while (true) {
|
||||
$read = $sockets;
|
||||
stream_select($read, $write, $write, null);
|
||||
|
||||
foreach ($read as $stream) {
|
||||
if ($this->socket === $stream) {
|
||||
$stream = stream_socket_accept($this->socket);
|
||||
$sockets[(int) $stream] = $stream;
|
||||
} elseif (feof($stream)) {
|
||||
unset($sockets[(int) $stream]);
|
||||
fclose($stream);
|
||||
} else {
|
||||
yield (int) $stream => fgets($stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,26 +19,14 @@ use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
*/
|
||||
trait VarDumperTestTrait
|
||||
{
|
||||
public function assertDumpEquals($dump, $data, $filter = 0, $message = '')
|
||||
public function assertDumpEquals($expected, $data, $filter = 0, $message = '')
|
||||
{
|
||||
if (is_string($filter)) {
|
||||
@trigger_error(sprintf('The $message argument of the "%s()" method at 3rd position is deprecated since Symfony 3.4 and will be moved at 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED);
|
||||
$message = $filter;
|
||||
$filter = 0;
|
||||
}
|
||||
|
||||
$this->assertSame(rtrim($dump), $this->getDump($data, null, $filter), $message);
|
||||
$this->assertSame($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
public function assertDumpMatchesFormat($dump, $data, $filter = 0, $message = '')
|
||||
public function assertDumpMatchesFormat($expected, $data, $filter = 0, $message = '')
|
||||
{
|
||||
if (is_string($filter)) {
|
||||
@trigger_error(sprintf('The $message argument of the "%s()" method at 3rd position is deprecated since Symfony 3.4 and will be moved at 4th position in 4.0.', __METHOD__), E_USER_DEPRECATED);
|
||||
$message = $filter;
|
||||
$filter = 0;
|
||||
}
|
||||
|
||||
$this->assertStringMatchesFormat(rtrim($dump), $this->getDump($data, null, $filter), $message);
|
||||
$this->assertStringMatchesFormat($this->prepareExpectation($expected, $filter), $this->getDump($data, null, $filter), $message);
|
||||
}
|
||||
|
||||
protected function getDump($data, $key = null, $filter = 0)
|
||||
@@ -57,4 +45,13 @@ trait VarDumperTestTrait
|
||||
|
||||
return rtrim($dumper->dump($data, true));
|
||||
}
|
||||
|
||||
private function prepareExpectation($expected, $filter)
|
||||
{
|
||||
if (!\is_string($expected)) {
|
||||
$expected = $this->getDump($expected, null, $filter);
|
||||
}
|
||||
|
||||
return rtrim($expected);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,9 +151,6 @@ class CasterTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7.0
|
||||
*/
|
||||
public function testAnonymousClass()
|
||||
{
|
||||
$c = eval('return new class extends stdClass { private $foo = "foo"; };');
|
||||
|
||||
@@ -29,10 +29,6 @@ class DateCasterTest extends TestCase
|
||||
*/
|
||||
public function testDumpDateTime($time, $timezone, $xDate, $xTimestamp)
|
||||
{
|
||||
if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && preg_match('/[-+]\d{2}:\d{2}/', $timezone)) {
|
||||
$this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.');
|
||||
}
|
||||
|
||||
$date = new \DateTime($time, new \DateTimeZone($timezone));
|
||||
|
||||
$xDump = <<<EODUMP
|
||||
@@ -49,10 +45,6 @@ EODUMP;
|
||||
*/
|
||||
public function testCastDateTime($time, $timezone, $xDate, $xTimestamp, $xInfos)
|
||||
{
|
||||
if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && preg_match('/[-+]\d{2}:\d{2}/', $timezone)) {
|
||||
$this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.');
|
||||
}
|
||||
|
||||
$stub = new Stub();
|
||||
$date = new \DateTime($time, new \DateTimeZone($timezone));
|
||||
$cast = DateCaster::castDateTime($date, array('foo' => 'bar'), $stub, false, 0);
|
||||
@@ -102,7 +94,7 @@ EODUMP;
|
||||
*/
|
||||
public function testDumpInterval($intervalSpec, $ms, $invert, $expected)
|
||||
{
|
||||
if ($ms && PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) {
|
||||
if ($ms && \PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) {
|
||||
$this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.');
|
||||
}
|
||||
|
||||
@@ -122,7 +114,7 @@ EODUMP;
|
||||
*/
|
||||
public function testDumpIntervalExcludingVerbosity($intervalSpec, $ms, $invert, $expected)
|
||||
{
|
||||
if ($ms && PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) {
|
||||
if ($ms && \PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) {
|
||||
$this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.');
|
||||
}
|
||||
|
||||
@@ -142,7 +134,7 @@ EODUMP;
|
||||
*/
|
||||
public function testCastInterval($intervalSpec, $ms, $invert, $xInterval, $xSeconds)
|
||||
{
|
||||
if ($ms && PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) {
|
||||
if ($ms && \PHP_VERSION_ID >= 70200 && version_compare(PHP_VERSION, '7.2.0rc3', '<=')) {
|
||||
$this->markTestSkipped('Skipped on 7.2 before rc4 because of php bug #75354.');
|
||||
}
|
||||
|
||||
@@ -181,35 +173,32 @@ EODUMP;
|
||||
|
||||
public function provideIntervals()
|
||||
{
|
||||
$i = new \DateInterval('PT0S');
|
||||
$ms = ($withMs = \PHP_VERSION_ID >= 70100 && isset($i->f)) ? '.0' : '';
|
||||
|
||||
return array(
|
||||
array('PT0S', 0, 0, '0s', '0s'),
|
||||
array('PT0S', 0.1, 0, $withMs ? '+ 00:00:00.100' : '0s', '%is'),
|
||||
array('PT1S', 0, 0, '+ 00:00:01'.$ms, '%is'),
|
||||
array('PT2M', 0, 0, '+ 00:02:00'.$ms, '%is'),
|
||||
array('PT3H', 0, 0, '+ 03:00:00'.$ms, '%ss'),
|
||||
array('PT0S', 0.1, 0, '+ 00:00:00.100', '%is'),
|
||||
array('PT1S', 0, 0, '+ 00:00:01.0', '%is'),
|
||||
array('PT2M', 0, 0, '+ 00:02:00.0', '%is'),
|
||||
array('PT3H', 0, 0, '+ 03:00:00.0', '%ss'),
|
||||
array('P4D', 0, 0, '+ 4d', '%ss'),
|
||||
array('P5M', 0, 0, '+ 5m', null),
|
||||
array('P6Y', 0, 0, '+ 6y', null),
|
||||
array('P1Y2M3DT4H5M6S', 0, 0, '+ 1y 2m 3d 04:05:06'.$ms, null),
|
||||
array('PT1M60S', 0, 0, '+ 00:02:00'.$ms, null),
|
||||
array('PT1H60M', 0, 0, '+ 02:00:00'.$ms, null),
|
||||
array('P1Y2M3DT4H5M6S', 0, 0, '+ 1y 2m 3d 04:05:06.0', null),
|
||||
array('PT1M60S', 0, 0, '+ 00:02:00.0', null),
|
||||
array('PT1H60M', 0, 0, '+ 02:00:00.0', null),
|
||||
array('P1DT24H', 0, 0, '+ 2d', null),
|
||||
array('P1M32D', 0, 0, '+ 1m 32d', null),
|
||||
|
||||
array('PT0S', 0, 1, '0s', '0s'),
|
||||
array('PT0S', 0.1, 1, $withMs ? '- 00:00:00.100' : '0s', '%is'),
|
||||
array('PT1S', 0, 1, '- 00:00:01'.$ms, '%is'),
|
||||
array('PT2M', 0, 1, '- 00:02:00'.$ms, '%is'),
|
||||
array('PT3H', 0, 1, '- 03:00:00'.$ms, '%ss'),
|
||||
array('PT0S', 0.1, 1, '- 00:00:00.100', '%is'),
|
||||
array('PT1S', 0, 1, '- 00:00:01.0', '%is'),
|
||||
array('PT2M', 0, 1, '- 00:02:00.0', '%is'),
|
||||
array('PT3H', 0, 1, '- 03:00:00.0', '%ss'),
|
||||
array('P4D', 0, 1, '- 4d', '%ss'),
|
||||
array('P5M', 0, 1, '- 5m', null),
|
||||
array('P6Y', 0, 1, '- 6y', null),
|
||||
array('P1Y2M3DT4H5M6S', 0, 1, '- 1y 2m 3d 04:05:06'.$ms, null),
|
||||
array('PT1M60S', 0, 1, '- 00:02:00'.$ms, null),
|
||||
array('PT1H60M', 0, 1, '- 02:00:00'.$ms, null),
|
||||
array('P1Y2M3DT4H5M6S', 0, 1, '- 1y 2m 3d 04:05:06.0', null),
|
||||
array('PT1M60S', 0, 1, '- 00:02:00.0', null),
|
||||
array('PT1H60M', 0, 1, '- 02:00:00.0', null),
|
||||
array('P1DT24H', 0, 1, '- 2d', null),
|
||||
array('P1M32D', 0, 1, '- 1m 32d', null),
|
||||
);
|
||||
@@ -220,10 +209,6 @@ EODUMP;
|
||||
*/
|
||||
public function testDumpTimeZone($timezone, $expected)
|
||||
{
|
||||
if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) {
|
||||
$this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.');
|
||||
}
|
||||
|
||||
$timezone = new \DateTimeZone($timezone);
|
||||
|
||||
$xDump = <<<EODUMP
|
||||
@@ -240,10 +225,6 @@ EODUMP;
|
||||
*/
|
||||
public function testDumpTimeZoneExcludingVerbosity($timezone, $expected)
|
||||
{
|
||||
if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) {
|
||||
$this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.');
|
||||
}
|
||||
|
||||
$timezone = new \DateTimeZone($timezone);
|
||||
|
||||
$xDump = <<<EODUMP
|
||||
@@ -260,10 +241,6 @@ EODUMP;
|
||||
*/
|
||||
public function testCastTimeZone($timezone, $xTimezone, $xRegion)
|
||||
{
|
||||
if ((defined('HHVM_VERSION_ID') || PHP_VERSION_ID <= 50509) && !preg_match('/\w+\/\w+/', $timezone)) {
|
||||
$this->markTestSkipped('DateTimeZone GMT offsets are supported since 5.5.10. See https://github.com/facebook/hhvm/issues/5875 for HHVM.');
|
||||
}
|
||||
|
||||
$timezone = new \DateTimeZone($timezone);
|
||||
$stub = new Stub();
|
||||
|
||||
@@ -295,7 +272,7 @@ EODUMP;
|
||||
|
||||
public function provideTimeZones()
|
||||
{
|
||||
$xRegion = extension_loaded('intl') ? '%s' : '';
|
||||
$xRegion = \extension_loaded('intl') ? '%s' : '';
|
||||
|
||||
return array(
|
||||
// type 1 (UTC offset)
|
||||
@@ -325,11 +302,7 @@ EODUMP;
|
||||
*/
|
||||
public function testDumpPeriod($start, $interval, $end, $options, $expected)
|
||||
{
|
||||
if (defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) {
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
||||
$p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), is_int($end) ? $end : new \DateTime($end), $options);
|
||||
$p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), \is_int($end) ? $end : new \DateTime($end), $options);
|
||||
|
||||
$xDump = <<<EODUMP
|
||||
DatePeriod {
|
||||
@@ -345,11 +318,7 @@ EODUMP;
|
||||
*/
|
||||
public function testCastPeriod($start, $interval, $end, $options, $xPeriod, $xDates)
|
||||
{
|
||||
if (defined('HHVM_VERSION_ID') || \PHP_VERSION_ID < 50620 || (\PHP_VERSION_ID >= 70000 && \PHP_VERSION_ID < 70005)) {
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
||||
$p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), is_int($end) ? $end : new \DateTime($end), $options);
|
||||
$p = new \DatePeriod(new \DateTime($start), new \DateInterval($interval), \is_int($end) ? $end : new \DateTime($end), $options);
|
||||
$stub = new Stub();
|
||||
|
||||
$cast = DateCaster::castPeriod($p, array(), $stub, false, 0);
|
||||
@@ -380,9 +349,6 @@ EODUMP;
|
||||
|
||||
public function providePeriods()
|
||||
{
|
||||
$i = new \DateInterval('PT0S');
|
||||
$ms = \PHP_VERSION_ID >= 70100 && isset($i->f) ? '.0' : '';
|
||||
|
||||
$periods = array(
|
||||
array('2017-01-01', 'P1D', '2017-01-03', 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) to 2017-01-03 00:00:00.0', '1) 2017-01-01%a2) 2017-01-02'),
|
||||
array('2017-01-01', 'P1D', 1, 0, 'every + 1d, from 2017-01-01 00:00:00.0 (included) recurring 2 time/s', '1) 2017-01-01%a2) 2017-01-02'),
|
||||
@@ -399,8 +365,8 @@ EODUMP;
|
||||
array('2017-01-01 01:00:00', 'P1D', '2017-01-03 01:00:00', 0, 'every + 1d, from 2017-01-01 01:00:00.0 (included) to 2017-01-03 01:00:00.0', '1) 2017-01-01 01:00:00.0%a2) 2017-01-02 01:00:00.0'),
|
||||
array('2017-01-01 01:00:00', 'P1D', 1, 0, 'every + 1d, from 2017-01-01 01:00:00.0 (included) recurring 2 time/s', '1) 2017-01-01 01:00:00.0%a2) 2017-01-02 01:00:00.0'),
|
||||
|
||||
array('2017-01-01', 'P1DT1H', '2017-01-03', 0, "every + 1d 01:00:00$ms, from 2017-01-01 00:00:00.0 (included) to 2017-01-03 00:00:00.0", '1) 2017-01-01 00:00:00.0%a2) 2017-01-02 01:00:00.0'),
|
||||
array('2017-01-01', 'P1DT1H', 1, 0, "every + 1d 01:00:00$ms, from 2017-01-01 00:00:00.0 (included) recurring 2 time/s", '1) 2017-01-01 00:00:00.0%a2) 2017-01-02 01:00:00.0'),
|
||||
array('2017-01-01', 'P1DT1H', '2017-01-03', 0, 'every + 1d 01:00:00.0, from 2017-01-01 00:00:00.0 (included) to 2017-01-03 00:00:00.0', '1) 2017-01-01 00:00:00.0%a2) 2017-01-02 01:00:00.0'),
|
||||
array('2017-01-01', 'P1DT1H', 1, 0, 'every + 1d 01:00:00.0, from 2017-01-01 00:00:00.0 (included) recurring 2 time/s', '1) 2017-01-01 00:00:00.0%a2) 2017-01-02 01:00:00.0'),
|
||||
|
||||
array('2017-01-01', 'P1D', '2017-01-04', \DatePeriod::EXCLUDE_START_DATE, 'every + 1d, from 2017-01-01 00:00:00.0 (excluded) to 2017-01-04 00:00:00.0', '1) 2017-01-02%a2) 2017-01-03'),
|
||||
array('2017-01-01', 'P1D', 2, \DatePeriod::EXCLUDE_START_DATE, 'every + 1d, from 2017-01-01 00:00:00.0 (excluded) recurring 2 time/s', '1) 2017-01-02%a2) 2017-01-03'),
|
||||
@@ -416,9 +382,7 @@ EODUMP;
|
||||
private function createInterval($intervalSpec, $ms, $invert)
|
||||
{
|
||||
$interval = new \DateInterval($intervalSpec);
|
||||
if (\PHP_VERSION_ID >= 70100 && isset($interval->f)) {
|
||||
$interval->f = $ms;
|
||||
}
|
||||
$interval->f = $ms;
|
||||
$interval->invert = $invert;
|
||||
|
||||
return $interval;
|
||||
|
||||
@@ -164,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__),
|
||||
|
||||
48
vendor/symfony/var-dumper/Tests/Caster/GmpCasterTest.php
vendored
Normal file
48
vendor/symfony/var-dumper/Tests/Caster/GmpCasterTest.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Tests\Caster;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarDumper\Caster\GmpCaster;
|
||||
use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
|
||||
|
||||
class GmpCasterTest extends TestCase
|
||||
{
|
||||
use VarDumperTestTrait;
|
||||
|
||||
/**
|
||||
* @requires extension gmp
|
||||
*/
|
||||
public function testCastGmp()
|
||||
{
|
||||
$gmpString = gmp_init('1234');
|
||||
$gmpOctal = gmp_init(010);
|
||||
$gmp = gmp_init('01101');
|
||||
$gmpDump = <<<EODUMP
|
||||
array:1 [
|
||||
"\\x00~\\x00value" => %s
|
||||
]
|
||||
EODUMP;
|
||||
$this->assertDumpEquals(sprintf($gmpDump, $gmpString), GmpCaster::castGmp($gmpString, array(), new Stub(), false, 0));
|
||||
$this->assertDumpEquals(sprintf($gmpDump, $gmpOctal), GmpCaster::castGmp($gmpOctal, array(), new Stub(), false, 0));
|
||||
$this->assertDumpEquals(sprintf($gmpDump, $gmp), GmpCaster::castGmp($gmp, array(), new Stub(), false, 0));
|
||||
|
||||
$dump = <<<EODUMP
|
||||
GMP {
|
||||
value: 577
|
||||
}
|
||||
EODUMP;
|
||||
|
||||
$this->assertDumpEquals($dump, $gmp);
|
||||
}
|
||||
}
|
||||
@@ -26,20 +26,11 @@ class RedisCasterTest extends TestCase
|
||||
{
|
||||
$redis = new \Redis();
|
||||
|
||||
if (defined('HHVM_VERSION_ID')) {
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
#host: ""
|
||||
%A
|
||||
}
|
||||
EODUMP;
|
||||
} else {
|
||||
$xCast = <<<'EODUMP'
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
isConnected: false
|
||||
}
|
||||
EODUMP;
|
||||
}
|
||||
|
||||
$this->assertDumpMatchesFormat($xCast, $redis);
|
||||
}
|
||||
@@ -52,15 +43,7 @@ EODUMP;
|
||||
self::markTestSkipped($e['message']);
|
||||
}
|
||||
|
||||
if (defined('HHVM_VERSION_ID')) {
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {
|
||||
#host: "127.0.0.1"
|
||||
%A
|
||||
}
|
||||
EODUMP;
|
||||
} else {
|
||||
$xCast = <<<'EODUMP'
|
||||
$xCast = <<<'EODUMP'
|
||||
Redis {%A
|
||||
isConnected: true
|
||||
host: "127.0.0.1"
|
||||
@@ -77,7 +60,6 @@ Redis {%A
|
||||
}
|
||||
}
|
||||
EODUMP;
|
||||
}
|
||||
|
||||
$this->assertDumpMatchesFormat($xCast, $redis);
|
||||
}
|
||||
|
||||
@@ -116,9 +116,6 @@ EOTXT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7.0
|
||||
*/
|
||||
public function testReflectionParameterScalar()
|
||||
{
|
||||
$f = eval('return function (int $a) {};');
|
||||
@@ -136,9 +133,6 @@ EOTXT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7.0
|
||||
*/
|
||||
public function testReturnType()
|
||||
{
|
||||
$f = eval('return function ():int {};');
|
||||
@@ -158,12 +152,9 @@ EOTXT
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @requires PHP 7.0
|
||||
*/
|
||||
public function testGenerator()
|
||||
{
|
||||
if (extension_loaded('xdebug')) {
|
||||
if (\extension_loaded('xdebug')) {
|
||||
$this->markTestSkipped('xdebug is active');
|
||||
}
|
||||
|
||||
|
||||
@@ -163,4 +163,45 @@ EOTXT;
|
||||
|
||||
$this->assertDumpMatchesFormat('%ADateTime%A', $var);
|
||||
}
|
||||
|
||||
public function testCastArrayObject()
|
||||
{
|
||||
$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()
|
||||
{
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -48,7 +48,6 @@ class CliDumperTest extends TestCase
|
||||
$intMax = PHP_INT_MAX;
|
||||
$res = (int) $var['res'];
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
array:24 [
|
||||
@@ -76,9 +75,9 @@ array:24 [
|
||||
+foo: "foo"
|
||||
+"bar": "bar"
|
||||
}
|
||||
"closure" => Closure {{$r}
|
||||
"closure" => Closure {#%d
|
||||
class: "Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest"
|
||||
this: Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest {{$r} …}
|
||||
this: Symfony\Component\VarDumper\Tests\Dumper\CliDumperTest {#%d …}
|
||||
parameters: {
|
||||
\$a: {}
|
||||
&\$b: {
|
||||
@@ -290,10 +289,6 @@ EOTXT
|
||||
|
||||
public function testClosedResource()
|
||||
{
|
||||
if (defined('HHVM_VERSION') && HHVM_VERSION_ID < 30600) {
|
||||
$this->markTestSkipped();
|
||||
}
|
||||
|
||||
$var = fopen(__FILE__, 'r');
|
||||
fclose($var);
|
||||
|
||||
@@ -384,11 +379,10 @@ EOTXT
|
||||
$dumper->dump($data, $out);
|
||||
$out = stream_get_contents($out, -1, 0);
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
stream resource {@{$ref}
|
||||
⚠: Symfony\Component\VarDumper\Exception\ThrowingCasterException {{$r}
|
||||
⚠: Symfony\Component\VarDumper\Exception\ThrowingCasterException {#%d
|
||||
#message: "Unexpected Exception thrown from a caster: Foobar"
|
||||
trace: {
|
||||
%sTwig.php:2 {
|
||||
@@ -429,10 +423,9 @@ EOTXT
|
||||
$data = $cloner->cloneVar($var);
|
||||
$out = $dumper->dump($data, true);
|
||||
|
||||
$r = defined('HHVM_VERSION') ? '' : '#%d';
|
||||
$this->assertStringMatchesFormat(
|
||||
<<<EOTXT
|
||||
{{$r}
|
||||
{#%d
|
||||
+"foo": &1 "foo"
|
||||
+"bar": &1 "foo"
|
||||
}
|
||||
@@ -446,7 +439,6 @@ EOTXT
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
* @requires PHP 5.6
|
||||
*/
|
||||
public function testSpecialVars56()
|
||||
{
|
||||
@@ -477,7 +469,7 @@ EOTXT
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
public function testGlobalsNoExt()
|
||||
public function testGlobals()
|
||||
{
|
||||
$var = $this->getSpecialVars();
|
||||
unset($var[0]);
|
||||
@@ -491,10 +483,6 @@ EOTXT
|
||||
$dumper->setColors(false);
|
||||
$cloner = new VarCloner();
|
||||
|
||||
$refl = new \ReflectionProperty($cloner, 'useExt');
|
||||
$refl->setAccessible(true);
|
||||
$refl->setValue($cloner, false);
|
||||
|
||||
$data = $cloner->cloneVar($var);
|
||||
$dumper->dump($data);
|
||||
|
||||
@@ -509,47 +497,6 @@ array:2 [
|
||||
2 => &1 array:1 [&1]
|
||||
]
|
||||
|
||||
EOTXT
|
||||
,
|
||||
$out
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
public function testBuggyRefs()
|
||||
{
|
||||
if (\PHP_VERSION_ID >= 50600) {
|
||||
$this->markTestSkipped('PHP 5.6 fixed refs counting');
|
||||
}
|
||||
|
||||
$var = $this->getSpecialVars();
|
||||
$var = $var[0];
|
||||
|
||||
$dumper = new CliDumper();
|
||||
$dumper->setColors(false);
|
||||
$cloner = new VarCloner();
|
||||
|
||||
$data = $cloner->cloneVar($var)->withMaxDepth(3);
|
||||
$out = '';
|
||||
$dumper->dump($data, function ($line, $depth) use (&$out) {
|
||||
if ($depth >= 0) {
|
||||
$out .= str_repeat(' ', $depth).$line."\n";
|
||||
}
|
||||
});
|
||||
|
||||
$this->assertSame(
|
||||
<<<'EOTXT'
|
||||
array:1 [
|
||||
0 => array:1 [
|
||||
0 => array:1 [
|
||||
0 => array:1 [ …1]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
EOTXT
|
||||
,
|
||||
$out
|
||||
|
||||
57
vendor/symfony/var-dumper/Tests/Dumper/FunctionsTest.php
vendored
Normal file
57
vendor/symfony/var-dumper/Tests/Dumper/FunctionsTest.php
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Tests\Dumper;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
class FunctionsTest extends TestCase
|
||||
{
|
||||
public function testDumpReturnsFirstArg()
|
||||
{
|
||||
$this->setupVarDumper();
|
||||
|
||||
$var1 = 'a';
|
||||
|
||||
ob_start();
|
||||
$return = dump($var1);
|
||||
$out = ob_get_clean();
|
||||
|
||||
$this->assertEquals($var1, $return);
|
||||
}
|
||||
|
||||
public function testDumpReturnsAllArgsInArray()
|
||||
{
|
||||
$this->setupVarDumper();
|
||||
|
||||
$var1 = 'a';
|
||||
$var2 = 'b';
|
||||
$var3 = 'c';
|
||||
|
||||
ob_start();
|
||||
$return = dump($var1, $var2, $var3);
|
||||
$out = ob_get_clean();
|
||||
|
||||
$this->assertEquals(array($var1, $var2, $var3), $return);
|
||||
}
|
||||
|
||||
protected function setupVarDumper()
|
||||
{
|
||||
$cloner = new VarCloner();
|
||||
$dumper = new CliDumper('php://output');
|
||||
VarDumper::setHandler(function ($var) use ($cloner, $dumper) {
|
||||
$dumper->dump($cloner->cloneVar($var));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,6 @@ class HtmlDumperTest extends TestCase
|
||||
$dumpId = $dumpId[0];
|
||||
$res = (int) $var['res'];
|
||||
|
||||
$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>
|
||||
@@ -79,10 +78,10 @@ class HtmlDumperTest extends TestCase
|
||||
+<span class=sf-dump-public title="Public property">foo</span>: "<span class=sf-dump-str title="3 characters">foo</span>"
|
||||
+"<span class=sf-dump-public title="Runtime added dynamic property">bar</span>": "<span class=sf-dump-str title="3 characters">bar</span>"
|
||||
</samp>}
|
||||
"<span class=sf-dump-key>closure</span>" => <span class=sf-dump-note>Closure</span> {{$r}<samp>
|
||||
"<span class=sf-dump-key>closure</span>" => <span class=sf-dump-note>Closure</span> {<a class=sf-dump-ref>#%d</a><samp>
|
||||
<span class=sf-dump-meta>class</span>: "<span class=sf-dump-str title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest
|
||||
55 characters"><span class="sf-dump-ellipsis sf-dump-ellipsis-class">Symfony\Component\VarDumper\Tests\Dumper</span><span class=sf-dump-ellipsis>\</span>HtmlDumperTest</span>"
|
||||
<span class=sf-dump-meta>this</span>: <abbr title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest" class=sf-dump-note>HtmlDumperTest</abbr> {{$r} &%s;}
|
||||
<span class=sf-dump-meta>this</span>: <abbr title="Symfony\Component\VarDumper\Tests\Dumper\HtmlDumperTest" class=sf-dump-note>HtmlDumperTest</abbr> {<a class=sf-dump-ref>#%d</a> &%s;}
|
||||
<span class=sf-dump-meta>parameters</span>: {<samp>
|
||||
<span class=sf-dump-meta>\$a</span>: {}
|
||||
<span class=sf-dump-meta>&\$b</span>: {<samp>
|
||||
|
||||
95
vendor/symfony/var-dumper/Tests/Dumper/ServerDumperTest.php
vendored
Normal file
95
vendor/symfony/var-dumper/Tests/Dumper/ServerDumperTest.php
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Tests\Dumper;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Process\PhpProcess;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
use Symfony\Component\VarDumper\Dumper\DataDumperInterface;
|
||||
use Symfony\Component\VarDumper\Dumper\ServerDumper;
|
||||
|
||||
class ServerDumperTest extends TestCase
|
||||
{
|
||||
private const VAR_DUMPER_SERVER = 'tcp://127.0.0.1:9913';
|
||||
|
||||
public function testDumpForwardsToWrappedDumperWhenServerIsUnavailable()
|
||||
{
|
||||
$wrappedDumper = $this->getMockBuilder(DataDumperInterface::class)->getMock();
|
||||
|
||||
$dumper = new ServerDumper(self::VAR_DUMPER_SERVER, $wrappedDumper);
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$data = $cloner->cloneVar('foo');
|
||||
|
||||
$wrappedDumper->expects($this->once())->method('dump')->with($data);
|
||||
|
||||
$dumper->dump($data);
|
||||
}
|
||||
|
||||
public function testDump()
|
||||
{
|
||||
$wrappedDumper = $this->getMockBuilder(DataDumperInterface::class)->getMock();
|
||||
$wrappedDumper->expects($this->never())->method('dump'); // test wrapped dumper is not used
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$data = $cloner->cloneVar('foo');
|
||||
$dumper = new ServerDumper(self::VAR_DUMPER_SERVER, $wrappedDumper, array(
|
||||
'foo_provider' => new class() implements ContextProviderInterface {
|
||||
public function getContext(): ?array
|
||||
{
|
||||
return array('foo');
|
||||
}
|
||||
},
|
||||
));
|
||||
|
||||
$dumped = null;
|
||||
$process = $this->getServerProcess();
|
||||
$process->start(function ($type, $buffer) use ($process, &$dumped, $dumper, $data) {
|
||||
if (Process::ERR === $type) {
|
||||
$process->stop();
|
||||
$this->fail();
|
||||
} elseif ("READY\n" === $buffer) {
|
||||
$dumper->dump($data);
|
||||
} else {
|
||||
$dumped .= $buffer;
|
||||
}
|
||||
});
|
||||
|
||||
$process->wait();
|
||||
|
||||
$this->assertTrue($process->isSuccessful());
|
||||
$this->assertStringMatchesFormat(<<<'DUMP'
|
||||
(3) "foo"
|
||||
[
|
||||
"timestamp" => %d.%d
|
||||
"foo_provider" => [
|
||||
(3) "foo"
|
||||
]
|
||||
]
|
||||
%d
|
||||
DUMP
|
||||
, $dumped);
|
||||
}
|
||||
|
||||
private function getServerProcess(): Process
|
||||
{
|
||||
$process = new PhpProcess(file_get_contents(__DIR__.'/../Fixtures/dump_server.php'), null, array(
|
||||
'COMPONENT_ROOT' => __DIR__.'/../../',
|
||||
'VAR_DUMPER_SERVER' => self::VAR_DUMPER_SERVER,
|
||||
));
|
||||
$process->inheritEnvironmentVariables(true);
|
||||
|
||||
return $process->setTimeout(9);
|
||||
}
|
||||
}
|
||||
38
vendor/symfony/var-dumper/Tests/Fixtures/dump_server.php
vendored
Normal file
38
vendor/symfony/var-dumper/Tests/Fixtures/dump_server.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\VarDumper\Cloner\Data;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\CliDumper;
|
||||
use Symfony\Component\VarDumper\Server\DumpServer;
|
||||
use Symfony\Component\VarDumper\VarDumper;
|
||||
|
||||
$componentRoot = $_SERVER['COMPONENT_ROOT'];
|
||||
|
||||
if (!is_file($file = $componentRoot.'/vendor/autoload.php')) {
|
||||
$file = $componentRoot.'/../../../../vendor/autoload.php';
|
||||
}
|
||||
|
||||
require $file;
|
||||
|
||||
$cloner = new VarCloner();
|
||||
$cloner->setMaxItems(-1);
|
||||
|
||||
$dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_STRING_LENGTH);
|
||||
$dumper->setColors(false);
|
||||
|
||||
VarDumper::setHandler(function ($var) use ($cloner, $dumper) {
|
||||
$data = $cloner->cloneVar($var)->withRefHandles(false);
|
||||
$dumper->dump($data);
|
||||
});
|
||||
|
||||
$server = new DumpServer(getenv('VAR_DUMPER_SERVER'));
|
||||
|
||||
$server->start();
|
||||
|
||||
echo "READY\n";
|
||||
|
||||
$server->listen(function (Data $data, array $context, $clientId) {
|
||||
dump((string) $data, $context, $clientId);
|
||||
|
||||
exit(0);
|
||||
});
|
||||
88
vendor/symfony/var-dumper/Tests/Server/ConnectionTest.php
vendored
Normal file
88
vendor/symfony/var-dumper/Tests/Server/ConnectionTest.php
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarDumper\Tests\Server;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Process\PhpProcess;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Symfony\Component\VarDumper\Cloner\VarCloner;
|
||||
use Symfony\Component\VarDumper\Dumper\ContextProvider\ContextProviderInterface;
|
||||
use Symfony\Component\VarDumper\Server\Connection;
|
||||
|
||||
class ConnectionTest extends TestCase
|
||||
{
|
||||
private const VAR_DUMPER_SERVER = 'tcp://127.0.0.1:9913';
|
||||
|
||||
public function testDump()
|
||||
{
|
||||
$cloner = new VarCloner();
|
||||
$data = $cloner->cloneVar('foo');
|
||||
$connection = new Connection(self::VAR_DUMPER_SERVER, array(
|
||||
'foo_provider' => new class() implements ContextProviderInterface {
|
||||
public function getContext(): ?array
|
||||
{
|
||||
return array('foo');
|
||||
}
|
||||
},
|
||||
));
|
||||
|
||||
$dumped = null;
|
||||
$process = $this->getServerProcess();
|
||||
$process->start(function ($type, $buffer) use ($process, &$dumped, $connection, $data) {
|
||||
if (Process::ERR === $type) {
|
||||
$process->stop();
|
||||
$this->fail();
|
||||
} elseif ("READY\n" === $buffer) {
|
||||
$connection->write($data);
|
||||
} else {
|
||||
$dumped .= $buffer;
|
||||
}
|
||||
});
|
||||
|
||||
$process->wait();
|
||||
|
||||
$this->assertTrue($process->isSuccessful());
|
||||
$this->assertStringMatchesFormat(<<<'DUMP'
|
||||
(3) "foo"
|
||||
[
|
||||
"timestamp" => %d.%d
|
||||
"foo_provider" => [
|
||||
(3) "foo"
|
||||
]
|
||||
]
|
||||
%d
|
||||
|
||||
DUMP
|
||||
, $dumped);
|
||||
}
|
||||
|
||||
public function testNoServer()
|
||||
{
|
||||
$cloner = new VarCloner();
|
||||
$data = $cloner->cloneVar('foo');
|
||||
$connection = new Connection(self::VAR_DUMPER_SERVER);
|
||||
$start = microtime(true);
|
||||
$this->assertFalse($connection->write($data));
|
||||
$this->assertLessThan(1, microtime(true) - $start);
|
||||
}
|
||||
|
||||
private function getServerProcess(): Process
|
||||
{
|
||||
$process = new PhpProcess(file_get_contents(__DIR__.'/../Fixtures/dump_server.php'), null, array(
|
||||
'COMPONENT_ROOT' => __DIR__.'/../../',
|
||||
'VAR_DUMPER_SERVER' => self::VAR_DUMPER_SERVER,
|
||||
));
|
||||
$process->inheritEnvironmentVariables(true);
|
||||
|
||||
return $process->setTimeout(9);
|
||||
}
|
||||
}
|
||||
@@ -38,4 +38,9 @@ EODUMP;
|
||||
|
||||
$this->assertDumpEquals($expected, $data);
|
||||
}
|
||||
|
||||
public function testAllowsNonScalarExpectation()
|
||||
{
|
||||
$this->assertDumpEquals(new \ArrayObject(array('bim' => 'bam')), new \ArrayObject(array('bim' => 'bam')));
|
||||
}
|
||||
}
|
||||
|
||||
4
vendor/symfony/var-dumper/VarDumper.php
vendored
4
vendor/symfony/var-dumper/VarDumper.php
vendored
@@ -29,13 +29,13 @@ class VarDumper
|
||||
{
|
||||
if (null === self::$handler) {
|
||||
$cloner = new VarCloner();
|
||||
$dumper = \in_array(PHP_SAPI, array('cli', 'phpdbg'), true) ? 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)
|
||||
|
||||
16
vendor/symfony/var-dumper/composer.json
vendored
16
vendor/symfony/var-dumper/composer.json
vendored
@@ -16,20 +16,23 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^5.5.9|>=7.0.8",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
"php": "^7.1.3",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php72": "~1.5"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-iconv": "*",
|
||||
"symfony/process": "~3.4|~4.0",
|
||||
"twig/twig": "~1.34|~2.4"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
|
||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
|
||||
"symfony/console": "<3.4"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
|
||||
"ext-intl": "To show region name in time zone dump",
|
||||
"ext-symfony_debug": ""
|
||||
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
|
||||
},
|
||||
"autoload": {
|
||||
"files": [ "Resources/functions/dump.php" ],
|
||||
@@ -38,10 +41,13 @@
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"bin": [
|
||||
"Resources/bin/var-dump-server"
|
||||
],
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.4-dev"
|
||||
"dev-master": "4.1-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user