提交代码
This commit is contained in:
3
vendor/symfony/var-exporter/.gitignore
vendored
Normal file
3
vendor/symfony/var-exporter/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
composer.lock
|
||||
phpunit.xml
|
||||
vendor/
|
||||
7
vendor/symfony/var-exporter/CHANGELOG.md
vendored
Normal file
7
vendor/symfony/var-exporter/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
CHANGELOG
|
||||
=========
|
||||
|
||||
4.2.0
|
||||
-----
|
||||
|
||||
* added the component
|
||||
20
vendor/symfony/var-exporter/Exception/ClassNotFoundException.php
vendored
Normal file
20
vendor/symfony/var-exporter/Exception/ClassNotFoundException.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarExporter\Exception;
|
||||
|
||||
class ClassNotFoundException extends \Exception implements ExceptionInterface
|
||||
{
|
||||
public function __construct(string $class, \Throwable $previous = null)
|
||||
{
|
||||
parent::__construct(sprintf('Class "%s" not found.', $class), 0, $previous);
|
||||
}
|
||||
}
|
||||
16
vendor/symfony/var-exporter/Exception/ExceptionInterface.php
vendored
Normal file
16
vendor/symfony/var-exporter/Exception/ExceptionInterface.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarExporter\Exception;
|
||||
|
||||
interface ExceptionInterface extends \Throwable
|
||||
{
|
||||
}
|
||||
20
vendor/symfony/var-exporter/Exception/NotInstantiableTypeException.php
vendored
Normal file
20
vendor/symfony/var-exporter/Exception/NotInstantiableTypeException.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarExporter\Exception;
|
||||
|
||||
class NotInstantiableTypeException extends \Exception implements ExceptionInterface
|
||||
{
|
||||
public function __construct(string $type)
|
||||
{
|
||||
parent::__construct(sprintf('Type "%s" is not instantiable.', $type));
|
||||
}
|
||||
}
|
||||
94
vendor/symfony/var-exporter/Instantiator.php
vendored
Normal file
94
vendor/symfony/var-exporter/Instantiator.php
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarExporter;
|
||||
|
||||
use Symfony\Component\VarExporter\Exception\ExceptionInterface;
|
||||
use Symfony\Component\VarExporter\Exception\NotInstantiableTypeException;
|
||||
use Symfony\Component\VarExporter\Internal\Hydrator;
|
||||
use Symfony\Component\VarExporter\Internal\Registry;
|
||||
|
||||
/**
|
||||
* A utility class to create objects without calling their constructor.
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class Instantiator
|
||||
{
|
||||
/**
|
||||
* Creates an object and sets its properties without calling its constructor nor any other methods.
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* // creates an empty instance of Foo
|
||||
* Instantiator::instantiate(Foo::class);
|
||||
*
|
||||
* // creates a Foo instance and sets one of its properties
|
||||
* Instantiator::instantiate(Foo::class, ['propertyName' => $propertyValue]);
|
||||
*
|
||||
* // creates a Foo instance and sets a private property defined on its parent Bar class
|
||||
* Instantiator::instantiate(Foo::class, [], [
|
||||
* Bar::class => ['privateBarProperty' => $propertyValue],
|
||||
* ]);
|
||||
*
|
||||
* Instances of ArrayObject, ArrayIterator and SplObjectHash can be created
|
||||
* by using the special "\0" property name to define their internal value:
|
||||
*
|
||||
* // creates an SplObjectHash where $info1 is attached to $obj1, etc.
|
||||
* Instantiator::instantiate(SplObjectStorage::class, ["\0" => [$obj1, $info1, $obj2, $info2...]]);
|
||||
*
|
||||
* // creates an ArrayObject populated with $inputArray
|
||||
* Instantiator::instantiate(ArrayObject::class, ["\0" => [$inputArray]]);
|
||||
*
|
||||
* @param string $class The class of the instance to create
|
||||
* @param array $properties The properties to set on the instance
|
||||
* @param array $privateProperties The private properties to set on the instance,
|
||||
* keyed by their declaring class
|
||||
*
|
||||
* @return object The created instance
|
||||
*
|
||||
* @throws ExceptionInterface When the instance cannot be created
|
||||
*/
|
||||
public static function instantiate(string $class, array $properties = [], array $privateProperties = [])
|
||||
{
|
||||
$reflector = Registry::$reflectors[$class] ?? Registry::getClassReflector($class);
|
||||
|
||||
if (Registry::$cloneable[$class]) {
|
||||
$wrappedInstance = [clone Registry::$prototypes[$class]];
|
||||
} elseif (Registry::$instantiableWithoutConstructor[$class]) {
|
||||
$wrappedInstance = [$reflector->newInstanceWithoutConstructor()];
|
||||
} elseif (null === Registry::$prototypes[$class]) {
|
||||
throw new NotInstantiableTypeException($class);
|
||||
} elseif ($reflector->implementsInterface('Serializable') && (\PHP_VERSION_ID < 70400 || !method_exists($class, '__unserialize'))) {
|
||||
$wrappedInstance = [unserialize('C:'.\strlen($class).':"'.$class.'":0:{}')];
|
||||
} else {
|
||||
$wrappedInstance = [unserialize('O:'.\strlen($class).':"'.$class.'":0:{}')];
|
||||
}
|
||||
|
||||
if ($properties) {
|
||||
$privateProperties[$class] = isset($privateProperties[$class]) ? $properties + $privateProperties[$class] : $properties;
|
||||
}
|
||||
|
||||
foreach ($privateProperties as $class => $properties) {
|
||||
if (!$properties) {
|
||||
continue;
|
||||
}
|
||||
foreach ($properties as $name => $value) {
|
||||
// because they're also used for "unserialization", hydrators
|
||||
// deal with array of instances, so we need to wrap values
|
||||
$properties[$name] = [$value];
|
||||
}
|
||||
(Hydrator::$hydrators[$class] ?? Hydrator::getHydrator($class))($properties, $wrappedInstance);
|
||||
}
|
||||
|
||||
return $wrappedInstance[0];
|
||||
}
|
||||
}
|
||||
406
vendor/symfony/var-exporter/Internal/Exporter.php
vendored
Normal file
406
vendor/symfony/var-exporter/Internal/Exporter.php
vendored
Normal file
@@ -0,0 +1,406 @@
|
||||
<?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\VarExporter\Internal;
|
||||
|
||||
use Symfony\Component\VarExporter\Exception\NotInstantiableTypeException;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class Exporter
|
||||
{
|
||||
/**
|
||||
* Prepares an array of values for VarExporter.
|
||||
*
|
||||
* For performance this method is public and has no type-hints.
|
||||
*
|
||||
* @param array &$values
|
||||
* @param \SplObjectStorage $objectsPool
|
||||
* @param array &$refsPool
|
||||
* @param int &$objectsCount
|
||||
* @param bool &$valuesAreStatic
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws NotInstantiableTypeException When a value cannot be serialized
|
||||
*/
|
||||
public static function prepare($values, $objectsPool, &$refsPool, &$objectsCount, &$valuesAreStatic)
|
||||
{
|
||||
$refs = $values;
|
||||
foreach ($values as $k => $value) {
|
||||
if (\is_resource($value)) {
|
||||
throw new NotInstantiableTypeException(get_resource_type($value).' resource');
|
||||
}
|
||||
$refs[$k] = $objectsPool;
|
||||
|
||||
if ($isRef = !$valueIsStatic = $values[$k] !== $objectsPool) {
|
||||
$values[$k] = &$value; // Break hard references to make $values completely
|
||||
unset($value); // independent from the original structure
|
||||
$refs[$k] = $value = $values[$k];
|
||||
if ($value instanceof Reference && 0 > $value->id) {
|
||||
$valuesAreStatic = false;
|
||||
++$value->count;
|
||||
continue;
|
||||
}
|
||||
$refsPool[] = [&$refs[$k], $value, &$value];
|
||||
$refs[$k] = $values[$k] = new Reference(-\count($refsPool), $value);
|
||||
}
|
||||
|
||||
if (\is_array($value)) {
|
||||
if ($value) {
|
||||
$value = self::prepare($value, $objectsPool, $refsPool, $objectsCount, $valueIsStatic);
|
||||
}
|
||||
goto handle_value;
|
||||
} elseif (!\is_object($value) && !$value instanceof \__PHP_Incomplete_Class) {
|
||||
goto handle_value;
|
||||
}
|
||||
|
||||
$valueIsStatic = false;
|
||||
if (isset($objectsPool[$value])) {
|
||||
++$objectsCount;
|
||||
$value = new Reference($objectsPool[$value][0]);
|
||||
goto handle_value;
|
||||
}
|
||||
|
||||
$class = \get_class($value);
|
||||
$reflector = Registry::$reflectors[$class] ?? Registry::getClassReflector($class);
|
||||
|
||||
if ($reflector->hasMethod('__serialize')) {
|
||||
if (!$reflector->getMethod('__serialize')->isPublic()) {
|
||||
throw new \Error(sprintf('Call to %s method %s::__serialize()', $reflector->getMethod('__serialize')->isProtected() ? 'protected' : 'private', $class));
|
||||
}
|
||||
|
||||
if (!\is_array($properties = $value->__serialize())) {
|
||||
throw new \Typerror($class.'::__serialize() must return an array');
|
||||
}
|
||||
|
||||
goto prepare_value;
|
||||
}
|
||||
|
||||
$properties = [];
|
||||
$sleep = null;
|
||||
$arrayValue = (array) $value;
|
||||
$proto = Registry::$prototypes[$class];
|
||||
|
||||
if (($value instanceof \ArrayIterator || $value instanceof \ArrayObject) && null !== $proto) {
|
||||
// ArrayIterator and ArrayObject need special care because their "flags"
|
||||
// option changes the behavior of the (array) casting operator.
|
||||
$properties = self::getArrayObjectProperties($value, $arrayValue, $proto);
|
||||
|
||||
// populates Registry::$prototypes[$class] with a new instance
|
||||
Registry::getClassReflector($class, Registry::$instantiableWithoutConstructor[$class], Registry::$cloneable[$class]);
|
||||
} elseif ($value instanceof \SplObjectStorage && Registry::$cloneable[$class] && null !== $proto) {
|
||||
// By implementing Serializable, SplObjectStorage breaks
|
||||
// internal references; let's deal with it on our own.
|
||||
foreach (clone $value as $v) {
|
||||
$properties[] = $v;
|
||||
$properties[] = $value[$v];
|
||||
}
|
||||
$properties = ['SplObjectStorage' => ["\0" => $properties]];
|
||||
} elseif ($value instanceof \Serializable || $value instanceof \__PHP_Incomplete_Class) {
|
||||
++$objectsCount;
|
||||
$objectsPool[$value] = [$id = \count($objectsPool), serialize($value), [], 0];
|
||||
$value = new Reference($id);
|
||||
goto handle_value;
|
||||
}
|
||||
|
||||
if (method_exists($class, '__sleep')) {
|
||||
if (!\is_array($sleep = $value->__sleep())) {
|
||||
trigger_error('serialize(): __sleep should return an array only containing the names of instance-variables to serialize', E_USER_NOTICE);
|
||||
$value = null;
|
||||
goto handle_value;
|
||||
}
|
||||
foreach ($sleep as $name) {
|
||||
if (property_exists($value, $name) && !$reflector->hasProperty($name)) {
|
||||
$arrayValue[$name] = $value->$name;
|
||||
}
|
||||
}
|
||||
$sleep = array_flip($sleep);
|
||||
}
|
||||
|
||||
$proto = (array) $proto;
|
||||
|
||||
foreach ($arrayValue as $name => $v) {
|
||||
$i = 0;
|
||||
$n = (string) $name;
|
||||
if ('' === $n || "\0" !== $n[0]) {
|
||||
$c = 'stdClass';
|
||||
} elseif ('*' === $n[1]) {
|
||||
$n = substr($n, 3);
|
||||
$c = $reflector->getProperty($n)->class;
|
||||
if ('Error' === $c) {
|
||||
$c = 'TypeError';
|
||||
} elseif ('Exception' === $c) {
|
||||
$c = 'ErrorException';
|
||||
}
|
||||
} else {
|
||||
$i = strpos($n, "\0", 2);
|
||||
$c = substr($n, 1, $i - 1);
|
||||
$n = substr($n, 1 + $i);
|
||||
}
|
||||
if (null !== $sleep) {
|
||||
if (!isset($sleep[$n]) || ($i && $c !== $class)) {
|
||||
continue;
|
||||
}
|
||||
$sleep[$n] = false;
|
||||
}
|
||||
if (!\array_key_exists($name, $proto) || $proto[$name] !== $v || "\x00Error\x00trace" === $name || "\x00Exception\x00trace" === $name) {
|
||||
$properties[$c][$n] = $v;
|
||||
}
|
||||
}
|
||||
if ($sleep) {
|
||||
foreach ($sleep as $n => $v) {
|
||||
if (false !== $v) {
|
||||
trigger_error(sprintf('serialize(): "%s" returned as member variable from __sleep() but does not exist', $n), E_USER_NOTICE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
prepare_value:
|
||||
$objectsPool[$value] = [$id = \count($objectsPool)];
|
||||
$properties = self::prepare($properties, $objectsPool, $refsPool, $objectsCount, $valueIsStatic);
|
||||
++$objectsCount;
|
||||
$objectsPool[$value] = [$id, $class, $properties, method_exists($class, '__unserialize') ? -$objectsCount : (method_exists($class, '__wakeup') ? $objectsCount : 0)];
|
||||
|
||||
$value = new Reference($id);
|
||||
|
||||
handle_value:
|
||||
if ($isRef) {
|
||||
unset($value); // Break the hard reference created above
|
||||
} elseif (!$valueIsStatic) {
|
||||
$values[$k] = $value;
|
||||
}
|
||||
$valuesAreStatic = $valueIsStatic && $valuesAreStatic;
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
public static function export($value, $indent = '')
|
||||
{
|
||||
switch (true) {
|
||||
case \is_int($value) || \is_float($value): return var_export($value, true);
|
||||
case [] === $value: return '[]';
|
||||
case false === $value: return 'false';
|
||||
case true === $value: return 'true';
|
||||
case null === $value: return 'null';
|
||||
case '' === $value: return "''";
|
||||
}
|
||||
|
||||
if ($value instanceof Reference) {
|
||||
if (0 <= $value->id) {
|
||||
return '$o['.$value->id.']';
|
||||
}
|
||||
if (!$value->count) {
|
||||
return self::export($value->value, $indent);
|
||||
}
|
||||
$value = -$value->id;
|
||||
|
||||
return '&$r['.$value.']';
|
||||
}
|
||||
$subIndent = $indent.' ';
|
||||
|
||||
if (\is_string($value)) {
|
||||
$code = var_export($value, true);
|
||||
|
||||
if (false !== strpos($value, "\n") || false !== strpos($value, "\r")) {
|
||||
$code = strtr($code, [
|
||||
"\r\n" => "'.\"\\r\\n\"\n".$subIndent.".'",
|
||||
"\r" => "'.\"\\r\"\n".$subIndent.".'",
|
||||
"\n" => "'.\"\\n\"\n".$subIndent.".'",
|
||||
]);
|
||||
}
|
||||
|
||||
if (false !== strpos($value, "\0")) {
|
||||
$code = str_replace('\' . "\0" . \'', '\'."\0".\'', $code);
|
||||
$code = str_replace('".\'\'."', '', $code);
|
||||
}
|
||||
|
||||
if (false !== strpos($code, "''.")) {
|
||||
$code = str_replace("''.", '', $code);
|
||||
}
|
||||
|
||||
if (".''" === substr($code, -3)) {
|
||||
$code = rtrim(substr($code, 0, -3));
|
||||
}
|
||||
|
||||
return $code;
|
||||
}
|
||||
|
||||
if (\is_array($value)) {
|
||||
$j = -1;
|
||||
$code = '';
|
||||
foreach ($value as $k => $v) {
|
||||
$code .= $subIndent;
|
||||
if (!\is_int($k) || 1 !== $k - $j) {
|
||||
$code .= self::export($k, $subIndent).' => ';
|
||||
}
|
||||
if (\is_int($k) && $k > $j) {
|
||||
$j = $k;
|
||||
}
|
||||
$code .= self::export($v, $subIndent).",\n";
|
||||
}
|
||||
|
||||
return "[\n".$code.$indent.']';
|
||||
}
|
||||
|
||||
if ($value instanceof Values) {
|
||||
$code = $subIndent."\$r = [],\n";
|
||||
foreach ($value->values as $k => $v) {
|
||||
$code .= $subIndent.'$r['.$k.'] = '.self::export($v, $subIndent).",\n";
|
||||
}
|
||||
|
||||
return "[\n".$code.$indent.']';
|
||||
}
|
||||
|
||||
if ($value instanceof Registry) {
|
||||
return self::exportRegistry($value, $indent, $subIndent);
|
||||
}
|
||||
|
||||
if ($value instanceof Hydrator) {
|
||||
return self::exportHydrator($value, $indent, $subIndent);
|
||||
}
|
||||
|
||||
throw new \UnexpectedValueException(sprintf('Cannot export value of type "%s".', \is_object($value) ? \get_class($value) : \gettype($value)));
|
||||
}
|
||||
|
||||
private static function exportRegistry(Registry $value, string $indent, string $subIndent): string
|
||||
{
|
||||
$code = '';
|
||||
$serializables = [];
|
||||
$seen = [];
|
||||
$prototypesAccess = 0;
|
||||
$factoriesAccess = 0;
|
||||
$r = '\\'.Registry::class;
|
||||
$j = -1;
|
||||
|
||||
foreach ($value as $k => $class) {
|
||||
if (':' === ($class[1] ?? null)) {
|
||||
$serializables[$k] = $class;
|
||||
continue;
|
||||
}
|
||||
if (!Registry::$instantiableWithoutConstructor[$class]) {
|
||||
if (is_subclass_of($class, 'Serializable') && !method_exists($class, '__unserialize')) {
|
||||
$serializables[$k] = 'C:'.\strlen($class).':"'.$class.'":0:{}';
|
||||
} else {
|
||||
$serializables[$k] = 'O:'.\strlen($class).':"'.$class.'":0:{}';
|
||||
}
|
||||
if (is_subclass_of($class, 'Throwable')) {
|
||||
$eol = is_subclass_of($class, 'Error') ? "\0Error\0" : "\0Exception\0";
|
||||
$serializables[$k] = substr_replace($serializables[$k], '1:{s:'.(5 + \strlen($eol)).':"'.$eol.'trace";a:0:{}}', -4);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
$code .= $subIndent.(1 !== $k - $j ? $k.' => ' : '');
|
||||
$j = $k;
|
||||
$eol = ",\n";
|
||||
$c = '['.self::export($class).']';
|
||||
|
||||
if ($seen[$class] ?? false) {
|
||||
if (Registry::$cloneable[$class]) {
|
||||
++$prototypesAccess;
|
||||
$code .= 'clone $p'.$c;
|
||||
} else {
|
||||
++$factoriesAccess;
|
||||
$code .= '$f'.$c.'()';
|
||||
}
|
||||
} else {
|
||||
$seen[$class] = true;
|
||||
if (Registry::$cloneable[$class]) {
|
||||
$code .= 'clone ('.($prototypesAccess++ ? '$p' : '($p = &'.$r.'::$prototypes)').$c.' ?? '.$r.'::p';
|
||||
} else {
|
||||
$code .= '('.($factoriesAccess++ ? '$f' : '($f = &'.$r.'::$factories)').$c.' ?? '.$r.'::f';
|
||||
$eol = '()'.$eol;
|
||||
}
|
||||
$code .= '('.substr($c, 1, -1).'))';
|
||||
}
|
||||
$code .= $eol;
|
||||
}
|
||||
|
||||
if (1 === $prototypesAccess) {
|
||||
$code = str_replace('($p = &'.$r.'::$prototypes)', $r.'::$prototypes', $code);
|
||||
}
|
||||
if (1 === $factoriesAccess) {
|
||||
$code = str_replace('($f = &'.$r.'::$factories)', $r.'::$factories', $code);
|
||||
}
|
||||
if ('' !== $code) {
|
||||
$code = "\n".$code.$indent;
|
||||
}
|
||||
|
||||
if ($serializables) {
|
||||
$code = $r.'::unserialize(['.$code.'], '.self::export($serializables, $indent).')';
|
||||
} else {
|
||||
$code = '['.$code.']';
|
||||
}
|
||||
|
||||
return '$o = '.$code;
|
||||
}
|
||||
|
||||
private static function exportHydrator(Hydrator $value, string $indent, string $subIndent): string
|
||||
{
|
||||
$code = '';
|
||||
foreach ($value->properties as $class => $properties) {
|
||||
$code .= $subIndent.' '.self::export($class).' => '.self::export($properties, $subIndent.' ').",\n";
|
||||
}
|
||||
|
||||
$code = [
|
||||
self::export($value->registry, $subIndent),
|
||||
self::export($value->values, $subIndent),
|
||||
'' !== $code ? "[\n".$code.$subIndent.']' : '[]',
|
||||
self::export($value->value, $subIndent),
|
||||
self::export($value->wakeups, $subIndent),
|
||||
];
|
||||
|
||||
return '\\'.\get_class($value)."::hydrate(\n".$subIndent.implode(",\n".$subIndent, $code)."\n".$indent.')';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \ArrayIterator|\ArrayObject $value
|
||||
* @param \ArrayIterator|\ArrayObject $proto
|
||||
*/
|
||||
private static function getArrayObjectProperties($value, array &$arrayValue, $proto): array
|
||||
{
|
||||
$reflector = $value instanceof \ArrayIterator ? 'ArrayIterator' : 'ArrayObject';
|
||||
$reflector = Registry::$reflectors[$reflector] ?? Registry::getClassReflector($reflector);
|
||||
|
||||
$properties = [
|
||||
$arrayValue,
|
||||
$reflector->getMethod('getFlags')->invoke($value),
|
||||
$value instanceof \ArrayObject ? $reflector->getMethod('getIteratorClass')->invoke($value) : 'ArrayIterator',
|
||||
];
|
||||
|
||||
$reflector = $reflector->getMethod('setFlags');
|
||||
$reflector->invoke($proto, \ArrayObject::STD_PROP_LIST);
|
||||
|
||||
if ($properties[1] & \ArrayObject::STD_PROP_LIST) {
|
||||
$reflector->invoke($value, 0);
|
||||
$properties[0] = (array) $value;
|
||||
} else {
|
||||
$reflector->invoke($value, \ArrayObject::STD_PROP_LIST);
|
||||
$arrayValue = (array) $value;
|
||||
}
|
||||
$reflector->invoke($value, $properties[1]);
|
||||
|
||||
if ([[], 0, 'ArrayIterator'] === $properties) {
|
||||
$properties = [];
|
||||
} else {
|
||||
if ('ArrayIterator' === $properties[2]) {
|
||||
unset($properties[2]);
|
||||
}
|
||||
$properties = [$reflector->class => ["\0" => $properties]];
|
||||
}
|
||||
|
||||
return $properties;
|
||||
}
|
||||
}
|
||||
151
vendor/symfony/var-exporter/Internal/Hydrator.php
vendored
Normal file
151
vendor/symfony/var-exporter/Internal/Hydrator.php
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
<?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\VarExporter\Internal;
|
||||
|
||||
use Symfony\Component\VarExporter\Exception\ClassNotFoundException;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class Hydrator
|
||||
{
|
||||
public static $hydrators = [];
|
||||
|
||||
public $registry;
|
||||
public $values;
|
||||
public $properties;
|
||||
public $value;
|
||||
public $wakeups;
|
||||
|
||||
public function __construct(?Registry $registry, ?Values $values, array $properties, $value, array $wakeups)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->values = $values;
|
||||
$this->properties = $properties;
|
||||
$this->value = $value;
|
||||
$this->wakeups = $wakeups;
|
||||
}
|
||||
|
||||
public static function hydrate($objects, $values, $properties, $value, $wakeups)
|
||||
{
|
||||
foreach ($properties as $class => $vars) {
|
||||
(self::$hydrators[$class] ?? self::getHydrator($class))($vars, $objects);
|
||||
}
|
||||
foreach ($wakeups as $k => $v) {
|
||||
if (\is_array($v)) {
|
||||
$objects[-$k]->__unserialize($v);
|
||||
} else {
|
||||
$objects[$v]->__wakeup();
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public static function getHydrator($class)
|
||||
{
|
||||
if ('stdClass' === $class) {
|
||||
return self::$hydrators[$class] = static function ($properties, $objects) {
|
||||
foreach ($properties as $name => $values) {
|
||||
foreach ($values as $i => $v) {
|
||||
$objects[$i]->$name = $v;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (!class_exists($class) && !interface_exists($class, false) && !trait_exists($class, false)) {
|
||||
throw new ClassNotFoundException($class);
|
||||
}
|
||||
$classReflector = new \ReflectionClass($class);
|
||||
|
||||
if (!$classReflector->isInternal()) {
|
||||
return self::$hydrators[$class] = (self::$hydrators['stdClass'] ?? self::getHydrator('stdClass'))->bindTo(null, $class);
|
||||
}
|
||||
|
||||
if ($classReflector->name !== $class) {
|
||||
return self::$hydrators[$classReflector->name] ?? self::getHydrator($classReflector->name);
|
||||
}
|
||||
|
||||
switch ($class) {
|
||||
case 'ArrayIterator':
|
||||
case 'ArrayObject':
|
||||
$constructor = \Closure::fromCallable([$classReflector->getConstructor(), 'invokeArgs']);
|
||||
|
||||
return self::$hydrators[$class] = static function ($properties, $objects) use ($constructor) {
|
||||
foreach ($properties as $name => $values) {
|
||||
if ("\0" !== $name) {
|
||||
foreach ($values as $i => $v) {
|
||||
$objects[$i]->$name = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($properties["\0"] ?? [] as $i => $v) {
|
||||
$constructor($objects[$i], $v);
|
||||
}
|
||||
};
|
||||
|
||||
case 'ErrorException':
|
||||
return self::$hydrators[$class] = (self::$hydrators['stdClass'] ?? self::getHydrator('stdClass'))->bindTo(null, new class() extends \ErrorException {
|
||||
});
|
||||
|
||||
case 'TypeError':
|
||||
return self::$hydrators[$class] = (self::$hydrators['stdClass'] ?? self::getHydrator('stdClass'))->bindTo(null, new class() extends \Error {
|
||||
});
|
||||
|
||||
case 'SplObjectStorage':
|
||||
return self::$hydrators[$class] = static function ($properties, $objects) {
|
||||
foreach ($properties as $name => $values) {
|
||||
if ("\0" === $name) {
|
||||
foreach ($values as $i => $v) {
|
||||
for ($j = 0; $j < \count($v); ++$j) {
|
||||
$objects[$i]->attach($v[$j], $v[++$j]);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
foreach ($values as $i => $v) {
|
||||
$objects[$i]->$name = $v;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
$propertySetters = [];
|
||||
foreach ($classReflector->getProperties() as $propertyReflector) {
|
||||
if (!$propertyReflector->isStatic()) {
|
||||
$propertyReflector->setAccessible(true);
|
||||
$propertySetters[$propertyReflector->name] = \Closure::fromCallable([$propertyReflector, 'setValue']);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$propertySetters) {
|
||||
return self::$hydrators[$class] = self::$hydrators['stdClass'] ?? self::getHydrator('stdClass');
|
||||
}
|
||||
|
||||
return self::$hydrators[$class] = static function ($properties, $objects) use ($propertySetters) {
|
||||
foreach ($properties as $name => $values) {
|
||||
if ($setValue = $propertySetters[$name] ?? null) {
|
||||
foreach ($values as $i => $v) {
|
||||
$setValue($objects[$i], $v);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
foreach ($values as $i => $v) {
|
||||
$objects[$i]->$name = $v;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
30
vendor/symfony/var-exporter/Internal/Reference.php
vendored
Normal file
30
vendor/symfony/var-exporter/Internal/Reference.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\VarExporter\Internal;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class Reference
|
||||
{
|
||||
public $id;
|
||||
public $value;
|
||||
public $count = 0;
|
||||
|
||||
public function __construct(int $id, $value = null)
|
||||
{
|
||||
$this->id = $id;
|
||||
$this->value = $value;
|
||||
}
|
||||
}
|
||||
136
vendor/symfony/var-exporter/Internal/Registry.php
vendored
Normal file
136
vendor/symfony/var-exporter/Internal/Registry.php
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
<?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\VarExporter\Internal;
|
||||
|
||||
use Symfony\Component\VarExporter\Exception\ClassNotFoundException;
|
||||
use Symfony\Component\VarExporter\Exception\NotInstantiableTypeException;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class Registry
|
||||
{
|
||||
public static $reflectors = [];
|
||||
public static $prototypes = [];
|
||||
public static $factories = [];
|
||||
public static $cloneable = [];
|
||||
public static $instantiableWithoutConstructor = [];
|
||||
|
||||
public function __construct(array $classes)
|
||||
{
|
||||
foreach ($classes as $i => $class) {
|
||||
$this->$i = $class;
|
||||
}
|
||||
}
|
||||
|
||||
public static function unserialize($objects, $serializables)
|
||||
{
|
||||
$unserializeCallback = ini_set('unserialize_callback_func', __CLASS__.'::getClassReflector');
|
||||
|
||||
try {
|
||||
foreach ($serializables as $k => $v) {
|
||||
$objects[$k] = unserialize($v);
|
||||
}
|
||||
} finally {
|
||||
ini_set('unserialize_callback_func', $unserializeCallback);
|
||||
}
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public static function p($class)
|
||||
{
|
||||
self::getClassReflector($class, true, true);
|
||||
|
||||
return self::$prototypes[$class];
|
||||
}
|
||||
|
||||
public static function f($class)
|
||||
{
|
||||
$reflector = self::$reflectors[$class] ?? self::getClassReflector($class, true, false);
|
||||
|
||||
return self::$factories[$class] = \Closure::fromCallable([$reflector, 'newInstanceWithoutConstructor']);
|
||||
}
|
||||
|
||||
public static function getClassReflector($class, $instantiableWithoutConstructor = false, $cloneable = null)
|
||||
{
|
||||
if (!($isClass = class_exists($class)) && !interface_exists($class, false) && !trait_exists($class, false)) {
|
||||
throw new ClassNotFoundException($class);
|
||||
}
|
||||
$reflector = new \ReflectionClass($class);
|
||||
|
||||
if ($instantiableWithoutConstructor) {
|
||||
$proto = $reflector->newInstanceWithoutConstructor();
|
||||
} elseif (!$isClass || $reflector->isAbstract()) {
|
||||
throw new NotInstantiableTypeException($class);
|
||||
} elseif ($reflector->name !== $class) {
|
||||
$reflector = self::$reflectors[$name = $reflector->name] ?? self::getClassReflector($name, false, $cloneable);
|
||||
self::$cloneable[$class] = self::$cloneable[$name];
|
||||
self::$instantiableWithoutConstructor[$class] = self::$instantiableWithoutConstructor[$name];
|
||||
self::$prototypes[$class] = self::$prototypes[$name];
|
||||
|
||||
return self::$reflectors[$class] = $reflector;
|
||||
} else {
|
||||
try {
|
||||
$proto = $reflector->newInstanceWithoutConstructor();
|
||||
$instantiableWithoutConstructor = true;
|
||||
} catch (\ReflectionException $e) {
|
||||
$proto = $reflector->implementsInterface('Serializable') && !method_exists($class, '__unserialize') ? 'C:' : 'O:';
|
||||
if ('C:' === $proto && !$reflector->getMethod('unserialize')->isInternal()) {
|
||||
$proto = null;
|
||||
} elseif (false === $proto = @unserialize($proto.\strlen($class).':"'.$class.'":0:{}')) {
|
||||
throw new NotInstantiableTypeException($class);
|
||||
}
|
||||
}
|
||||
if (null !== $proto && !$proto instanceof \Throwable && !$proto instanceof \Serializable && !method_exists($class, '__sleep') && (\PHP_VERSION_ID < 70400 || !method_exists($class, '__serialize'))) {
|
||||
try {
|
||||
serialize($proto);
|
||||
} catch (\Exception $e) {
|
||||
throw new NotInstantiableTypeException($class, $e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null === $cloneable) {
|
||||
if (($proto instanceof \Reflector || $proto instanceof \ReflectionGenerator || $proto instanceof \ReflectionType || $proto instanceof \IteratorIterator || $proto instanceof \RecursiveIteratorIterator) && (!$proto instanceof \Serializable && !method_exists($proto, '__wakeup') && (\PHP_VERSION_ID < 70400 || !method_exists($class, '__unserialize')))) {
|
||||
throw new NotInstantiableTypeException($class);
|
||||
}
|
||||
|
||||
$cloneable = $reflector->isCloneable() && !$reflector->hasMethod('__clone');
|
||||
}
|
||||
|
||||
self::$cloneable[$class] = $cloneable;
|
||||
self::$instantiableWithoutConstructor[$class] = $instantiableWithoutConstructor;
|
||||
self::$prototypes[$class] = $proto;
|
||||
|
||||
if ($proto instanceof \Throwable) {
|
||||
static $setTrace;
|
||||
|
||||
if (null === $setTrace) {
|
||||
$setTrace = [
|
||||
new \ReflectionProperty(\Error::class, 'trace'),
|
||||
new \ReflectionProperty(\Exception::class, 'trace'),
|
||||
];
|
||||
$setTrace[0]->setAccessible(true);
|
||||
$setTrace[1]->setAccessible(true);
|
||||
$setTrace[0] = \Closure::fromCallable([$setTrace[0], 'setValue']);
|
||||
$setTrace[1] = \Closure::fromCallable([$setTrace[1], 'setValue']);
|
||||
}
|
||||
|
||||
$setTrace[$proto instanceof \Exception]($proto, []);
|
||||
}
|
||||
|
||||
return self::$reflectors[$class] = $reflector;
|
||||
}
|
||||
}
|
||||
27
vendor/symfony/var-exporter/Internal/Values.php
vendored
Normal file
27
vendor/symfony/var-exporter/Internal/Values.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarExporter\Internal;
|
||||
|
||||
/**
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
class Values
|
||||
{
|
||||
public $values;
|
||||
|
||||
public function __construct(array $values)
|
||||
{
|
||||
$this->values = $values;
|
||||
}
|
||||
}
|
||||
19
vendor/symfony/var-exporter/LICENSE
vendored
Normal file
19
vendor/symfony/var-exporter/LICENSE
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2018-2019 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
38
vendor/symfony/var-exporter/README.md
vendored
Normal file
38
vendor/symfony/var-exporter/README.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
VarExporter Component
|
||||
=====================
|
||||
|
||||
The VarExporter component allows exporting any serializable PHP data structure to
|
||||
plain PHP code. While doing so, it preserves all the semantics associated with
|
||||
the serialization mechanism of PHP (`__wakeup`, `__sleep`, `Serializable`,
|
||||
`__serialize`, `__unserialize`).
|
||||
|
||||
It also provides an instantiator that allows creating and populating objects
|
||||
without calling their constructor nor any other methods.
|
||||
|
||||
The reason to use this component *vs* `serialize()` or
|
||||
[igbinary](https://github.com/igbinary/igbinary) is performance: thanks to
|
||||
OPcache, the resulting code is significantly faster and more memory efficient
|
||||
than using `unserialize()` or `igbinary_unserialize()`.
|
||||
|
||||
Unlike `var_export()`, this works on any serializable PHP value.
|
||||
|
||||
It also provides a few improvements over `var_export()`/`serialize()`:
|
||||
|
||||
* the output is PSR-2 compatible;
|
||||
* the output can be re-indented without messing up with `\r` or `\n` in the data
|
||||
* missing classes throw a `ClassNotFoundException` instead of being unserialized to
|
||||
`PHP_Incomplete_Class` objects;
|
||||
* references involving `SplObjectStorage`, `ArrayObject` or `ArrayIterator`
|
||||
instances are preserved;
|
||||
* `Reflection*`, `IteratorIterator` and `RecursiveIteratorIterator` classes
|
||||
throw an exception when being serialized (their unserialized version is broken
|
||||
anyway, see https://bugs.php.net/76737).
|
||||
|
||||
Resources
|
||||
---------
|
||||
|
||||
* [Documentation](https://symfony.com/doc/current/components/var_exporter.html)
|
||||
* [Contributing](https://symfony.com/doc/current/contributing/index.html)
|
||||
* [Report issues](https://github.com/symfony/symfony/issues) and
|
||||
[send Pull Requests](https://github.com/symfony/symfony/pulls)
|
||||
in the [main Symfony repository](https://github.com/symfony/symfony)
|
||||
20
vendor/symfony/var-exporter/Tests/Fixtures/abstract-parent.php
vendored
Normal file
20
vendor/symfony/var-exporter/Tests/Fixtures/abstract-parent.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\ConcreteClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\ConcreteClass')),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'Symfony\\Component\\VarExporter\\Tests\\AbstractClass' => [
|
||||
'foo' => [
|
||||
123,
|
||||
],
|
||||
'bar' => [
|
||||
234,
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
22
vendor/symfony/var-exporter/Tests/Fixtures/array-iterator-legacy.php
vendored
Normal file
22
vendor/symfony/var-exporter/Tests/Fixtures/array-iterator-legacy.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['ArrayIterator'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('ArrayIterator')),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'ArrayIterator' => [
|
||||
"\0" => [
|
||||
[
|
||||
[
|
||||
123,
|
||||
],
|
||||
1,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
19
vendor/symfony/var-exporter/Tests/Fixtures/array-iterator.php
vendored
Normal file
19
vendor/symfony/var-exporter/Tests/Fixtures/array-iterator.php
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['ArrayIterator'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('ArrayIterator')),
|
||||
],
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[
|
||||
[
|
||||
1,
|
||||
[
|
||||
123,
|
||||
],
|
||||
[],
|
||||
],
|
||||
]
|
||||
);
|
||||
22
vendor/symfony/var-exporter/Tests/Fixtures/array-object-custom-legacy.php
vendored
Normal file
22
vendor/symfony/var-exporter/Tests/Fixtures/array-object-custom-legacy.php
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\MyArrayObject'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\MyArrayObject')),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'ArrayObject' => [
|
||||
"\0" => [
|
||||
[
|
||||
[
|
||||
234,
|
||||
],
|
||||
1,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
21
vendor/symfony/var-exporter/Tests/Fixtures/array-object-custom.php
vendored
Normal file
21
vendor/symfony/var-exporter/Tests/Fixtures/array-object-custom.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\MyArrayObject'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\MyArrayObject')),
|
||||
],
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[
|
||||
[
|
||||
1,
|
||||
[
|
||||
234,
|
||||
],
|
||||
[
|
||||
"\0".'Symfony\\Component\\VarExporter\\Tests\\MyArrayObject'."\0".'unused' => 123,
|
||||
],
|
||||
],
|
||||
]
|
||||
);
|
||||
29
vendor/symfony/var-exporter/Tests/Fixtures/array-object-legacy.php
vendored
Normal file
29
vendor/symfony/var-exporter/Tests/Fixtures/array-object-legacy.php
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['ArrayObject'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('ArrayObject')),
|
||||
clone $p['ArrayObject'],
|
||||
],
|
||||
null,
|
||||
[
|
||||
'ArrayObject' => [
|
||||
"\0" => [
|
||||
[
|
||||
[
|
||||
1,
|
||||
$o[0],
|
||||
],
|
||||
0,
|
||||
],
|
||||
],
|
||||
],
|
||||
'stdClass' => [
|
||||
'foo' => [
|
||||
$o[1],
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
28
vendor/symfony/var-exporter/Tests/Fixtures/array-object.php
vendored
Normal file
28
vendor/symfony/var-exporter/Tests/Fixtures/array-object.php
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['ArrayObject'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('ArrayObject')),
|
||||
clone $p['ArrayObject'],
|
||||
],
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[
|
||||
[
|
||||
0,
|
||||
[
|
||||
1,
|
||||
$o[0],
|
||||
],
|
||||
[
|
||||
'foo' => $o[1],
|
||||
],
|
||||
],
|
||||
-1 => [
|
||||
0,
|
||||
[],
|
||||
[],
|
||||
],
|
||||
]
|
||||
);
|
||||
3
vendor/symfony/var-exporter/Tests/Fixtures/bool.php
vendored
Normal file
3
vendor/symfony/var-exporter/Tests/Fixtures/bool.php
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
|
||||
return true;
|
||||
15
vendor/symfony/var-exporter/Tests/Fixtures/clone.php
vendored
Normal file
15
vendor/symfony/var-exporter/Tests/Fixtures/clone.php
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
(($f = &\Symfony\Component\VarExporter\Internal\Registry::$factories)['Symfony\\Component\\VarExporter\\Tests\\MyCloneable'] ?? \Symfony\Component\VarExporter\Internal\Registry::f('Symfony\\Component\\VarExporter\\Tests\\MyCloneable'))(),
|
||||
($f['Symfony\\Component\\VarExporter\\Tests\\MyNotCloneable'] ?? \Symfony\Component\VarExporter\Internal\Registry::f('Symfony\\Component\\VarExporter\\Tests\\MyNotCloneable'))(),
|
||||
],
|
||||
null,
|
||||
[],
|
||||
[
|
||||
$o[0],
|
||||
$o[1],
|
||||
],
|
||||
[]
|
||||
);
|
||||
25
vendor/symfony/var-exporter/Tests/Fixtures/datetime.php
vendored
Normal file
25
vendor/symfony/var-exporter/Tests/Fixtures/datetime.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['DateTime'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('DateTime')),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'stdClass' => [
|
||||
'date' => [
|
||||
'1970-01-01 00:00:00.000000',
|
||||
],
|
||||
'timezone_type' => [
|
||||
1,
|
||||
],
|
||||
'timezone' => [
|
||||
'+00:00',
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[
|
||||
1 => 0,
|
||||
]
|
||||
);
|
||||
30
vendor/symfony/var-exporter/Tests/Fixtures/error.php
vendored
Normal file
30
vendor/symfony/var-exporter/Tests/Fixtures/error.php
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
(\Symfony\Component\VarExporter\Internal\Registry::$factories['Error'] ?? \Symfony\Component\VarExporter\Internal\Registry::f('Error'))(),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'TypeError' => [
|
||||
'file' => [
|
||||
\dirname(__DIR__).\DIRECTORY_SEPARATOR.'VarExporterTest.php',
|
||||
],
|
||||
'line' => [
|
||||
234,
|
||||
],
|
||||
],
|
||||
'Error' => [
|
||||
'trace' => [
|
||||
[
|
||||
'file' => \dirname(__DIR__).\DIRECTORY_SEPARATOR.'VarExporterTest.php',
|
||||
'line' => 123,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[
|
||||
1 => 0,
|
||||
]
|
||||
);
|
||||
7
vendor/symfony/var-exporter/Tests/Fixtures/external-references.php
vendored
Normal file
7
vendor/symfony/var-exporter/Tests/Fixtures/external-references.php
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
[
|
||||
123,
|
||||
],
|
||||
];
|
||||
11
vendor/symfony/var-exporter/Tests/Fixtures/final-array-iterator-legacy.php
vendored
Normal file
11
vendor/symfony/var-exporter/Tests/Fixtures/final-array-iterator-legacy.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [
|
||||
'C:54:"Symfony\\Component\\VarExporter\\Tests\\FinalArrayIterator":49:{a:2:{i:0;i:123;i:1;s:21:"x:i:0;a:0:{};m:a:0:{}";}}',
|
||||
]),
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
17
vendor/symfony/var-exporter/Tests/Fixtures/final-array-iterator.php
vendored
Normal file
17
vendor/symfony/var-exporter/Tests/Fixtures/final-array-iterator.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\FinalArrayIterator'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\FinalArrayIterator')),
|
||||
],
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[
|
||||
[
|
||||
0,
|
||||
[],
|
||||
[],
|
||||
],
|
||||
]
|
||||
);
|
||||
27
vendor/symfony/var-exporter/Tests/Fixtures/final-error-legacy.php
vendored
Normal file
27
vendor/symfony/var-exporter/Tests/Fixtures/final-error-legacy.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [
|
||||
'O:46:"Symfony\\Component\\VarExporter\\Tests\\FinalError":1:{s:12:"'."\0".'Error'."\0".'trace";a:0:{}}',
|
||||
]),
|
||||
null,
|
||||
[
|
||||
'TypeError' => [
|
||||
'file' => [
|
||||
\dirname(__DIR__).\DIRECTORY_SEPARATOR.'VarExporterTest.php',
|
||||
],
|
||||
'line' => [
|
||||
123,
|
||||
],
|
||||
],
|
||||
'Error' => [
|
||||
'trace' => [
|
||||
[],
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[
|
||||
1 => 0,
|
||||
]
|
||||
);
|
||||
27
vendor/symfony/var-exporter/Tests/Fixtures/final-error.php
vendored
Normal file
27
vendor/symfony/var-exporter/Tests/Fixtures/final-error.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
(\Symfony\Component\VarExporter\Internal\Registry::$factories['Symfony\\Component\\VarExporter\\Tests\\FinalError'] ?? \Symfony\Component\VarExporter\Internal\Registry::f('Symfony\\Component\\VarExporter\\Tests\\FinalError'))(),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'TypeError' => [
|
||||
'file' => [
|
||||
\dirname(__DIR__).\DIRECTORY_SEPARATOR.'VarExporterTest.php',
|
||||
],
|
||||
'line' => [
|
||||
123,
|
||||
],
|
||||
],
|
||||
'Error' => [
|
||||
'trace' => [
|
||||
[],
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[
|
||||
1 => 0,
|
||||
]
|
||||
);
|
||||
11
vendor/symfony/var-exporter/Tests/Fixtures/final-stdclass.php
vendored
Normal file
11
vendor/symfony/var-exporter/Tests/Fixtures/final-stdclass.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
(\Symfony\Component\VarExporter\Internal\Registry::$factories['Symfony\\Component\\VarExporter\\Tests\\FinalStdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::f('Symfony\\Component\\VarExporter\\Tests\\FinalStdClass'))(),
|
||||
],
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
11
vendor/symfony/var-exporter/Tests/Fixtures/foo-serializable.php
vendored
Normal file
11
vendor/symfony/var-exporter/Tests/Fixtures/foo-serializable.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [
|
||||
'C:51:"Symfony\\Component\\VarExporter\\Tests\\FooSerializable":20:{a:1:{i:0;s:3:"bar";}}',
|
||||
]),
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
16
vendor/symfony/var-exporter/Tests/Fixtures/hard-references-recursive.php
vendored
Normal file
16
vendor/symfony/var-exporter/Tests/Fixtures/hard-references-recursive.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [],
|
||||
[
|
||||
$r = [],
|
||||
$r[1] = [
|
||||
&$r[1],
|
||||
],
|
||||
],
|
||||
[],
|
||||
[
|
||||
&$r[1],
|
||||
],
|
||||
[]
|
||||
);
|
||||
18
vendor/symfony/var-exporter/Tests/Fixtures/hard-references.php
vendored
Normal file
18
vendor/symfony/var-exporter/Tests/Fixtures/hard-references.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
|
||||
],
|
||||
[
|
||||
$r = [],
|
||||
$r[1] = $o[0],
|
||||
],
|
||||
[],
|
||||
[
|
||||
&$r[1],
|
||||
&$r[1],
|
||||
$o[0],
|
||||
],
|
||||
[]
|
||||
);
|
||||
11
vendor/symfony/var-exporter/Tests/Fixtures/incomplete-class.php
vendored
Normal file
11
vendor/symfony/var-exporter/Tests/Fixtures/incomplete-class.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [
|
||||
'O:20:"SomeNotExistingClass":0:{}',
|
||||
]),
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
8
vendor/symfony/var-exporter/Tests/Fixtures/multiline-string.php
vendored
Normal file
8
vendor/symfony/var-exporter/Tests/Fixtures/multiline-string.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
"\0\0\r\n"
|
||||
.'A' => 'B'."\r"
|
||||
.'C'."\n"
|
||||
."\n",
|
||||
];
|
||||
8
vendor/symfony/var-exporter/Tests/Fixtures/partially-indexed-array.php
vendored
Normal file
8
vendor/symfony/var-exporter/Tests/Fixtures/partially-indexed-array.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
5 => true,
|
||||
1 => true,
|
||||
2 => true,
|
||||
true,
|
||||
];
|
||||
16
vendor/symfony/var-exporter/Tests/Fixtures/php74-serializable.php
vendored
Normal file
16
vendor/symfony/var-exporter/Tests/Fixtures/php74-serializable.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['Symfony\\Component\\VarExporter\\Tests\\Php74Serializable'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\Php74Serializable')),
|
||||
clone ($p['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
|
||||
],
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[
|
||||
[
|
||||
$o[1],
|
||||
],
|
||||
]
|
||||
);
|
||||
17
vendor/symfony/var-exporter/Tests/Fixtures/private-constructor.php
vendored
Normal file
17
vendor/symfony/var-exporter/Tests/Fixtures/private-constructor.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\PrivateConstructor'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\PrivateConstructor')),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'stdClass' => [
|
||||
'prop' => [
|
||||
'bar',
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
26
vendor/symfony/var-exporter/Tests/Fixtures/private.php
vendored
Normal file
26
vendor/symfony/var-exporter/Tests/Fixtures/private.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['Symfony\\Component\\VarExporter\\Tests\\MyPrivateValue'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\MyPrivateValue')),
|
||||
clone ($p['Symfony\\Component\\VarExporter\\Tests\\MyPrivateChildValue'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\MyPrivateChildValue')),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'Symfony\\Component\\VarExporter\\Tests\\MyPrivateValue' => [
|
||||
'prot' => [
|
||||
123,
|
||||
123,
|
||||
],
|
||||
'priv' => [
|
||||
234,
|
||||
234,
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
$o[0],
|
||||
$o[1],
|
||||
],
|
||||
[]
|
||||
);
|
||||
14
vendor/symfony/var-exporter/Tests/Fixtures/serializable.php
vendored
Normal file
14
vendor/symfony/var-exporter/Tests/Fixtures/serializable.php
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = \Symfony\Component\VarExporter\Internal\Registry::unserialize([], [
|
||||
'C:50:"Symfony\\Component\\VarExporter\\Tests\\MySerializable":3:{123}',
|
||||
]),
|
||||
null,
|
||||
[],
|
||||
[
|
||||
$o[0],
|
||||
$o[0],
|
||||
],
|
||||
[]
|
||||
);
|
||||
8
vendor/symfony/var-exporter/Tests/Fixtures/simple-array.php
vendored
Normal file
8
vendor/symfony/var-exporter/Tests/Fixtures/simple-array.php
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
123,
|
||||
[
|
||||
'abc',
|
||||
],
|
||||
];
|
||||
21
vendor/symfony/var-exporter/Tests/Fixtures/spl-object-storage-legacy.php
vendored
Normal file
21
vendor/symfony/var-exporter/Tests/Fixtures/spl-object-storage-legacy.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['SplObjectStorage'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('SplObjectStorage')),
|
||||
clone ($p['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'SplObjectStorage' => [
|
||||
"\0" => [
|
||||
[
|
||||
$o[1],
|
||||
345,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
20
vendor/symfony/var-exporter/Tests/Fixtures/spl-object-storage.php
vendored
Normal file
20
vendor/symfony/var-exporter/Tests/Fixtures/spl-object-storage.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['SplObjectStorage'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('SplObjectStorage')),
|
||||
clone ($p['stdClass'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('stdClass')),
|
||||
],
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[
|
||||
[
|
||||
[
|
||||
$o[1],
|
||||
345,
|
||||
],
|
||||
[],
|
||||
],
|
||||
]
|
||||
);
|
||||
17
vendor/symfony/var-exporter/Tests/Fixtures/var-on-sleep.php
vendored
Normal file
17
vendor/symfony/var-exporter/Tests/Fixtures/var-on-sleep.php
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\GoodNight'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\GoodNight')),
|
||||
],
|
||||
null,
|
||||
[
|
||||
'stdClass' => [
|
||||
'good' => [
|
||||
'night',
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[]
|
||||
);
|
||||
13
vendor/symfony/var-exporter/Tests/Fixtures/wakeup-refl.php
vendored
Normal file
13
vendor/symfony/var-exporter/Tests/Fixtures/wakeup-refl.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (\Symfony\Component\VarExporter\Internal\Registry::$prototypes['Symfony\\Component\\VarExporter\\Tests\\MyWakeup'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\MyWakeup')),
|
||||
],
|
||||
null,
|
||||
[],
|
||||
$o[0],
|
||||
[
|
||||
1 => 0,
|
||||
]
|
||||
);
|
||||
25
vendor/symfony/var-exporter/Tests/Fixtures/wakeup.php
vendored
Normal file
25
vendor/symfony/var-exporter/Tests/Fixtures/wakeup.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
return \Symfony\Component\VarExporter\Internal\Hydrator::hydrate(
|
||||
$o = [
|
||||
clone (($p = &\Symfony\Component\VarExporter\Internal\Registry::$prototypes)['Symfony\\Component\\VarExporter\\Tests\\MyWakeup'] ?? \Symfony\Component\VarExporter\Internal\Registry::p('Symfony\\Component\\VarExporter\\Tests\\MyWakeup')),
|
||||
clone $p['Symfony\\Component\\VarExporter\\Tests\\MyWakeup'],
|
||||
],
|
||||
null,
|
||||
[
|
||||
'stdClass' => [
|
||||
'sub' => [
|
||||
$o[1],
|
||||
123,
|
||||
],
|
||||
'baz' => [
|
||||
1 => 123,
|
||||
],
|
||||
],
|
||||
],
|
||||
$o[0],
|
||||
[
|
||||
1 => 1,
|
||||
0,
|
||||
]
|
||||
);
|
||||
73
vendor/symfony/var-exporter/Tests/InstantiatorTest.php
vendored
Normal file
73
vendor/symfony/var-exporter/Tests/InstantiatorTest.php
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
<?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\VarExporter\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarExporter\Instantiator;
|
||||
|
||||
class InstantiatorTest extends TestCase
|
||||
{
|
||||
public function testNotFoundClass()
|
||||
{
|
||||
$this->expectException('Symfony\Component\VarExporter\Exception\ClassNotFoundException');
|
||||
$this->expectExceptionMessage('Class "SomeNotExistingClass" not found.');
|
||||
Instantiator::instantiate('SomeNotExistingClass');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideFailingInstantiation
|
||||
*/
|
||||
public function testFailingInstantiation(string $class)
|
||||
{
|
||||
$this->expectException('Symfony\Component\VarExporter\Exception\NotInstantiableTypeException');
|
||||
$this->expectExceptionMessageRegExp('/Type ".*" is not instantiable\./');
|
||||
Instantiator::instantiate($class);
|
||||
}
|
||||
|
||||
public function provideFailingInstantiation()
|
||||
{
|
||||
yield ['ReflectionClass'];
|
||||
yield ['SplHeap'];
|
||||
yield ['Throwable'];
|
||||
yield ['Closure'];
|
||||
yield ['SplFileInfo'];
|
||||
}
|
||||
|
||||
public function testInstantiate()
|
||||
{
|
||||
$this->assertEquals((object) ['p' => 123], Instantiator::instantiate('stdClass', ['p' => 123]));
|
||||
$this->assertEquals((object) ['p' => 123], Instantiator::instantiate('STDcLASS', ['p' => 123]));
|
||||
$this->assertEquals(new \ArrayObject([123]), Instantiator::instantiate(\ArrayObject::class, ["\0" => [[123]]]));
|
||||
|
||||
$expected = [
|
||||
"\0".__NAMESPACE__."\Bar\0priv" => 123,
|
||||
"\0".__NAMESPACE__."\Foo\0priv" => 234,
|
||||
];
|
||||
|
||||
$this->assertSame($expected, (array) Instantiator::instantiate(Bar::class, ['priv' => 123], [Foo::class => ['priv' => 234]]));
|
||||
|
||||
$e = Instantiator::instantiate('Exception', ['foo' => 123, 'trace' => [234]]);
|
||||
|
||||
$this->assertSame(123, $e->foo);
|
||||
$this->assertSame([234], $e->getTrace());
|
||||
}
|
||||
}
|
||||
|
||||
class Foo
|
||||
{
|
||||
private $priv;
|
||||
}
|
||||
|
||||
class Bar extends Foo
|
||||
{
|
||||
private $priv;
|
||||
}
|
||||
427
vendor/symfony/var-exporter/Tests/VarExporterTest.php
vendored
Normal file
427
vendor/symfony/var-exporter/Tests/VarExporterTest.php
vendored
Normal file
@@ -0,0 +1,427 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Component\VarExporter\Tests;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;
|
||||
use Symfony\Component\VarExporter\Internal\Registry;
|
||||
use Symfony\Component\VarExporter\VarExporter;
|
||||
|
||||
class VarExporterTest extends TestCase
|
||||
{
|
||||
use VarDumperTestTrait;
|
||||
|
||||
public function testPhpIncompleteClassesAreForbidden()
|
||||
{
|
||||
$this->expectException('Symfony\Component\VarExporter\Exception\ClassNotFoundException');
|
||||
$this->expectExceptionMessage('Class "SomeNotExistingClass" not found.');
|
||||
$unserializeCallback = ini_set('unserialize_callback_func', 'var_dump');
|
||||
try {
|
||||
Registry::unserialize([], ['O:20:"SomeNotExistingClass":0:{}']);
|
||||
} finally {
|
||||
$this->assertSame('var_dump', ini_set('unserialize_callback_func', $unserializeCallback));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideFailingSerialization
|
||||
*/
|
||||
public function testFailingSerialization($value)
|
||||
{
|
||||
$this->expectException('Symfony\Component\VarExporter\Exception\NotInstantiableTypeException');
|
||||
$this->expectExceptionMessageRegExp('/Type ".*" is not instantiable\./');
|
||||
$expectedDump = $this->getDump($value);
|
||||
try {
|
||||
VarExporter::export($value);
|
||||
} finally {
|
||||
$this->assertDumpEquals(rtrim($expectedDump), $value);
|
||||
}
|
||||
}
|
||||
|
||||
public function provideFailingSerialization()
|
||||
{
|
||||
yield [hash_init('md5')];
|
||||
yield [new \ReflectionClass('stdClass')];
|
||||
yield [(new \ReflectionFunction(function (): int {}))->getReturnType()];
|
||||
yield [new \ReflectionGenerator((function () { yield 123; })())];
|
||||
yield [function () {}];
|
||||
yield [function () { yield 123; }];
|
||||
yield [new \SplFileInfo(__FILE__)];
|
||||
yield [$h = fopen(__FILE__, 'r')];
|
||||
yield [[$h]];
|
||||
|
||||
$a = new class() {
|
||||
};
|
||||
|
||||
yield [$a];
|
||||
|
||||
$a = [null, $h];
|
||||
$a[0] = &$a;
|
||||
|
||||
yield [$a];
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideExport
|
||||
*/
|
||||
public function testExport(string $testName, $value, bool $staticValueExpected = false)
|
||||
{
|
||||
$dumpedValue = $this->getDump($value);
|
||||
$isStaticValue = true;
|
||||
$marshalledValue = VarExporter::export($value, $isStaticValue);
|
||||
|
||||
$this->assertSame($staticValueExpected, $isStaticValue);
|
||||
if ('var-on-sleep' !== $testName && 'php74-serializable' !== $testName) {
|
||||
$this->assertDumpEquals($dumpedValue, $value);
|
||||
}
|
||||
|
||||
$dump = "<?php\n\nreturn ".$marshalledValue.";\n";
|
||||
$dump = str_replace(var_export(__FILE__, true), "\\dirname(__DIR__).\\DIRECTORY_SEPARATOR.'VarExporterTest.php'", $dump);
|
||||
|
||||
if (\PHP_VERSION_ID < 70400 && \in_array($testName, ['array-object', 'array-iterator', 'array-object-custom', 'spl-object-storage', 'final-array-iterator', 'final-error'], true)) {
|
||||
$fixtureFile = __DIR__.'/Fixtures/'.$testName.'-legacy.php';
|
||||
} else {
|
||||
$fixtureFile = __DIR__.'/Fixtures/'.$testName.'.php';
|
||||
}
|
||||
$this->assertStringEqualsFile($fixtureFile, $dump);
|
||||
|
||||
if ('incomplete-class' === $testName || 'external-references' === $testName) {
|
||||
return;
|
||||
}
|
||||
$marshalledValue = include $fixtureFile;
|
||||
|
||||
if (!$isStaticValue) {
|
||||
if ($value instanceof MyWakeup) {
|
||||
$value->bis = null;
|
||||
}
|
||||
$this->assertDumpEquals($value, $marshalledValue);
|
||||
} else {
|
||||
$this->assertSame($value, $marshalledValue);
|
||||
}
|
||||
}
|
||||
|
||||
public function provideExport()
|
||||
{
|
||||
yield ['multiline-string', ["\0\0\r\nA" => "B\rC\n\n"], true];
|
||||
|
||||
yield ['bool', true, true];
|
||||
yield ['simple-array', [123, ['abc']], true];
|
||||
yield ['partially-indexed-array', [5 => true, 1 => true, 2 => true, 6 => true], true];
|
||||
yield ['datetime', \DateTime::createFromFormat('U', 0)];
|
||||
|
||||
$value = new \ArrayObject();
|
||||
$value[0] = 1;
|
||||
$value->foo = new \ArrayObject();
|
||||
$value[1] = $value;
|
||||
|
||||
yield ['array-object', $value];
|
||||
|
||||
yield ['array-iterator', new \ArrayIterator([123], 1)];
|
||||
yield ['array-object-custom', new MyArrayObject([234])];
|
||||
|
||||
$value = new MySerializable();
|
||||
|
||||
yield ['serializable', [$value, $value]];
|
||||
|
||||
$value = new MyWakeup();
|
||||
$value->sub = new MyWakeup();
|
||||
$value->sub->sub = 123;
|
||||
$value->sub->bis = 123;
|
||||
$value->sub->baz = 123;
|
||||
|
||||
yield ['wakeup', $value];
|
||||
|
||||
yield ['clone', [new MyCloneable(), new MyNotCloneable()]];
|
||||
|
||||
yield ['private', [new MyPrivateValue(123, 234), new MyPrivateChildValue(123, 234)]];
|
||||
|
||||
$value = new \SplObjectStorage();
|
||||
$value[new \stdClass()] = 345;
|
||||
|
||||
yield ['spl-object-storage', $value];
|
||||
|
||||
yield ['incomplete-class', unserialize('O:20:"SomeNotExistingClass":0:{}')];
|
||||
|
||||
$value = [(object) []];
|
||||
$value[1] = &$value[0];
|
||||
$value[2] = $value[0];
|
||||
|
||||
yield ['hard-references', $value];
|
||||
|
||||
$value = [];
|
||||
$value[0] = &$value;
|
||||
|
||||
yield ['hard-references-recursive', $value];
|
||||
|
||||
static $value = [123];
|
||||
|
||||
yield ['external-references', [&$value], true];
|
||||
|
||||
unset($value);
|
||||
|
||||
$value = new \Error();
|
||||
|
||||
$rt = new \ReflectionProperty('Error', 'trace');
|
||||
$rt->setAccessible(true);
|
||||
$rt->setValue($value, ['file' => __FILE__, 'line' => 123]);
|
||||
|
||||
$rl = new \ReflectionProperty('Error', 'line');
|
||||
$rl->setAccessible(true);
|
||||
$rl->setValue($value, 234);
|
||||
|
||||
yield ['error', $value];
|
||||
|
||||
yield ['var-on-sleep', new GoodNight()];
|
||||
|
||||
$value = new FinalError(false);
|
||||
$rt->setValue($value, []);
|
||||
$rl->setValue($value, 123);
|
||||
|
||||
yield ['final-error', $value];
|
||||
|
||||
yield ['final-array-iterator', new FinalArrayIterator()];
|
||||
|
||||
yield ['final-stdclass', new FinalStdClass()];
|
||||
|
||||
$value = new MyWakeup();
|
||||
$value->bis = new \ReflectionClass($value);
|
||||
|
||||
yield ['wakeup-refl', $value];
|
||||
|
||||
yield ['abstract-parent', new ConcreteClass()];
|
||||
|
||||
yield ['foo-serializable', new FooSerializable('bar')];
|
||||
|
||||
yield ['private-constructor', PrivateConstructor::create('bar')];
|
||||
|
||||
yield ['php74-serializable', new Php74Serializable()];
|
||||
}
|
||||
}
|
||||
|
||||
class MySerializable implements \Serializable
|
||||
{
|
||||
public function serialize()
|
||||
{
|
||||
return '123';
|
||||
}
|
||||
|
||||
public function unserialize($data)
|
||||
{
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
|
||||
class MyWakeup
|
||||
{
|
||||
public $sub;
|
||||
public $bis;
|
||||
public $baz;
|
||||
public $def = 234;
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
return ['sub', 'baz'];
|
||||
}
|
||||
|
||||
public function __wakeup()
|
||||
{
|
||||
if (123 === $this->sub) {
|
||||
$this->bis = 123;
|
||||
$this->baz = 123;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class MyCloneable
|
||||
{
|
||||
public function __clone()
|
||||
{
|
||||
throw new \Exception('__clone should never be called');
|
||||
}
|
||||
}
|
||||
|
||||
class MyNotCloneable
|
||||
{
|
||||
private function __clone()
|
||||
{
|
||||
throw new \Exception('__clone should never be called');
|
||||
}
|
||||
}
|
||||
|
||||
class PrivateConstructor
|
||||
{
|
||||
public $prop;
|
||||
|
||||
public static function create($prop): self
|
||||
{
|
||||
return new self($prop);
|
||||
}
|
||||
|
||||
private function __construct($prop)
|
||||
{
|
||||
$this->prop = $prop;
|
||||
}
|
||||
}
|
||||
|
||||
class MyPrivateValue
|
||||
{
|
||||
protected $prot;
|
||||
private $priv;
|
||||
|
||||
public function __construct($prot, $priv)
|
||||
{
|
||||
$this->prot = $prot;
|
||||
$this->priv = $priv;
|
||||
}
|
||||
}
|
||||
|
||||
class MyPrivateChildValue extends MyPrivateValue
|
||||
{
|
||||
}
|
||||
|
||||
class MyArrayObject extends \ArrayObject
|
||||
{
|
||||
private $unused = 123;
|
||||
|
||||
public function __construct(array $array)
|
||||
{
|
||||
parent::__construct($array, 1);
|
||||
}
|
||||
|
||||
public function setFlags($flags)
|
||||
{
|
||||
throw new \BadMethodCallException('Calling MyArrayObject::setFlags() is forbidden');
|
||||
}
|
||||
}
|
||||
|
||||
class GoodNight
|
||||
{
|
||||
public function __sleep()
|
||||
{
|
||||
$this->good = 'night';
|
||||
|
||||
return ['good'];
|
||||
}
|
||||
}
|
||||
|
||||
final class FinalError extends \Error
|
||||
{
|
||||
public function __construct(bool $throw = true)
|
||||
{
|
||||
if ($throw) {
|
||||
throw new \BadMethodCallException('Should not be called.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final class FinalArrayIterator extends \ArrayIterator
|
||||
{
|
||||
public function serialize()
|
||||
{
|
||||
return serialize([123, parent::serialize()]);
|
||||
}
|
||||
|
||||
public function unserialize($data)
|
||||
{
|
||||
if ('' === $data) {
|
||||
throw new \InvalidArgumentException('Serialized data is empty.');
|
||||
}
|
||||
list(, $data) = unserialize($data);
|
||||
parent::unserialize($data);
|
||||
}
|
||||
}
|
||||
|
||||
final class FinalStdClass extends \stdClass
|
||||
{
|
||||
public function __clone()
|
||||
{
|
||||
throw new \BadMethodCallException('Should not be called.');
|
||||
}
|
||||
}
|
||||
|
||||
abstract class AbstractClass
|
||||
{
|
||||
protected $foo;
|
||||
private $bar;
|
||||
|
||||
protected function setBar($bar)
|
||||
{
|
||||
$this->bar = $bar;
|
||||
}
|
||||
}
|
||||
|
||||
class ConcreteClass extends AbstractClass
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->foo = 123;
|
||||
$this->setBar(234);
|
||||
}
|
||||
}
|
||||
|
||||
class FooSerializable implements \Serializable
|
||||
{
|
||||
private $foo;
|
||||
|
||||
public function __construct(string $foo)
|
||||
{
|
||||
$this->foo = $foo;
|
||||
}
|
||||
|
||||
public function getFoo(): string
|
||||
{
|
||||
return $this->foo;
|
||||
}
|
||||
|
||||
public function serialize(): string
|
||||
{
|
||||
return serialize([$this->getFoo()]);
|
||||
}
|
||||
|
||||
public function unserialize($str)
|
||||
{
|
||||
list($this->foo) = unserialize($str);
|
||||
}
|
||||
}
|
||||
|
||||
class Php74Serializable implements \Serializable
|
||||
{
|
||||
public function __serialize()
|
||||
{
|
||||
return [$this->foo = new \stdClass()];
|
||||
}
|
||||
|
||||
public function __unserialize(array $data)
|
||||
{
|
||||
list($this->foo) = $data;
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
throw new \BadMethodCallException();
|
||||
}
|
||||
|
||||
public function __wakeup()
|
||||
{
|
||||
throw new \BadMethodCallException();
|
||||
}
|
||||
|
||||
public function serialize()
|
||||
{
|
||||
throw new \BadMethodCallException();
|
||||
}
|
||||
|
||||
public function unserialize($ser)
|
||||
{
|
||||
throw new \BadMethodCallException();
|
||||
}
|
||||
}
|
||||
114
vendor/symfony/var-exporter/VarExporter.php
vendored
Normal file
114
vendor/symfony/var-exporter/VarExporter.php
vendored
Normal file
@@ -0,0 +1,114 @@
|
||||
<?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\VarExporter;
|
||||
|
||||
use Symfony\Component\VarExporter\Exception\ExceptionInterface;
|
||||
use Symfony\Component\VarExporter\Internal\Exporter;
|
||||
use Symfony\Component\VarExporter\Internal\Hydrator;
|
||||
use Symfony\Component\VarExporter\Internal\Registry;
|
||||
use Symfony\Component\VarExporter\Internal\Values;
|
||||
|
||||
/**
|
||||
* Exports serializable PHP values to PHP code.
|
||||
*
|
||||
* VarExporter allows serializing PHP data structures to plain PHP code (like var_export())
|
||||
* while preserving all the semantics associated with serialize() (unlike var_export()).
|
||||
*
|
||||
* By leveraging OPcache, the generated PHP code is faster than doing the same with unserialize().
|
||||
*
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*/
|
||||
final class VarExporter
|
||||
{
|
||||
/**
|
||||
* Exports a serializable PHP value to PHP code.
|
||||
*
|
||||
* @param mixed $value The value to export
|
||||
* @param bool &$isStaticValue Set to true after execution if the provided value is static, false otherwise
|
||||
*
|
||||
* @return string The value exported as PHP code
|
||||
*
|
||||
* @throws ExceptionInterface When the provided value cannot be serialized
|
||||
*/
|
||||
public static function export($value, bool &$isStaticValue = null): string
|
||||
{
|
||||
$isStaticValue = true;
|
||||
|
||||
if (!\is_object($value) && !(\is_array($value) && $value) && !$value instanceof \__PHP_Incomplete_Class && !\is_resource($value)) {
|
||||
return Exporter::export($value);
|
||||
}
|
||||
|
||||
$objectsPool = new \SplObjectStorage();
|
||||
$refsPool = [];
|
||||
$objectsCount = 0;
|
||||
|
||||
try {
|
||||
$value = Exporter::prepare([$value], $objectsPool, $refsPool, $objectsCount, $isStaticValue)[0];
|
||||
} finally {
|
||||
$references = [];
|
||||
foreach ($refsPool as $i => $v) {
|
||||
if ($v[0]->count) {
|
||||
$references[1 + $i] = $v[2];
|
||||
}
|
||||
$v[0] = $v[1];
|
||||
}
|
||||
}
|
||||
|
||||
if ($isStaticValue) {
|
||||
return Exporter::export($value);
|
||||
}
|
||||
|
||||
$classes = [];
|
||||
$values = [];
|
||||
$states = [];
|
||||
foreach ($objectsPool as $i => $v) {
|
||||
list(, $classes[], $values[], $wakeup) = $objectsPool[$v];
|
||||
if (0 < $wakeup) {
|
||||
$states[$wakeup] = $i;
|
||||
} elseif (0 > $wakeup) {
|
||||
$states[-$wakeup] = [$i, array_pop($values)];
|
||||
$values[] = [];
|
||||
}
|
||||
}
|
||||
ksort($states);
|
||||
|
||||
$wakeups = [null];
|
||||
foreach ($states as $k => $v) {
|
||||
if (\is_array($v)) {
|
||||
$wakeups[-$v[0]] = $v[1];
|
||||
} else {
|
||||
$wakeups[] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
if (null === $wakeups[0]) {
|
||||
unset($wakeups[0]);
|
||||
}
|
||||
|
||||
$properties = [];
|
||||
foreach ($values as $i => $vars) {
|
||||
foreach ($vars as $class => $values) {
|
||||
foreach ($values as $name => $v) {
|
||||
$properties[$class][$name][$i] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($classes || $references) {
|
||||
$value = new Hydrator(new Registry($classes), $references ? new Values($references) : null, $properties, $value, $wakeups);
|
||||
} else {
|
||||
$isStaticValue = true;
|
||||
}
|
||||
|
||||
return Exporter::export($value);
|
||||
}
|
||||
}
|
||||
36
vendor/symfony/var-exporter/composer.json
vendored
Normal file
36
vendor/symfony/var-exporter/composer.json
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "symfony/var-exporter",
|
||||
"type": "library",
|
||||
"description": "A blend of var_export() + serialize() to turn any serializable data structure to plain PHP code",
|
||||
"keywords": ["export", "serialize", "instantiate", "hydrate", "construct", "clone"],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.1.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/var-dumper": "^4.1.1"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Component\\VarExporter\\": "" },
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.3-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
31
vendor/symfony/var-exporter/phpunit.xml.dist
vendored
Normal file
31
vendor/symfony/var-exporter/phpunit.xml.dist
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.2/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
failOnRisky="true"
|
||||
failOnWarning="true"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Symfony VarExporter Component Test Suite">
|
||||
<directory>./Tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
Reference in New Issue
Block a user