Skip to content

Commit ec2b34d

Browse files
committed
[VarDumper] Clean unused code
1 parent 4e944be commit ec2b34d

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $
9898

9999
if ($c instanceof \ReflectionNamedType) {
100100
$a += [
101-
$prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c,
101+
$prefix.'name' => $c->getName(),
102102
$prefix.'allowsNull' => $c->allowsNull(),
103103
$prefix.'isBuiltin' => $c->isBuiltin(),
104104
];

src/Symfony/Component/VarDumper/Cloner/VarCloner.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ protected function doClone(mixed $var): array
4242

4343
$arrayStub = new Stub();
4444
$arrayStub->type = Stub::TYPE_ARRAY;
45-
$fromObjCast = false;
4645

4746
for ($i = 0; $i < $len; ++$i) {
4847
// Detect when we move on to the next tree depth
@@ -213,24 +212,6 @@ protected function doClone(mixed $var): array
213212
}
214213
}
215214

216-
if ($fromObjCast) {
217-
$fromObjCast = false;
218-
$refs = $vals;
219-
$vals = [];
220-
$j = -1;
221-
foreach ($queue[$i] as $k => $v) {
222-
foreach ([$k => true] as $gk => $gv) {
223-
}
224-
if ($gk !== $k) {
225-
$vals = (object) $vals;
226-
$vals->{$k} = $refs[++$j];
227-
$vals = (array) $vals;
228-
} else {
229-
$vals[$k] = $refs[++$j];
230-
}
231-
}
232-
}
233-
234215
$queue[$i] = $vals;
235216
}
236217

src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function setCharset(string $charset): string
9090
$prev = $this->charset;
9191

9292
$charset = strtoupper($charset);
93-
$charset = null === $charset || 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;
93+
$charset = 'UTF-8' === $charset || 'UTF8' === $charset ? 'CP1252' : $charset;
9494

9595
$this->charset = $charset;
9696

0 commit comments

Comments
 (0)