Skip to content

Commit 783878e

Browse files
Remove always true/false occurrences
1 parent 789055e commit 783878e

File tree

35 files changed

+36
-64
lines changed

35 files changed

+36
-64
lines changed

src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function upgradePassword(PasswordAuthenticatedUserInterface $user, string
121121
}
122122

123123
$repository = $this->getRepository();
124-
if ($user instanceof PasswordAuthenticatedUserInterface && $repository instanceof PasswordUpgraderInterface) {
124+
if ($repository instanceof PasswordUpgraderInterface) {
125125
$repository->upgradePassword($user, $newHashedPassword);
126126
}
127127
}

src/Symfony/Bridge/Twig/Command/DebugCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,6 @@ private function findWrongBundleOverrides(): array
412412
}
413413

414414
if ($notFoundBundles = array_diff_key($bundleNames, $this->bundlesMetadata)) {
415-
$alternatives = [];
416415
foreach ($notFoundBundles as $notFoundBundle => $path) {
417416
$alternatives[$path] = $this->findAlternatives($notFoundBundle, array_keys($this->bundlesMetadata));
418417
}

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ protected function describeContainerService(object $service, array $options = []
172172
$options['output']->table(
173173
['Service ID', 'Class'],
174174
[
175-
[$options['id'] ?? '-', $service::class],
175+
[$options['id'], $service::class],
176176
]
177177
);
178178
}
@@ -333,7 +333,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
333333
$tableRows[] = ['Autoconfigured', $definition->isAutoconfigured() ? 'yes' : 'no'];
334334

335335
if ($definition->getFile()) {
336-
$tableRows[] = ['Required File', $definition->getFile() ?: '-'];
336+
$tableRows[] = ['Required File', $definition->getFile()];
337337
}
338338

339339
if ($factory = $definition->getFactory()) {

src/Symfony/Bundle/FrameworkBundle/KernelBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function getKernel(): KernelInterface
5656
*/
5757
public function getProfile(): HttpProfile|false|null
5858
{
59-
if (null === $this->response || !$this->getContainer()->has('profiler')) {
59+
if (!isset($this->response) || !$this->getContainer()->has('profiler')) {
6060
return false;
6161
}
6262

src/Symfony/Bundle/FrameworkBundle/Tests/Command/XliffLintCommandTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ private function createCommandTester($application = null): CommandTester
6464

6565
$command = $application->find('lint:xliff');
6666

67-
if ($application) {
68-
$command->setApplication($application);
69-
}
67+
$command->setApplication($application);
7068

7169
return new CommandTester($command);
7270
}

src/Symfony/Bundle/FrameworkBundle/Tests/Command/YamlLintCommandTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ private function createCommandTester($application = null): CommandTester
112112

113113
$command = $application->find('lint:yaml');
114114

115-
if ($application) {
116-
$command->setApplication($application);
117-
}
115+
$command->setApplication($application);
118116

119117
return new CommandTester($command);
120118
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/ReplaceDecoratedRememberMeHandlerPass.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ public function process(ContainerBuilder $container): void
3737

3838
// get the actual custom remember me handler definition (passed to the decorator)
3939
$realRememberMeHandler = $container->findDefinition((string) $definition->getArgument(0));
40-
if (null === $realRememberMeHandler) {
41-
throw new \LogicException(\sprintf('Invalid service definition for custom remember me handler; no service found with ID "%s".', (string) $definition->getArgument(0)));
42-
}
4340

4441
foreach ($rememberMeHandlerTags as $rememberMeHandlerTag) {
4542
// some custom handlers may be used on multiple firewalls in the same application

src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/SecuredPageBundle/Security/Core/User/ArrayUserProvider.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\SecuredPageBundle\Security\Core\User;
1313

1414
use Symfony\Bundle\SecurityBundle\Tests\Functional\UserWithoutEquatable;
15-
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
1615
use Symfony\Component\Security\Core\Exception\UserNotFoundException;
1716
use Symfony\Component\Security\Core\User\InMemoryUser;
1817
use Symfony\Component\Security\Core\User\UserInterface;
@@ -59,10 +58,6 @@ public function loadUserByIdentifier(string $identifier): UserInterface
5958

6059
public function refreshUser(UserInterface $user): UserInterface
6160
{
62-
if (!$user instanceof UserInterface) {
63-
throw new UnsupportedUserException(\sprintf('Instances of "%s" are not supported.', get_debug_type($user)));
64-
}
65-
6661
$storedUser = $this->getUser($user->getUserIdentifier());
6762
$class = $storedUser::class;
6863

src/Symfony/Component/Cache/Adapter/TagAwareAdapter.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,10 @@ public function clear(string $prefix = ''): bool
207207
unset($this->deferred[$key]);
208208
}
209209
}
210-
} else {
211-
$this->deferred = [];
212-
}
213210

214-
if ($this->pool instanceof AdapterInterface) {
215211
return $this->pool->clear($prefix);
212+
} else {
213+
$this->deferred = [];
216214
}
217215

218216
return $this->pool->clear();

src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ private function write(string $file, string $data, ?int $expiresAt = null): bool
108108

109109
if ('\\' === \DIRECTORY_SEPARATOR) {
110110
$success = copy($tmp, $file);
111-
$unlink = true;
112111
} else {
113112
$success = rename($tmp, $file);
114113
$unlink = !$success;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy