Skip to content

Commit

Permalink
minor #1453 CS Update (kbond)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.x branch.

Discussion
----------

CS Update

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Issues        | n/a
| License       | MIT

Updates to the latest Symfony CS rules.

Refs: PHP-CS-Fixer/PHP-CS-Fixer#7773 & symfony/symfony#53612

Commits
-------

aad4e17d minor: update cs
  • Loading branch information
weaverryan committed Feb 7, 2024
2 parents 01a83eb + e76dad8 commit 8c5ebcb
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Command/TwigComponentDebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(
private ComponentFactory $componentFactory,
private Environment $twig,
private readonly array $componentClassMap,
string $anonymousDirectory = null,
?string $anonymousDirectory = null,
) {
parent::__construct();
$this->anonymousDirectory = $anonymousDirectory ?? 'components';
Expand Down
2 changes: 1 addition & 1 deletion src/DataCollector/TwigComponentDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
$this->hasStub = class_exists(ClassStub::class);
}

public function collect(Request $request, Response $response, \Throwable $exception = null): void
public function collect(Request $request, Response $response, ?\Throwable $exception = null): void
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Event/PreRenderEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getTemplate(): string
/**
* Change the twig template used.
*/
public function setTemplate(string $template, int $index = null): self
public function setTemplate(string $template, ?int $index = null): self
{
$this->template = $template;
$this->templateIndex = $index;
Expand Down
2 changes: 1 addition & 1 deletion src/Test/InteractsWithTwigComponents.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function mountTwigComponent(string $name, array $data = []): object
/**
* @param array<string,string> $blocks
*/
protected function renderTwigComponent(string $name, array $data = [], string $content = null, array $blocks = []): RenderedComponent
protected function renderTwigComponent(string $name, array $data = [], ?string $content = null, array $blocks = []): RenderedComponent
{
if (!$this instanceof KernelTestCase) {
throw new \LogicException(sprintf('The "%s" trait can only be used on "%s" classes.', __TRAIT__, KernelTestCase::class));
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/PropsNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
class PropsNode extends Node
{
public function __construct(array $propsNames, array $values, $lineno = 0, string $tag = null)
public function __construct(array $propsNames, array $values, $lineno = 0, ?string $tag = null)
{
parent::__construct($values, ['names' => $propsNames], $lineno, $tag);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Twig/TwigPreLexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function preLexComponents(string $input): string
return $output;
}

private function consumeComponentName(string $customExceptionMessage = null): string
private function consumeComponentName(?string $customExceptionMessage = null): string
{
$start = $this->position;
while ($this->position < $this->length && preg_match('/[A-Za-z0-9_:@\-.]/', $this->input[$this->position])) {
Expand Down

0 comments on commit 8c5ebcb

Please sign in to comment.