Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Add tests on PHP8.4 #2169

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.3']
php-version: ['8.1', '8.3', '8.4']
include:
- php-version: '8.1'
dependency-version: 'lowest'
- php-version: '8.3'
dependency-version: 'highest'
- php-version: '8.4'
dependency-version: 'highest'
component: ${{ fromJson(needs.tests-php-components.outputs.components )}}
exclude:
- component: Map # does not support PHP 8.1
Expand Down Expand Up @@ -141,5 +143,5 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn --immutable
- run: yarn playwright install
- run: yarn playwright install
- run: yarn test
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,24 @@ public function __construct(private ManagerRegistry $doctrine)
{
}

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

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

public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
return Entity2::class === $type;
}

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

public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof Entity2;
}
Expand Down
14 changes: 7 additions & 7 deletions src/LiveComponent/tests/Fixtures/Serializer/MoneyNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,27 @@

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

public function supportsDenormalization(mixed $data, string $type, string $format = null, array $context = []): bool
public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool
{
return Money::class === $type;
}

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

public function supportsNormalization(mixed $data, string $format = null, array $context = []): bool
public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
{
return $data instanceof Money;
}

public function getSupportedTypes(string $format = null): array
public function getSupportedTypes(?string $format = null): array
{
return [Money::class => true];
}
Expand Down