8000 minor #58373 Fix `$this` calls to static ones when relevant (alexandr… · symfony/symfony@db47683 · GitHub
[go: up one dir, main page]

Skip to content

Commit db47683

Browse files
minor #58373 Fix $this calls to static ones when relevant (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- Fix `$this` calls to static ones when relevant | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Commits ------- 9a65f79 Fix `$this` calls to static ones when relevant
2 parents 28ceddd + 9a65f79 commit db47683

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

src/Symfony/Component/Console/Command/DumpCompletionCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protected function configure(): void
3535
$commandName = basename($fullCommand);
3636
$fullCommand = @realpath($fullCommand) ?: $fullCommand;
3737

38-
$shell = $this->guessShell();
38+
$shell = self::guessShell();
3939
[$rcFile, $completionFile] = match ($shell) {
4040
'fish' => ['~/.config/fish/config.fish', "/etc/fish/completions/$commandName.fish"],
4141
'zsh' => ['~/.zshrc', '$fpath[1]/_'.$commandName],

src/Symfony/Component/Console/EventListener/ErrorListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function onConsoleError(ConsoleErrorEvent $event): void
3737

3838
$error = $event->getError();
3939

40-
if (!$inputString = $this->getInputString($event)) {
40+
if (!$inputString = self::getInputString($event)) {
4141
$this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]);
4242

4343
return;
@@ -58,7 +58,7 @@ public function onConsoleTerminate(ConsoleTerminateEvent $event): void
5858
return;
5959
}
6060

61-
if (!$inputString = $this->getInputString($event)) {
61+
if (!$inputString = self::getInputString($event)) {
6262
$this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]);
6363

6464
return;

src/Symfony/Component/DependencyInjection/EnvVarProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function getEnv(string $prefix, string $name, \Closure $getEnv): mixed
230230
return null;
231231
}
232232

233-
if (!isset($this->getProvidedTypes()[$prefix])) {
233+
if (!isset(static::getProvidedTypes()[$prefix])) {
234234
throw new RuntimeException(\sprintf('Unsupported env var prefix "%s".', $prefix));
235235
}
236236

src/Symfony/Component/HttpFoundation/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,7 +1572,7 @@ public function getLanguages(): array
15721572
$this->languages = [];
15731573
foreach ($languages as $acceptHeaderItem) {
15741574
$lang = $acceptHeaderItem->getValue();
1575-
$this->languages[] = $this->formatLocale($lang);
1575+
$this->languages[] = self::formatLocale($lang);
15761576
}
15771577
$this->languages = array_unique($this->languages);
15781578

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ protected function refreshUser(TokenInterface $token): ?TokenInterface
207207
$newToken->setUser($refreshedUser, false);
208208

209209
// tokens can be deauthenticated if the user has been changed.
210-
if ($token instanceof AbstractToken && $this->hasUserChanged($user, $newToken)) {
210+
if ($token instanceof AbstractToken && self::hasUserChanged($user, $newToken)) {
211211
$userDeauthenticated = true;
212212

213213
$this->logger?->debug('Cannot refresh token because user has changed.', ['username' => $refreshedUser->getUserIdentifier(), 'provider' => $provider::class]);

src/Symfony/Component/Workflow/MarkingStore/MethodMarkingStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private function getGetter(object $subject): callable
8888
$property = $this->property;
8989
$method = 'get'.ucfirst($property);
9090

91-
return match ($this->getters[$subject::class] ??= $this->getType($subject, $property, $method)) {
91+
return match ($this->getters[$subject::class] ??= self::getType($subject, $property, $method)) {
9292
MarkingStoreMethod::METHOD => $subject->{$method}(...),
9393
MarkingStoreMethod::PROPERTY => static fn () => $subject->{$property},
9494
};
@@ -99,7 +99,7 @@ private function getSetter(object $subject): callable
9999
$property = $this->property;
100100
$method = 'set'.ucfirst($property);
101101

102-
return match ($this->setters[$subject::class] ??= $this->getType($subject, $property, $method)) {
102+
return match ($this->setters[$subject::class] ??= self::getType($subject, $property, $method)) {
103103
MarkingStoreMethod::METHOD => $subject->{$method}(...),
104104
MarkingStoreMethod::PROPERTY => static fn ($marking) => $subject->{$property} = $marking,
105105
};

0 commit comments

Comments
 (0)
0