Skip to content

Commit e4024d1

Browse files
committed
minor: update cs
1 parent ab8710f commit e4024d1

12 files changed

+19
-19
lines changed

src/Attribute/AsLiveComponent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ final class AsLiveComponent extends AsTwigComponent
3737
* @param int $urlReferenceType Which type of URL should be generated for the given route. Use the constants from UrlGeneratorInterface (default: absolute path, e.g. "/dir/file").
3838
*/
3939
public function __construct(
40-
string $name = null,
41-
string $template = null,
40+
?string $name = null,
41+
?string $template = null,
4242
private ?string $defaultAction = null,
4343
bool $exposePublicProps = true,
4444
string $attributesVar = 'attributes',

src/Attribute/LiveProp.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function __construct(
9696
*
9797
* @var string|string[]|null
9898
*/
99-
private null|string|array $onUpdated = null,
99+
private string|array|null $onUpdated = null,
100100

101101
/**
102102
* If true, this property will be synchronized with a query parameter
@@ -193,7 +193,7 @@ public function acceptUpdatesFromParent(): bool
193193
return $this->updateFromParent;
194194
}
195195

196-
public function onUpdated(): null|string|array
196+
public function onUpdated(): string|array|null
197197
{
198198
return $this->onUpdated;
199199
}

src/ComponentToolsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public function setLiveResponder(LiveResponder $liveResponder): void
3333
$this->liveResponder = $liveResponder;
3434
}
3535

36-
public function emit(string $eventName, array $data = [], string $componentName = null): void
36+
public function emit(string $eventName, array $data = [], ?string $componentName = null): void
3737
{
3838
$this->liveResponder->emit($eventName, $data, $componentName);
3939
}
4040

41-
public function emitUp(string $eventName, array $data = [], string $componentName = null): void
41+
public function emitUp(string $eventName, array $data = [], ?string $componentName = null): void
4242
{
4343
$this->liveResponder->emitUp($eventName, $data, $componentName);
4444
}

src/LiveResponder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class LiveResponder
2828
*/
2929
private array $browserEventsToDispatch = [];
3030

31-
public function emit(string $eventName, array $data = [], string $componentName = null): void
31+
public function emit(string $eventName, array $data = [], ?string $componentName = null): void
3232
{
3333
$this->eventsToEmit[] = [
3434
'event' => $eventName,
@@ -38,7 +38,7 @@ public function emit(string $eventName, array $data = [], string $componentName
3838
];
3939
}
4040

41-
public function emitUp(string $eventName, array $data = [], string $componentName = null): void
41+
public function emitUp(string $eventName, array $data = [], ?string $componentName = null): void
4242
{
4343
$this->eventsToEmit[] = [
4444
'event' => $eventName,

src/Metadata/LivePropMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function getFormat(): ?string
112112
return $this->liveProp->format();
113113
}
114114

115-
public function onUpdated(): null|string|array
115+
public function onUpdated(): string|array|null
116116
{
117117
return $this->liveProp->onUpdated();
118118
}

src/Test/InteractsWithLiveComponents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
trait InteractsWithLiveComponents
2222
{
23-
protected function createLiveComponent(string $name, array $data = [], KernelBrowser $client = null): TestLiveComponent
23+
protected function createLiveComponent(string $name, array $data = [], ?KernelBrowser $client = null): TestLiveComponent
2424
{
2525
if (!$this instanceof KernelTestCase) {
2626
throw new \LogicException(sprintf('The "%s" trait can only be used on "%s" classes.', __TRAIT__, KernelTestCase::class));

src/Test/TestLiveComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function response(): Response
148148
return $this->client->getResponse();
149149
}
150150

151-
private function request(array $content = [], string $action = null): self
151+
private function request(array $content = [], ?string $action = null): self
152152
{
153153
$csrfToken = $this->csrfToken();
154154

src/Twig/DeterministicTwigIdCalculator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DeterministicTwigIdCalculator
4141
* @param bool $increment Whether to increment the counter for this file+line
4242
* @param string|null $key An optional key to use instead of the incremented counter
4343
*/
44-
public function calculateDeterministicId(bool $increment = true, string $key = null): string
44+
public function calculateDeterministicId(bool $increment = true, ?string $key = null): string
4545
{
4646
$lineData = $this->guessTemplateInfo();
4747

src/Twig/TemplateCacheWarmer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(private \IteratorAggregate $templateIterator, privat
2626
{
2727
}
2828

29-
public function warmUp(string $cacheDir, string $buildDir = null): array
29+
public function warmUp(string $cacheDir, ?string $buildDir = null): array
3030
{
3131
$map = [];
3232
foreach ($this->templateIterator as $item) {

src/Util/LiveControllerAttributesCreator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(
5656
* Calculates the array of extra attributes that should be added to the root
5757
* component element to activate the live controller functionality.
5858
*/
59-
public function attributesForRendering(MountedComponent $mounted, ComponentMetadata $metadata, bool $isChildComponent, string $deterministicId = null): LiveAttributesCollection
59+
public function attributesForRendering(MountedComponent $mounted, ComponentMetadata $metadata, bool $isChildComponent, ?string $deterministicId = null): LiveAttributesCollection
6060
{
6161
$attributesCollection = $this->attributeHelper->create();
6262
$attributesCollection->setLiveController($mounted->getName());

tests/Functional/Form/ComponentWithFormTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function testHandleCheckboxChanges(): void
193193
],
194194
], $dehydratedProps['form']);
195195

196-
$getUrl = function (array $props, array $updatedProps = null) {
196+
$getUrl = function (array $props, ?array $updatedProps = null) {
197197
$url = '/_components/form_with_many_different_fields_type?props='.urlencode(json_encode($props));
198198
if (null !== $updatedProps) {
199199
$url .= '&updated='.urlencode(json_encode($updatedProps));

tests/Integration/LiveComponentHydratorTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ final class LiveComponentHydratorTest extends KernelTestCase
5252
use LiveComponentTestHelper;
5353
use ResetDatabase;
5454

55-
private function executeHydrationTestCase(callable $testFactory, int $minPhpVersion = null): void
55+
private function executeHydrationTestCase(callable $testFactory, ?int $minPhpVersion = null): void
5656
{
5757
if (null !== $minPhpVersion && $minPhpVersion > \PHP_VERSION_ID) {
5858
$this->markTestSkipped(sprintf('Test requires PHP version %s or higher.', $minPhpVersion));
@@ -140,7 +140,7 @@ private function executeHydrationTestCase(callable $testFactory, int $minPhpVers
140140
/**
141141
* @dataProvider provideDehydrationHydrationTests
142142
*/
143-
public function testCanDehydrateAndHydrateComponentWithTestCases(callable $testFactory, int $minPhpVersion = null): void
143+
public function testCanDehydrateAndHydrateComponentWithTestCases(callable $testFactory, ?int $minPhpVersion = null): void
144144
{
145145
$this->executeHydrationTestCase($testFactory, $minPhpVersion);
146146
}
@@ -1199,7 +1199,7 @@ public function __construct()
11991199
/**
12001200
* @dataProvider provideInvalidHydrationTests
12011201
*/
1202-
public function testInvalidTypeHydration(callable $testFactory, int $minPhpVersion = null): void
1202+
public function testInvalidTypeHydration(callable $testFactory, ?int $minPhpVersion = null): void
12031203
{
12041204
$this->executeHydrationTestCase($testFactory, $minPhpVersion);
12051205
}
@@ -1614,7 +1614,7 @@ public function getTest(LiveComponentMetadataFactory $metadataFactory): Hydratio
16141614
);
16151615
}
16161616

1617-
public function expectsExceptionDuringHydration(string $exceptionClass, string $exceptionMessage = null): self
1617+
public function expectsExceptionDuringHydration(string $exceptionClass, ?string $exceptionMessage = null): self
16181618
{
16191619
$this->expectedHydrationException = $exceptionClass;
16201620
$this->expectHydrationExceptionMessage = $exceptionMessage;

0 commit comments

Comments
 (0)