update patch 1
This commit is contained in:
+2
-3
@@ -42,10 +42,9 @@ class ArgsStub extends EnumStub
|
||||
$params[] = $variadic;
|
||||
}
|
||||
if (['...'] === $params) {
|
||||
$this->dumpKeys = false;
|
||||
$this->value = $values[0]->value;
|
||||
parent::__construct($values[0]->value, false);
|
||||
} else {
|
||||
$this->value = array_combine($params, $values);
|
||||
parent::__construct(array_combine($params, $values));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -190,7 +190,7 @@ class Caster
|
||||
$p->isPublic() => $p->name,
|
||||
$p->isProtected() => self::PREFIX_PROTECTED.$p->name,
|
||||
default => "\0".$className."\0".$p->name,
|
||||
}] = new UninitializedStub($p);
|
||||
}] = \PHP_VERSION_ID >= 80400 && $p->isVirtual() ? new VirtualStub($p) : new UninitializedStub($p);
|
||||
}
|
||||
|
||||
return $classProperties;
|
||||
|
||||
+4
-4
@@ -93,16 +93,16 @@ class DateCaster
|
||||
foreach (clone $p as $i => $d) {
|
||||
if (self::PERIOD_LIMIT === $i) {
|
||||
$now = new \DateTimeImmutable('now', new \DateTimeZone('UTC'));
|
||||
$dates[] = sprintf('%s more', ($end = $p->getEndDate())
|
||||
$dates[] = \sprintf('%s more', ($end = $p->getEndDate())
|
||||
? ceil(($end->format('U.u') - $d->format('U.u')) / ((int) $now->add($p->getDateInterval())->format('U.u') - (int) $now->format('U.u')))
|
||||
: $p->recurrences - $i
|
||||
);
|
||||
break;
|
||||
}
|
||||
$dates[] = sprintf('%s) %s', $i + 1, self::formatDateTime($d));
|
||||
$dates[] = \sprintf('%s) %s', $i + 1, self::formatDateTime($d));
|
||||
}
|
||||
|
||||
$period = sprintf(
|
||||
$period = \sprintf(
|
||||
'every %s, from %s%s %s',
|
||||
self::formatInterval($p->getDateInterval()),
|
||||
$p->include_start_date ? '[' : ']',
|
||||
@@ -122,6 +122,6 @@ class DateCaster
|
||||
|
||||
private static function formatSeconds(string $s, string $us): string
|
||||
{
|
||||
return sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us));
|
||||
return \sprintf('%02d.%s', $s, 0 === ($len = \strlen($t = rtrim($us, '0'))) ? '0' : ($len <= 3 ? str_pad($t, 3, '0') : $us));
|
||||
}
|
||||
}
|
||||
|
||||
+4
-5
@@ -20,11 +20,10 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
*/
|
||||
class EnumStub extends Stub
|
||||
{
|
||||
public bool $dumpKeys = true;
|
||||
|
||||
public function __construct(array $values, bool $dumpKeys = true)
|
||||
{
|
||||
public function __construct(
|
||||
array $values,
|
||||
public bool $dumpKeys = true,
|
||||
) {
|
||||
$this->value = $values;
|
||||
$this->dumpKeys = $dumpKeys;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -174,7 +174,7 @@ class ExceptionCaster
|
||||
} else {
|
||||
$label = substr_replace($prefix, "title=Stack level $j.", 2, 0).$lastCall;
|
||||
}
|
||||
$a[substr_replace($label, sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame;
|
||||
$a[substr_replace($label, \sprintf('separator=%s&', $frame instanceof EnumStub ? ' ' : ':'), 2, 0)] = $frame;
|
||||
|
||||
$lastCall = $call;
|
||||
}
|
||||
@@ -219,7 +219,7 @@ class ExceptionCaster
|
||||
if (isset($f['object'])) {
|
||||
$template = $f['object'];
|
||||
} elseif ((new \ReflectionClass($f['class']))->isInstantiable()) {
|
||||
$template = unserialize(sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class']));
|
||||
$template = unserialize(\sprintf('O:%d:"%s":0:{}', \strlen($f['class']), $f['class']));
|
||||
}
|
||||
if (null !== $template) {
|
||||
$ellipsis = 0;
|
||||
@@ -243,7 +243,7 @@ class ExceptionCaster
|
||||
$ellipsis += 1 + \strlen($f['line']);
|
||||
}
|
||||
}
|
||||
$srcAttr .= sprintf('&separator= &file=%s&line=%d', rawurlencode($f['file']), $f['line']);
|
||||
$srcAttr .= \sprintf('&separator= &file=%s&line=%d', rawurlencode($f['file']), $f['line']);
|
||||
} else {
|
||||
$srcAttr .= '&separator=:';
|
||||
}
|
||||
@@ -271,7 +271,7 @@ class ExceptionCaster
|
||||
public static function castFlattenException(FlattenException $e, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
if ($isNested) {
|
||||
$k = sprintf(Caster::PATTERN_PRIVATE, FlattenException::class, 'traceAsString');
|
||||
$k = \sprintf(Caster::PATTERN_PRIVATE, FlattenException::class, 'traceAsString');
|
||||
$a[$k] = new CutStub($a[$k]);
|
||||
}
|
||||
|
||||
@@ -387,7 +387,7 @@ class ExceptionCaster
|
||||
}
|
||||
}
|
||||
$c->attr['lang'] = $lang;
|
||||
$srcLines[sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c;
|
||||
$srcLines[\sprintf("\0~separator=› &%d\0", $i + $line - $srcContext)] = $c;
|
||||
}
|
||||
|
||||
return new EnumStub($srcLines);
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ final class FFICaster
|
||||
$type = \FFI::typeof($data);
|
||||
}
|
||||
|
||||
$stub->class = sprintf('%s<%s> size %d align %d', ($data ?? $type)::class, $type->getName(), $type->getSize(), $type->getAlignment());
|
||||
$stub->class = \sprintf('%s<%s> size %d align %d', ($data ?? $type)::class, $type->getName(), $type->getSize(), $type->getAlignment());
|
||||
|
||||
return match ($type->getKind()) {
|
||||
CType::TYPE_FLOAT,
|
||||
|
||||
+6
-8
@@ -18,13 +18,11 @@ namespace Symfony\Component\VarDumper\Caster;
|
||||
*/
|
||||
class FrameStub extends EnumStub
|
||||
{
|
||||
public bool $keepArgs;
|
||||
public bool $inTraceStub;
|
||||
|
||||
public function __construct(array $frame, bool $keepArgs = true, bool $inTraceStub = false)
|
||||
{
|
||||
$this->value = $frame;
|
||||
$this->keepArgs = $keepArgs;
|
||||
$this->inTraceStub = $inTraceStub;
|
||||
public function __construct(
|
||||
array $frame,
|
||||
public bool $keepArgs = true,
|
||||
public bool $inTraceStub = false,
|
||||
) {
|
||||
parent::__construct($frame);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -131,8 +131,8 @@ class PgSqlCaster
|
||||
for ($i = 0; $i < $fields; ++$i) {
|
||||
$field = [
|
||||
'name' => pg_field_name($result, $i),
|
||||
'table' => sprintf('%s (OID: %s)', pg_field_table($result, $i), pg_field_table($result, $i, true)),
|
||||
'type' => sprintf('%s (OID: %s)', pg_field_type($result, $i), pg_field_type_oid($result, $i)),
|
||||
'table' => \sprintf('%s (OID: %s)', pg_field_table($result, $i), pg_field_table($result, $i, true)),
|
||||
'type' => \sprintf('%s (OID: %s)', pg_field_type($result, $i), pg_field_type_oid($result, $i)),
|
||||
'nullable' => (bool) pg_field_is_null($result, $i),
|
||||
'storage' => pg_field_size($result, $i).' bytes',
|
||||
'display' => pg_field_prtlen($result, $i).' chars',
|
||||
|
||||
+3
-3
@@ -126,7 +126,7 @@ class SplCaster
|
||||
}
|
||||
|
||||
if (isset($a[$prefix.'perms'])) {
|
||||
$a[$prefix.'perms'] = new ConstStub(sprintf('0%o', $a[$prefix.'perms']), $a[$prefix.'perms']);
|
||||
$a[$prefix.'perms'] = new ConstStub(\sprintf('0%o', $a[$prefix.'perms']), $a[$prefix.'perms']);
|
||||
}
|
||||
|
||||
static $mapDate = ['aTime', 'mTime', 'cTime'];
|
||||
@@ -187,7 +187,7 @@ class SplCaster
|
||||
$storage[] = new EnumStub([
|
||||
'object' => $obj,
|
||||
'info' => $clone->getInfo(),
|
||||
]);
|
||||
]);
|
||||
}
|
||||
|
||||
$a += [
|
||||
@@ -219,7 +219,7 @@ class SplCaster
|
||||
$map[] = new EnumStub([
|
||||
'object' => $obj,
|
||||
'data' => $data,
|
||||
]);
|
||||
]);
|
||||
}
|
||||
|
||||
$a += [
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ class SymfonyCaster
|
||||
|
||||
public static function castHttpClient($client, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
$multiKey = sprintf("\0%s\0multi", $client::class);
|
||||
$multiKey = \sprintf("\0%s\0multi", $client::class);
|
||||
if (isset($a[$multiKey])) {
|
||||
$a[$multiKey] = new CutStub($a[$multiKey]);
|
||||
}
|
||||
|
||||
+7
-11
@@ -20,17 +20,13 @@ use Symfony\Component\VarDumper\Cloner\Stub;
|
||||
*/
|
||||
class TraceStub extends Stub
|
||||
{
|
||||
public bool $keepArgs;
|
||||
public int $sliceOffset;
|
||||
public ?int $sliceLength;
|
||||
public int $numberingOffset;
|
||||
|
||||
public function __construct(array $trace, bool $keepArgs = true, int $sliceOffset = 0, ?int $sliceLength = null, int $numberingOffset = 0)
|
||||
{
|
||||
public function __construct(
|
||||
array $trace,
|
||||
public bool $keepArgs = true,
|
||||
public int $sliceOffset = 0,
|
||||
public ?int $sliceLength = null,
|
||||
public int $numberingOffset = 0,
|
||||
) {
|
||||
$this->value = $trace;
|
||||
$this->keepArgs = $keepArgs;
|
||||
$this->sliceOffset = $sliceOffset;
|
||||
$this->sliceLength = $sliceLength;
|
||||
$this->numberingOffset = $numberingOffset;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user