Skip to content

Commit 20ec3df

Browse files
Merge branch '7.0' into 7.1
* 7.0: List CS fix in .git-blame-ignore-revs Fix implicitly-required parameters minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench) Fix bad merge List CS fix in .git-blame-ignore-revs Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents 4aa7676 + e9a5d25 commit 20ec3df

29 files changed

+47
-47
lines changed

AppVariable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function getEnabled_locales(): array
165165
* * getFlashes('notice') returns a simple array with flash messages of that type
166166
* * getFlashes(['notice', 'error']) returns a nested array of type => messages.
167167
*/
168-
public function getFlashes(string|array $types = null): array
168+
public function getFlashes(string|array|null $types = null): array
169169
{
170170
try {
171171
$session = $this->getSession();

Command/DebugCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DebugCommand extends Command
4848

4949
private ?FileLinkFormatter $fileLinkFormatter;
5050

51-
public function __construct(Environment $twig, string $projectDir = null, array $bundlesMetadata = [], string $twigDefaultPath = null, FileLinkFormatter $fileLinkFormatter = null)
51+
public function __construct(Environment $twig, ?string $projectDir = null, array $bundlesMetadata = [], ?string $twigDefaultPath = null, ?FileLinkFormatter $fileLinkFormatter = null)
5252
{
5353
parent::__construct();
5454

@@ -214,7 +214,7 @@ private function displayPathsJson(SymfonyStyle $io, string $name): void
214214
$io->writeln(json_encode($data));
215215
}
216216

217-
private function displayGeneralText(SymfonyStyle $io, string $filter = null): void
217+
private function displayGeneralText(SymfonyStyle $io, ?string $filter = null): void
218218
{
219219
$decorated = $io->isDecorated();
220220
$types = ['functions', 'filters', 'tests', 'globals'];
@@ -276,7 +276,7 @@ private function displayGeneralJson(SymfonyStyle $io, ?string $filter): void
276276
$io->writeln($decorated ? OutputFormatter::escape($data) : $data);
277277
}
278278

279-
private function getLoaderPaths(string $name = null): array
279+
private function getLoaderPaths(?string $name = null): array
280280
{
281281
$loaderPaths = [];
282282
foreach ($this->getFilesystemLoaders() as $loader) {

Command/LintCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ private function displayJson(OutputInterface $output, array $filesInfo): int
221221
return min($errors, 1);
222222
}
223223

224-
private function renderException(SymfonyStyle $output, string $template, Error $exception, string $file = null, GithubActionReporter $githubReporter = null): void
224+
private function renderException(SymfonyStyle $output, string $template, Error $exception, ?string $file = null, ?GithubActionReporter $githubReporter = null): void
225225
{
226226
$line = $exception->getTemplateLine();
227227

DataCollector/TwigDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
3232
private ?Environment $twig;
3333
private array $computed;
3434

35-
public function __construct(Profile $profile, Environment $twig = null)
35+
public function __construct(Profile $profile, ?Environment $twig = null)
3636
{
3737
$this->profile = $profile;
3838
$this->twig = $twig;
3939
}
4040

41-
public function collect(Request $request, Response $response, \Throwable $exception = null): void
41+
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
4242
{
4343
}
4444

ErrorRenderer/TwigErrorRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TwigErrorRenderer implements ErrorRendererInterface
3232
/**
3333
* @param bool|callable $debug The debugging mode as a boolean or a callable that should return it
3434
*/
35-
public function __construct(Environment $twig, HtmlErrorRenderer $fallbackErrorRenderer = null, bool|callable $debug = false)
35+
public function __construct(Environment $twig, ?HtmlErrorRenderer $fallbackErrorRenderer = null, bool|callable $debug = false)
3636
{
3737
$this->twig = $twig;
3838
$this->fallbackErrorRenderer = $fallbackErrorRenderer ?? new HtmlErrorRenderer();

Extension/AssetExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ public function getFunctions(): array
4343
* If the package used to generate the path is an instance of
4444
* UrlPackage, you will always get a URL and not a path.
4545
*/
46-
public function getAssetUrl(string $path, string $packageName = null): string
46+
public function getAssetUrl(string $path, ?string $packageName = null): string
4747
{
4848
return $this->packages->getUrl($path, $packageName);
4949
}
5050

5151
/**
5252
* Returns the version of an asset.
5353
*/
54-
public function getAssetVersion(string $path, string $packageName = null): string
54+
public function getAssetVersion(string $path, ?string $packageName = null): string
5555
{
5656
return $this->packages->getVersion($path, $packageName);
5757
}

Extension/DumpExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class DumpExtension extends AbstractExtension
2929
private ClonerInterface $cloner;
3030
private ?HtmlDumper $dumper;
3131

32-
public function __construct(ClonerInterface $cloner, HtmlDumper $dumper = null)
32+
public function __construct(ClonerInterface $cloner, ?HtmlDumper $dumper = null)
3333
{
3434
$this->cloner = $cloner;
3535
$this->dumper = $dumper;

Extension/FormExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class FormExtension extends AbstractExtension
3535
{
3636
private ?TranslatorInterface $translator;
3737

38-
public function __construct(TranslatorInterface $translator = null)
38+
public function __construct(?TranslatorInterface $translator = null)
3939
{
4040
$this->translator = $translator;
4141
}

Extension/HtmlSanitizerExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getFilters(): array
3333
];
3434
}
3535

36-
public function sanitize(string $html, string $sanitizer = null): string
36+
public function sanitize(string $html, ?string $sanitizer = null): string
3737
{
3838
return $this->sanitizers->get($sanitizer ?? $this->defaultSanitizer)->sanitize($html);
3939
}

Extension/HttpKernelRuntime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class HttpKernelRuntime
2525
private FragmentHandler $handler;
2626
private ?FragmentUriGeneratorInterface $fragmentUriGenerator;
2727

28-
public function __construct(FragmentHandler $handler, FragmentUriGeneratorInterface $fragmentUriGenerator = null)
28+
public function __construct(FragmentHandler $handler, ?FragmentUriGeneratorInterface $fragmentUriGenerator = null)
2929
{
3030
$this->handler = $handler;
3131
$this->fragmentUriGenerator = $fragmentUriGenerator;

Extension/LogoutUrlExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function getFunctions(): array
4242
*
4343
* @param string|null $key The firewall key or null to use the current firewall key
4444
*/
45-
public function getLogoutPath(string $key = null): string
45+
public function getLogoutPath(?string $key = null): string
4646
{
4747
return $this->generator->getLogoutPath($key);
4848
}
@@ -52,7 +52,7 @@ public function getLogoutPath(string $key = null): string
5252
*
5353
* @param string|null $key The firewall key or null to use the current firewall key
5454
*/
55-
public function getLogoutUrl(string $key = null): string
55+
public function getLogoutUrl(?string $key = null): string
5656
{
5757
return $this->generator->getLogoutUrl($key);
5858
}

Extension/ProfilerExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class ProfilerExtension extends BaseProfilerExtension
2828
*/
2929
private \SplObjectStorage $events;
3030

31-
public function __construct(Profile $profile, Stopwatch $stopwatch = null)
31+
public function __construct(Profile $profile, ?Stopwatch $stopwatch = null)
3232
{
3333
parent::__construct($profile);
3434

Extension/SecurityExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ final class SecurityExtension extends AbstractExtension
2828
private ?AuthorizationCheckerInterface $securityChecker;
2929
private ?ImpersonateUrlGenerator $impersonateUrlGenerator;
3030

31-
public function __construct(AuthorizationCheckerInterface $securityChecker = null, ImpersonateUrlGenerator $impersonateUrlGenerator = null)
31+
public function __construct(?AuthorizationCheckerInterface $securityChecker = null, ?ImpersonateUrlGenerator $impersonateUrlGenerator = null)
3232
{
3333
$this->securityChecker = $securityChecker;
3434
$this->impersonateUrlGenerator = $impersonateUrlGenerator;
3535
}
3636

37-
public function isGranted(mixed $role, mixed $object = null, string $field = null): bool
37+
public function isGranted(mixed $role, mixed $object = null, ?string $field = null): bool
3838
{
3939
if (null === $this->securityChecker) {
4040
return false;
@@ -51,7 +51,7 @@ public function isGranted(mixed $role, mixed $object = null, string $field = nul
5151
}
5252
}
5353

54-
public function getImpersonateExitUrl(string $exitTo = null): string
54+
public function getImpersonateExitUrl(?string $exitTo = null): string
5555
{
5656
if (null === $this->impersonateUrlGenerator) {
5757
return '';
@@ -60,7 +60,7 @@ public function getImpersonateExitUrl(string $exitTo = null): string
6060
return $this->impersonateUrlGenerator->generateExitUrl($exitTo);
6161
}
6262

63-
public function getImpersonateExitPath(string $exitTo = null): string
63+
public function getImpersonateExitPath(?string $exitTo = null): string
6464
{
6565
if (null === $this->impersonateUrlGenerator) {
6666
return '';

Extension/StopwatchExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class StopwatchExtension extends AbstractExtension
2626
private ?Stopwatch $stopwatch;
2727
private bool $enabled;
2828

29-
public function __construct(Stopwatch $stopwatch = null, bool $enabled = true)
29+
public function __construct(?Stopwatch $stopwatch = null, bool $enabled = true)
3030
{
3131
$this->stopwatch = $stopwatch;
3232
$this->enabled = $enabled;

Extension/TranslationExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class TranslationExtension extends AbstractExtension
3737
private ?TranslatorInterface $translator;
3838
private ?TranslationNodeVisitor $translationNodeVisitor;
3939

40-
public function __construct(TranslatorInterface $translator = null, TranslationNodeVisitor $translationNodeVisitor = null)
40+
public function __construct(?TranslatorInterface $translator = null, ?TranslationNodeVisitor $translationNodeVisitor = null)
4141
{
4242
$this->translator = $translator;
4343
$this->translationNodeVisitor = $translationNodeVisitor;
@@ -96,7 +96,7 @@ public function getTranslationNodeVisitor(): TranslationNodeVisitor
9696
/**
9797
* @param array|string $arguments Can be the locale as a string when $message is a TranslatableInterface
9898
*/
99-
public function trans(string|\Stringable|TranslatableInterface|null $message, array|string $arguments = [], string $domain = null, string $locale = null, int $count = null): string
99+
public function trans(string|\Stringable|TranslatableInterface|null $message, array|string $arguments = [], ?string $domain = null, ?string $locale = null, ?int $count = null): string
100100
{
101101
if ($message instanceof TranslatableInterface) {
102102
if ([] !== $arguments && !\is_string($arguments)) {
@@ -125,7 +125,7 @@ public function trans(string|\Stringable|TranslatableInterface|null $message, ar
125125
return $this->getTranslator()->trans($message, $arguments, $domain, $locale);
126126
}
127127

128-
public function createTranslatable(string $message, array $parameters = [], string $domain = null): TranslatableMessage
128+
public function createTranslatable(string $message, array $parameters = [], ?string $domain = null): TranslatableMessage
129129
{
130130
if (!class_exists(TranslatableMessage::class)) {
131131
throw new \LogicException(sprintf('You cannot use the "%s" as the Translation Component is not installed. Try running "composer require symfony/translation".', __CLASS__));

Extension/WorkflowExtension.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getFunctions(): array
4848
/**
4949
* Returns true if the transition is enabled.
5050
*/
51-
public function canTransition(object $subject, string $transitionName, string $name = null): bool
51+
public function canTransition(object $subject, string $transitionName, ?string $name = null): bool
5252
{
5353
return $this->workflowRegistry->get($subject, $name)->can($subject, $transitionName);
5454
}
@@ -58,20 +58,20 @@ public function canTransition(object $subject, string $transitionName, string $n
5858
*
5959
* @return Transition[]
6060
*/
61-
public function getEnabledTransitions(object $subject, string $name = null): array
61+
public function getEnabledTransitions(object $subject, ?string $name = null): array
6262
{
6363
return $this->workflowRegistry->get($subject, $name)->getEnabledTransitions($subject);
6464
}
6565

66-
public function getEnabledTransition(object $subject, string $transition, string $name = null): ?Transition
66+
public function getEnabledTransition(object $subject, string $transition, ?string $name = null): ?Transition
6767
{
6868
return $this->workflowRegistry->get($subject, $name)->getEnabledTransition($subject, $transition);
6969
}
7070

7171
/**
7272
* Returns true if the place is marked.
7373
*/
74-
public function hasMarkedPlace(object $subject, string $placeName, string $name = null): bool
74+
public function hasMarkedPlace(object $subject, string $placeName, ?string $name = null): bool
7575
{
7676
return $this->workflowRegistry->get($subject, $name)->getMarking($subject)->has($placeName);
7777
}
@@ -81,7 +81,7 @@ public function hasMarkedPlace(object $subject, string $placeName, string $name
8181
*
8282
* @return string[]|int[]
8383
*/
84-
public function getMarkedPlaces(object $subject, bool $placesNameOnly = true, string $name = null): array
84+
public function getMarkedPlaces(object $subject, bool $placesNameOnly = true, ?string $name = null): array
8585
{
8686
$places = $this->workflowRegistry->get($subject, $name)->getMarking($subject)->getPlaces();
8787

@@ -99,7 +99,7 @@ public function getMarkedPlaces(object $subject, bool $placesNameOnly = true, st
9999
* Use a string (the place name) to get place metadata
100100
* Use a Transition instance to get transition metadata
101101
*/
102-
public function getMetadata(object $subject, string $key, string|Transition $metadataSubject = null, string $name = null): mixed
102+
public function getMetadata(object $subject, string $key, string|Transition|null $metadataSubject = null, ?string $name = null): mixed
103103
{
104104
return $this
105105
->workflowRegistry
@@ -109,7 +109,7 @@ public function getMetadata(object $subject, string $key, string|Transition $met
109109
;
110110
}
111111

112-
public function buildTransitionBlockerList(object $subject, string $transitionName, string $name = null): TransitionBlockerList
112+
public function buildTransitionBlockerList(object $subject, string $transitionName, ?string $name = null): TransitionBlockerList
113113
{
114114
$workflow = $this->workflowRegistry->get($subject, $name);
115115

Mime/BodyRenderer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class BodyRenderer implements BodyRendererInterface
3131
private HtmlToTextConverterInterface $converter;
3232
private ?LocaleSwitcher $localeSwitcher = null;
3333

34-
public function __construct(Environment $twig, array $context = [], HtmlToTextConverterInterface $converter = null, LocaleSwitcher $localeSwitcher = null)
34+
public function __construct(Environment $twig, array $context = [], ?HtmlToTextConverterInterface $converter = null, ?LocaleSwitcher $localeSwitcher = null)
3535
{
3636
$this->twig = $twig;
3737
$this->context = $context;

Mime/NotificationEmail.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class NotificationEmail extends TemplatedEmail
4242
];
4343
private bool $rendered = false;
4444

45-
public function __construct(Headers $headers = null, AbstractPart $body = null)
45+
public function __construct(?Headers $headers = null, ?AbstractPart $body = null)
4646
{
4747
$missingPackages = [];
4848
if (!class_exists(CssInlinerExtension::class)) {
@@ -63,7 +63,7 @@ public function __construct(Headers $headers = null, AbstractPart $body = null)
6363
/**
6464
* Creates a NotificationEmail instance that is appropriate to send to normal (non-admin) users.
6565
*/
66-
public static function asPublicEmail(Headers $headers = null, AbstractPart $body = null): self
66+
public static function asPublicEmail(?Headers $headers = null, ?AbstractPart $body = null): self
6767
{
6868
$email = new static($headers, $body);
6969
$email->markAsPublic();

Mime/WrappedTemplatedEmail.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function toName(): string
4343
* @param string|null $contentType The media type (i.e. MIME type) of the image file (e.g. 'image/png').
4444
* Some email clients require this to display embedded images.
4545
*/
46-
public function image(string $image, string $contentType = null): string
46+
public function image(string $image, ?string $contentType = null): string
4747
{
4848
$file = $this->twig->getLoader()->getSourceContext($image);
4949
$body = $file->getPath() ? new File($file->getPath()) : $file->getCode();
@@ -59,7 +59,7 @@ public function image(string $image, string $contentType = null): string
5959
* @param string|null $contentType The media type (i.e. MIME type) of the file (e.g. 'application/pdf').
6060
* Some email clients require this to display attached files.
6161
*/
62-
public function attach(string $file, string $name = null, string $contentType = null): void
62+
public function attach(string $file, ?string $name = null, ?string $contentType = null): void
6363
{
6464
$file = $this->twig->getLoader()->getSourceContext($file);
6565
$body = $file->getPath() ? new File($file->getPath()) : $file->getCode();

Node/DumpNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class DumpNode extends Node
2121
{
2222
private string $varPrefix;
2323

24-
public function __construct(string $varPrefix, ?Node $values, int $lineno, string $tag = null)
24+
public function __construct(string $varPrefix, ?Node $values, int $lineno, ?string $tag = null)
2525
{
2626
$nodes = [];
2727
if (null !== $values) {

Node/FormThemeNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
final class FormThemeNode extends Node
2222
{
23-
public function __construct(Node $form, Node $resources, int $lineno, string $tag = null, bool $only = false)
23+
public function __construct(Node $form, Node $resources, int $lineno, ?string $tag = null, bool $only = false)
2424
{
2525
parent::__construct(['form' => $form, 'resources' => $resources], ['only' => $only], $lineno, $tag);
2626
}

Node/StopwatchNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*/
2323
final class StopwatchNode extends Node
2424
{
25-
public function __construct(Node $name, Node $body, AssignNameExpression $var, int $lineno = 0, string $tag = null)
25+
public function __construct(Node $name, Node $body, AssignNameExpression $var, int $lineno = 0, ?string $tag = null)
2626
{
2727
parent::__construct(['body' => $body, 'name' => $name, 'var' => $var], [], $lineno, $tag);
2828
}

Node/TransDefaultDomainNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
final class TransDefaultDomainNode extends Node
2222
{
23-
public function __construct(AbstractExpression $expr, int $lineno = 0, string $tag = null)
23+
public function __construct(AbstractExpression $expr, int $lineno = 0, ?string $tag = null)
2424
{
2525
parent::__construct(['expr' => $expr], [], $lineno, $tag);
2626
}

Node/TransNode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
final class TransNode extends Node
2626
{
27-
public function __construct(Node $body, Node $domain = null, AbstractExpression $count = null, AbstractExpression $vars = null, AbstractExpression $locale = null, int $lineno = 0, string $tag = null)
27+
public function __construct(Node $body, ?Node $domain = null, ?AbstractExpression $count = null, ?AbstractExpression $vars = null, ?AbstractExpression $locale = null, int $lineno = 0, ?string $tag = null)
2828
{
2929
$nodes = ['body' => $body];
3030
if (null !== $domain) {

NodeVisitor/Scope.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Scope
2020
private array $data = [];
2121
private bool $left = false;
2222

23-
public function __construct(self $parent = null)
23+
public function __construct(?self $parent = null)
2424
{
2525
$this->parent = $parent;
2626
}

Tests/Command/DebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ public static function provideCompletionSuggestions(): iterable
317317
yield 'option --format' => [['--format', ''], ['text', 'json']];
318318
}
319319

320-
private function createCommandTester(array $paths = [], array $bundleMetadata = [], string $defaultPath = null, bool $useChainLoader = false, array $globals = []): CommandTester
320+
private function createCommandTester(array $paths = [], array $bundleMetadata = [], ?string $defaultPath = null, bool $useChainLoader = false, array $globals = []): CommandTester
321321
{
322322
$projectDir = \dirname(__DIR__).\DIRECTORY_SEPARATOR.'Fixtures';
323323
$loader = new FilesystemLoader([], $projectDir);

Tests/Extension/AbstractLayoutTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,7 @@ public function testHelpWithTranslatableMessage()
26722672
public function testHelpWithTranslatableInterface()
26732673
{
26742674
$message = new class() implements TranslatableInterface {
2675-
public function trans(TranslatorInterface $translator, string $locale = null): string
2675+
public function trans(TranslatorInterface $translator, ?string $locale = null): string
26762676
{
26772677
return $translator->trans('foo');
26782678
}

0 commit comments

Comments
 (0)