Skip to content

Commit

Permalink
minor #52619 [Notifier][PropertyInfo][VarDumper] Remove unused code (…
Browse files Browse the repository at this point in the history
…alamirault)

This PR was squashed before being merged into the 7.1 branch.

Discussion
----------

[Notifier][PropertyInfo][VarDumper] Remove unused code

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License       | MIT

Remove unused code

Commits
-------

c25ec99 [Notifier][PropertyInfo][VarDumper] Remove unused code
  • Loading branch information
fabpot committed Jan 6, 2024
2 parents 67f3809 + c25ec99 commit e3e518b
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 28 deletions.
Expand Up @@ -49,7 +49,7 @@ public function __construct(

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

public function supports(MessageInterface $message): bool
Expand Down
Expand Up @@ -65,7 +65,7 @@ protected function doSend(MessageInterface $message): SentMessage
if (!preg_match('/^[+]+[1-9][0-9]{9,14}$/', $from)) {
if ('' === $from) {
throw new IncompleteDsnException('This phone number is invalid.');
} elseif ('' !== $from && null === $this->messagingProfileId) {
} elseif (null === $this->messagingProfileId) {
throw new IncompleteDsnException('The sending messaging profile must be specified.');
}

Expand Down
Expand Up @@ -688,7 +688,7 @@ private function getPropertyName(string $methodName, array $reflectionProperties
*/
private function findAdderAndRemover(\ReflectionClass $reflClass, array $singulars): array
{
if (!\is_array($this->arrayMutatorPrefixes) && 2 !== \count($this->arrayMutatorPrefixes)) {
if (2 !== \count($this->arrayMutatorPrefixes)) {
return [null, null, []];
}

Expand Down
6 changes: 1 addition & 5 deletions src/Symfony/Component/PropertyInfo/PhpStan/NameScope.php
Expand Up @@ -51,11 +51,7 @@ public function resolveStringName(string $name): string
return sprintf('%s\\%s', $this->uses[$firstNamePart], implode('\\', $nameParts));
}

if (null !== $this->namespace) {
return sprintf('%s\\%s', $this->namespace, $name);
}

return $name;
return sprintf('%s\\%s', $this->namespace, $name);
}

public function resolveRootClass(): string
Expand Down
Expand Up @@ -98,7 +98,7 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $

if ($c instanceof \ReflectionNamedType) {
$a += [
$prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c,
$prefix.'name' => $c->getName(),
$prefix.'allowsNull' => $c->allowsNull(),
$prefix.'isBuiltin' => $c->isBuiltin(),
];
Expand Down
19 changes: 0 additions & 19 deletions src/Symfony/Component/VarDumper/Cloner/VarCloner.php
Expand Up @@ -42,7 +42,6 @@ protected function doClone(mixed $var): array

$arrayStub = new Stub();
$arrayStub->type = Stub::TYPE_ARRAY;
$fromObjCast = false;

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

if ($fromObjCast) {
$fromObjCast = false;
$refs = $vals;
$vals = [];
$j = -1;
foreach ($queue[$i] as $k => $v) {
foreach ([$k => true] as $gk => $gv) {
}
if ($gk !== $k) {
$vals = (object) $vals;
$vals->{$k} = $refs[++$j];
$vals = (array) $vals;
} else {
$vals[$k] = $refs[++$j];
}
}
}

$queue[$i] = $vals;
}

Expand Down

0 comments on commit e3e518b

Please sign in to comment.