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

added symfony 7.x compatibility and drop outdated symfony support #32

Merged
merged 1 commit into from
Nov 30, 2023
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
11 changes: 6 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ jobs:
strategy:
matrix:
include:
- php: 8.2
- php: 8.2
composer-dependencies: symfony/symfony:^7
- php: 8.1
- php: 8.1
composer-dependencies: symfony/symfony:^6
- php: 8.1
- php: 8.0
- php: 7.4
- php: 7.4
composer-dependencies: symfony/symfony:^5
- php: 7.4
composer-dependencies: symfony/symfony:^4
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
],
"require": {
"php": "^7.4.0 || ^8.0.0",
"symfony/http-foundation": "^4.4.7 || ^5.0.7 || ^6.0",
"symfony/mime": "^4.3.8 || ^5.0 || ^6.0"
"symfony/http-foundation": "^5.4 || ^6.0 || ^7.0",
"symfony/mime": "^5.4 || ^6.0 || ^7.0"
},
"require-dev": {
"symfony/form": "^4.0 || ^5.0 || ^6.0",
"symfony/serializer": "^4.0 || ^5.0 || ^6.0",
"symfony/form": "^5.4 || ^6.0 || ^7.0",
"symfony/serializer": "^5.4 || ^6.0 || ^7.0",
"phpunit/phpunit": "^9.0.0",
"symfony/dependency-injection": "^4.0 || ^5.0 || ^6.0",
"symfony/config": "^4.0 || ^5.0 || ^6.0",
"symfony/http-kernel": "^4.0 || ^5.0 || ^6.0"
"symfony/dependency-injection": "^5.4 || ^6.0 || ^7.0",
"symfony/config": "^5.4 || ^6.0 || ^7.0",
"symfony/http-kernel": "^5.4 || ^6.0 || ^7.0"
},
"suggest": {
"symfony/form": "to use base64_encoded_file type",
Expand All @@ -43,7 +43,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "4.x-dev"
"dev-master": "5.x-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct($strict = true)
/**
* {@inheritdoc}
*/
public function transform($value)
public function transform(mixed $value): mixed
{
if (! $value instanceof \SplFileInfo) {
return '';
Expand All @@ -45,7 +45,7 @@ public function transform($value)
/**
* {@inheritdoc}
*/
public function reverseTransform($value)
public function reverseTransform(mixed $value): mixed
{
if (empty($value)) {
return null;
Expand Down
11 changes: 9 additions & 2 deletions src/Serializer/Base64EncodedFileNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,20 @@
*/
final class Base64EncodedFileNormalizer implements DenormalizerInterface
{
public function denormalize($data, $class, $format = null, array $context = array())
public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed
{
return new Base64EncodedFile($data);
}

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

public function getSupportedTypes(?string $format): array
{
return [
'*' => true,
];
}
}
Loading