Skip to content

Commit 1b48b57

Browse files
Remove useless code
1 parent a58cfb3 commit 1b48b57

File tree

51 files changed

+78
-214
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+78
-214
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ private function createFirewalls(array $config, ContainerBuilder $container): vo
307307

308308
$configId = 'security.firewall.map.config.'.$name;
309309

310-
[$matcher, $listeners, $exceptionListener, $logoutListener, $firewallAuthenticators] = $this->createFirewall($container, $name, $firewall, $authenticationProviders, $providerIds, $configId);
310+
[$matcher, $listeners, $exceptionListener, $logoutListener, $firewallAuthenticators] = $this->createFirewall($container, $name, $firewall, $providerIds, $configId);
311311

312312
if (!$firewallAuthenticators) {
313313
$authenticators[$name] = null;
@@ -348,7 +348,7 @@ private function createFirewalls(array $config, ContainerBuilder $container): vo
348348
}
349349
}
350350

351-
private function createFirewall(ContainerBuilder $container, string $id, array $firewall, array &$authenticationProviders, array $providerIds, string $configId): array
351+
private function createFirewall(ContainerBuilder $container, string $id, array $firewall, array $providerIds, string $configId): array
352352
{
353353
$config = $container->setDefinition($configId, new ChildDefinition('security.firewall.config'));
354354
$config->replaceArgument(0, $id);

src/Symfony/Component/BrowserKit/Test/Constraint/BrowserCookieValueSame.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ public function toString(): string
3434
if ($this->domain) {
3535
$str .= \sprintf(' for domain "%s"', $this->domain);
3636
}
37-
$str .= \sprintf(' with %svalue "%s"', $this->raw ? 'raw ' : '', $this->value);
3837

39-
return $str;
38+
return $str.\sprintf(' with %svalue "%s"', $this->raw ? 'raw ' : '', $this->value);
4039
}
4140

4241
/**

src/Symfony/Component/Dotenv/Dotenv.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ private function resolveVariables(string $value, array $loadedVars): string
485485
(?P<closing_brace>\})? # optional closing brace
486486
/x';
487487

488-
$value = preg_replace_callback($regex, function ($matches) use ($loadedVars) {
488+
return preg_replace_callback($regex, function ($matches) use ($loadedVars) {
489489
// odd number of backslashes means the $ character is escaped
490490
if (1 === \strlen($matches['backslashes']) % 2) {
491491
return substr($matches[0], 1);
@@ -532,8 +532,6 @@ private function resolveVariables(string $value, array $loadedVars): string
532532

533533
return $matches['backslashes'].$value;
534534
}, $value);
535-
536-
return $value;
537535
}
538536

539537
private function moveCursor(string $text): void

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,8 @@ public function transform(mixed $dateInterval): array
9393
}
9494
}
9595
$result['invert'] = '-' === $result['invert'];
96-
$result = array_intersect_key($result, array_flip($this->fields));
9796

98-
return $result;
97+
return array_intersect_key($result, array_flip($this->fields));
9998
}
10099

101100
/**

src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ private function round(int|float $number): int|float
210210
\NumberFormatter::ROUND_HALFDOWN => round($number, 0, \PHP_ROUND_HALF_DOWN),
211211
};
212212

213-
$number = 1 === $roundingCoef ? (int) $number : $number / $roundingCoef;
214-
215-
return $number;
213+
return 1 === $roundingCoef ? (int) $number : $number / $roundingCoef;
216214
}
217215
}

src/Symfony/Component/Form/Extension/Core/Type/TimeType.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
6060

6161
if ('single_text' === $options['widget']) {
6262
$builder->addEventListener(FormEvents::PRE_SUBMIT, static function (FormEvent $e) use ($options) {
63-
/** @var PreSubmitEvent $event */
6463
$data = $e->getData();
6564
if ($data && preg_match('/^(?P<hours>\d{2}):(?P<minutes>\d{2})(?::(?P<seconds>\d{2})(?:\.\d+)?)?$/', $data, $matches)) {
6665
if ($options['with_seconds']) {

src/Symfony/Component/Intl/Data/Generator/LanguageDataGenerator.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,11 @@ protected function generateDataForLocale(BundleEntryReaderInterface $reader, str
130130
$localizedNames[$language] = $name;
131131
}
132132
}
133-
$data = [
133+
134+
return [
134135
'Names' => $names,
135136
'LocalizedNames' => $localizedNames,
136137
];
137-
138-
return $data;
139138
}
140139

141140
return null;

src/Symfony/Component/Intl/Data/Generator/TimezoneDataGenerator.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,16 @@ protected function generateDataForRoot(BundleEntryReaderInterface $reader, strin
121121

122122
protected function generateDataForMeta(BundleEntryReaderInterface $reader, string $tempDir): ?array
123123
{
124-
$rootBundle = $reader->read($tempDir, 'root');
125-
126124
$this->zoneIds = array_unique($this->zoneIds);
127125

128126
sort($this->zoneIds);
129127
ksort($this->zoneToCountryMapping);
130128

131-
$data = [
129+
return [
132130
'Zones' => $this->zoneIds,
133131
'ZoneToCountry' => $this->zoneToCountryMapping,
134132
'CountryToZone' => self::generateCountryToZoneMapping($this->zoneToCountryMapping),
135133
];
136-
137-
return $data;
138134
}
139135

140136
private function generateZones(BundleEntryReaderInterface $reader, string $tempDir, string $locale): array

src/Symfony/Component/Lock/Store/PostgreSqlStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ public function exists(Key $key): bool
169169
$stmt = $this->getConnection()->prepare($sql);
170170

171171
$stmt->bindValue(':key', $this->getHashedKey($key));
172-
$result = $stmt->execute();
172+
$stmt->execute();
173173

174174
if ($stmt->fetchColumn() > 0) {
175175
// connection is locked, check for lock in internal store

src/Symfony/Component/Mailer/Bridge/Azure/Transport/AzureApiTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function doSendApi(SentMessage $sentMessage, Email $email, Envelope $e
6565

6666
$response = $this->client->request('POST', 'https://'.$endpoint, [
6767
'body' => json_encode($payload),
68-
'headers' => $this->getSignedHeaders($payload, $email),
68+
'headers' => $this->getSignedHeaders($payload),
6969
]);
7070

7171
try {
@@ -189,7 +189,7 @@ private function generateAuthenticationSignature(string $content): string
189189
/**
190190
* Get authenticated headers for signed request,.
191191
*/
192-
private function getSignedHeaders(array $payload, Email $message): array
192+
private function getSignedHeaders(array $payload): array
193193
{
194194
// HTTP Method verb (uppercase)
195195
$verb = 'POST';

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