Skip to content

Commit c25ec99

Browse files
alamiraultfabpot
authored andcommitted
[Notifier][PropertyInfo][VarDumper] Remove unused code
1 parent 67f3809 commit c25ec99

File tree

6 files changed

+5
-28
lines changed

6 files changed

+5
-28
lines changed

src/Symfony/Component/Notifier/Bridge/Mercure/MercureTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(
4949

5050
public function __toString(): string
5151
{
52-
return sprintf('mercure://%s%s', $this->hubId, null !== $this->topics ? '?'.http_build_query(['topic' => $this->topics], '', '&') : '');
52+
return sprintf('mercure://%s%s', $this->hubId, '?'.http_build_query(['topic' => $this->topics], '', '&'));
5353
}
5454

5555
public function supports(MessageInterface $message): bool

src/Symfony/Component/Notifier/Bridge/Telnyx/TelnyxTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function doSend(MessageInterface $message): SentMessage
6565
if (!preg_match('/^[+]+[1-9][0-9]{9,14}$/', $from)) {
6666
if ('' === $from) {
6767
throw new IncompleteDsnException('This phone number is invalid.');
68-
} elseif ('' !== $from && null === $this->messagingProfileId) {
68+
} elseif (null === $this->messagingProfileId) {
6969
throw new IncompleteDsnException('The sending messaging profile must be specified.');
7070
}
7171

src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ private function getPropertyName(string $methodName, array $reflectionProperties
688688
*/
689689
private function findAdderAndRemover(\ReflectionClass $reflClass, array $singulars): array
690690
{
691-
if (!\is_array($this->arrayMutatorPrefixes) && 2 !== \count($this->arrayMutatorPrefixes)) {
691+
if (2 !== \count($this->arrayMutatorPrefixes)) {
692692
return [null, null, []];
693693
}
694694

src/Symfony/Component/PropertyInfo/PhpStan/NameScope.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ public function resolveStringName(string $name): string
5151
return sprintf('%s\\%s', $this->uses[$firstNamePart], implode('\\', $nameParts));
5252
}
5353

54-
if (null !== $this->namespace) {
55-
return sprintf('%s\\%s', $this->namespace, $name);
56-
}
57-
58-
return $name;
54+
return sprintf('%s\\%s', $this->namespace, $name);
5955
}
6056

6157
public function resolveRootClass(): string

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

0 commit comments

Comments
 (0)