updated packages

This commit is contained in:
2019-05-18 09:06:43 +00:00
parent 901d16349e
commit e9487fa58a
2025 changed files with 30366 additions and 49653 deletions

View File

@@ -20,12 +20,12 @@ use Symfony\Component\VarDumper\Cloner\Stub;
*/
class SplCaster
{
private static $splFileObjectFlags = array(
private static $splFileObjectFlags = [
\SplFileObject::DROP_NEW_LINE => 'DROP_NEW_LINE',
\SplFileObject::READ_AHEAD => 'READ_AHEAD',
\SplFileObject::SKIP_EMPTY => 'SKIP_EMPTY',
\SplFileObject::READ_CSV => 'READ_CSV',
);
];
public static function castArrayObject(\ArrayObject $c, array $a, Stub $stub, $isNested)
{
@@ -39,9 +39,9 @@ class SplCaster
public static function castHeap(\Iterator $c, array $a, Stub $stub, $isNested)
{
$a += array(
$a += [
Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c),
);
];
return $a;
}
@@ -52,10 +52,10 @@ class SplCaster
$mode = $c->getIteratorMode();
$c->setIteratorMode(\SplDoublyLinkedList::IT_MODE_KEEP | $mode & ~\SplDoublyLinkedList::IT_MODE_DELETE);
$a += array(
$a += [
$prefix.'mode' => new ConstStub((($mode & \SplDoublyLinkedList::IT_MODE_LIFO) ? 'IT_MODE_LIFO' : 'IT_MODE_FIFO').' | '.(($mode & \SplDoublyLinkedList::IT_MODE_DELETE) ? 'IT_MODE_DELETE' : 'IT_MODE_KEEP'), $mode),
$prefix.'dllist' => iterator_to_array($c),
);
];
$c->setIteratorMode($mode);
return $a;
@@ -63,7 +63,7 @@ class SplCaster
public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, $isNested)
{
static $map = array(
static $map = [
'path' => 'getPath',
'filename' => 'getFilename',
'basename' => 'getBasename',
@@ -86,7 +86,7 @@ class SplCaster
'dir' => 'isDir',
'link' => 'isLink',
'linkTarget' => 'getLinkTarget',
);
];
$prefix = Caster::PREFIX_VIRTUAL;
@@ -105,7 +105,7 @@ class SplCaster
$a[$prefix.'perms'] = new ConstStub(sprintf('0%o', $a[$prefix.'perms']), $a[$prefix.'perms']);
}
static $mapDate = array('aTime', 'mTime', 'cTime');
static $mapDate = ['aTime', 'mTime', 'cTime'];
foreach ($mapDate as $key) {
if (isset($a[$prefix.$key])) {
$a[$prefix.$key] = new ConstStub(date('Y-m-d H:i:s', $a[$prefix.$key]), $a[$prefix.$key]);
@@ -117,14 +117,14 @@ class SplCaster
public static function castFileObject(\SplFileObject $c, array $a, Stub $stub, $isNested)
{
static $map = array(
static $map = [
'csvControl' => 'getCsvControl',
'flags' => 'getFlags',
'maxLineLen' => 'getMaxLineLen',
'fstat' => 'fstat',
'eof' => 'eof',
'key' => 'key',
);
];
$prefix = Caster::PREFIX_VIRTUAL;
@@ -136,7 +136,7 @@ class SplCaster
}
if (isset($a[$prefix.'flags'])) {
$flagsArray = array();
$flagsArray = [];
foreach (self::$splFileObjectFlags as $value => $name) {
if ($a[$prefix.'flags'] & $value) {
$flagsArray[] = $name;
@@ -146,7 +146,7 @@ class SplCaster
}
if (isset($a[$prefix.'fstat'])) {
$a[$prefix.'fstat'] = new CutArrayStub($a[$prefix.'fstat'], array('dev', 'ino', 'nlink', 'rdev', 'blksize', 'blocks'));
$a[$prefix.'fstat'] = new CutArrayStub($a[$prefix.'fstat'], ['dev', 'ino', 'nlink', 'rdev', 'blksize', 'blocks']);
}
return $a;
@@ -154,29 +154,29 @@ class SplCaster
public static function castFixedArray(\SplFixedArray $c, array $a, Stub $stub, $isNested)
{
$a += array(
$a += [
Caster::PREFIX_VIRTUAL.'storage' => $c->toArray(),
);
];
return $a;
}
public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, $isNested)
{
$storage = array();
$storage = [];
unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967
$clone = clone $c;
foreach ($clone as $obj) {
$storage[] = array(
$storage[] = [
'object' => $obj,
'info' => $clone->getInfo(),
);
];
}
$a += array(
$a += [
Caster::PREFIX_VIRTUAL.'storage' => $storage,
);
];
return $a;
}
@@ -199,10 +199,10 @@ class SplCaster
$a = Caster::castObject($c, $class);
$c->setFlags($flags);
}
$a += array(
$a += [
$prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST),
$prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS),
);
];
if ($c instanceof \ArrayObject) {
$a[$prefix.'iteratorClass'] = new ClassStub($c->getIteratorClass());
}