diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 5d28c145..bfb9fd71 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -19,4 +19,4 @@ jobs: - name: PHP-CS-Fixer uses: docker://jakzal/phpqa:php8.0 with: - args: php-cs-fixer fix --config=.php_cs.dist.php --dry-run + args: php-cs-fixer fix --config=.php_cs.dist.php --dry-run --diff diff --git a/composer.json b/composer.json index 0d4200f2..4be49cb7 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", "symfony/form": "^4.4|^5.3|^6.0", + "symfony/phpunit-bridge": "^6.2", "symfony/property-access": "^4.4|^5.3|^6.0", "symfony/serializer": "^4.4|^5.3|^6.0.1", "symfony/twig-bundle": "^4.4|^5.3|^6.0", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6bb3cb6f..3f252c42 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,9 @@ + + + tests @@ -11,4 +14,7 @@ src + + + diff --git a/src/Serializer/Normalizer/PhoneNumberNormalizer.php b/src/Serializer/Normalizer/PhoneNumberNormalizer.php index 4b35bda8..bb6edf09 100644 --- a/src/Serializer/Normalizer/PhoneNumberNormalizer.php +++ b/src/Serializer/Normalizer/PhoneNumberNormalizer.php @@ -101,6 +101,14 @@ public function denormalize($data, $class, $format = null, array $context = []): */ public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { - return 'libphonenumber\PhoneNumber' === $type && \is_string($data); + return PhoneNumber::class === $type && \is_string($data); + } + + /** + * for symfony/serializer >= 6.3. + */ + public function getSupportedTypes(?string $format): array + { + return [PhoneNumber::class => false]; } }