Skip to content

Commit 7c244fb

Browse files
committed
minor #2169 [CI] Add tests on PHP8.4 (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [CI] Add tests on PHP8.4 Replaces #2078 Commits ------- 8510b65 [CI] Add tests on PHP8.4
2 parents f719d65 + 8510b65 commit 7c244fb

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,14 @@ jobs:
8181
strategy:
8282
fail-fast: false
8383
matrix:
84-
php-version: ['8.1', '8.3']
84+
php-version: ['8.1', '8.3', '8.4']
8585
include:
8686
- php-version: '8.1'
8787
dependency-version: 'lowest'
8888
- php-version: '8.3'
8989
dependency-version: 'highest'
90+
- php-version: '8.4'
91+
dependency-version: 'highest'
9092
component: ${{ fromJson(needs.tests-php-components.outputs.components )}}
9193
exclude:
9294
- component: Map # does not support PHP 8.1
@@ -141,5 +143,5 @@ jobs:
141143
restore-keys: |
142144
${{ runner.os }}-yarn-
143145
- run: yarn --immutable
144-
- run: yarn playwright install
146+
- run: yarn playwright install
145147
- run: yarn test

src/LiveComponent/tests/Fixtures/Serializer/Entity2Normalizer.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@ public function __construct(private ManagerRegistry $doctrine)
2525
{
2626
}
2727

28-
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): mixed
28+
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
2929
{
30-
[, $id] = \explode(':', $data);
30+
[, $id] = explode(':', $data);
3131

3232
return $this->doctrine->getRepository(Entity2::class)->find($id);
3333
}
3434

35-
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
35+
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
3636
{
3737
return Entity2::class === $type;
3838
}
3939

40-
public function normalize(mixed $object, string $format = null, array $context = []): float|array|\ArrayObject|bool|int|string|null
40+
public function normalize(mixed $object, ?string $format = null, array $context = []): float|array|\ArrayObject|bool|int|string|null
4141
{
4242
return 'entity2:'.$object->id;
4343
}
4444

45-
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
45+
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
4646
{
4747
return $data instanceof Entity2;
4848
}

src/LiveComponent/tests/Fixtures/Serializer/MoneyNormalizer.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@
1717

1818
final class MoneyNormalizer implements NormalizerInterface, DenormalizerInterface
1919
{
20-
public function denormalize(mixed $data, string $type, string $format = null, array $context = []): Money
20+
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): Money
2121
{
22-
return new Money(...\explode('|', $data));
22+
return new Money(...explode('|', $data));
2323
}
2424

25-
public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
25+
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
2626
{
2727
return Money::class === $type;
2828
}
2929

30-
public function normalize(mixed $object, string $format = null, array $context = []): float|array|\ArrayObject|bool|int|string|null
30+
public function normalize(mixed $object, ?string $format = null, array $context = []): float|array|\ArrayObject|bool|int|string|null
3131
{
32-
return \implode('|', [$object->amount, $object->currency]);
32+
return implode('|', [$object->amount, $object->currency]);
3333
}
3434

35-
public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
35+
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
3636
{
3737
return $data instanceof Money;
3838
}
3939

40-
public function getSupportedTypes(string $format = null): array
40+
public function getSupportedTypes(?string $format = null): array
4141
{
4242
return [Money::class => true];
4343
}

0 commit comments

Comments
 (0)