diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 312ac8b..f574dbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,7 @@ jobs: strategy: max-parallel: 15 matrix: - php-versions: ['8.2', '8.3', '8.4'] + php-versions: ['8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout uses: actions/checkout@v5 diff --git a/src/Bridge/EasyAdmin/src/Form/Type/MediaChoiceType.php b/src/Bridge/EasyAdmin/src/Form/Type/MediaChoiceType.php index 25be90d..90ec8ac 100644 --- a/src/Bridge/EasyAdmin/src/Form/Type/MediaChoiceType.php +++ b/src/Bridge/EasyAdmin/src/Form/Type/MediaChoiceType.php @@ -23,11 +23,8 @@ public function __construct( ) { } - /** - * @return string - */ #[\Override] - public function getParent() + public function getParent(): string { return TextType::class; } @@ -37,10 +34,7 @@ public function getName(): string return 'media_choice'; } - /** - * @return string - */ - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'joli_media_easy_admin_choice'; } diff --git a/src/Bridge/SonataAdmin/src/Form/Type/MediaChoiceType.php b/src/Bridge/SonataAdmin/src/Form/Type/MediaChoiceType.php index d4b0d6f..c787b2a 100644 --- a/src/Bridge/SonataAdmin/src/Form/Type/MediaChoiceType.php +++ b/src/Bridge/SonataAdmin/src/Form/Type/MediaChoiceType.php @@ -23,11 +23,8 @@ public function __construct( ) { } - /** - * @return string - */ #[\Override] - public function getParent() + public function getParent(): string { return TextType::class; } @@ -37,10 +34,7 @@ public function getName(): string return 'media_choice'; } - /** - * @return string - */ - public function getBlockPrefix() + public function getBlockPrefix(): string { return 'joli_media_sonata_admin_choice'; } diff --git a/tests/src/Twig/Component/PictureTest.php b/tests/src/Twig/Component/PictureTest.php index 9b0c74c..9bdcac0 100644 --- a/tests/src/Twig/Component/PictureTest.php +++ b/tests/src/Twig/Component/PictureTest.php @@ -106,6 +106,13 @@ public function testComponents(string $component, array $configuration, string $ $img = $crawler->filterXPath('//body/*')->first(); $html = preg_replace(['/(\n\s*)+/', '/\s+/'], ['', ' '], $img->outerHtml()); + // @phpstan-ignore-next-line + if (Kernel::MAJOR_VERSION < 8 && !(Kernel::MAJOR_VERSION === 7 && Kernel::MINOR_VERSION === 4 && \PHP_VERSION_ID >= 80400)) { + // Since Symfony 7.4 with PHP 8.4, the native HTML5 parser is used unconditionally + $expected = str_replace('', '', $expected); + $expected = str_replace('>', '>', $expected); + } + if ($expected !== $html) { echo "\n\n" . $html . "\n\n"; } @@ -125,7 +132,7 @@ public static function provideComponentsData(): \Generator 'variation' => 'variation-standard', 'alt' => 'Alternative text', ], - 'Alternative text', + 'Alternative text', ]; yield 'partial-picture-tag' => [ Picture::class, @@ -134,7 +141,7 @@ public static function provideComponentsData(): \Generator 'variation' => 'variation-standard', 'alt' => 'Alternative text', ], - 'Alternative text', + 'Alternative text', ]; yield 'picture-with-class' => [ Picture::class, @@ -145,7 +152,7 @@ public static function provideComponentsData(): \Generator 'picture:class' => 'picture-class', 'img:class' => 'img-class', ], - 'Alternative text', + 'Alternative text', ]; yield 'picture-with-sources' => [ Picture::class, @@ -157,7 +164,7 @@ public static function provideComponentsData(): \Generator 'img:class' => 'img-class', 'sources' => ['variation-standard', 'variation-large'], ], - 'Alternative text', + 'Alternative text', ]; yield 'picture-with-sources-and-skipAutoDimensions' => [ Picture::class, @@ -170,7 +177,7 @@ public static function provideComponentsData(): \Generator 'sources' => ['variation-standard', 'variation-large'], 'skipAutoDimensions' => true, ], - 'Alternative text', + 'Alternative text', ]; yield 'partial-picture-with-sources' => [ Picture::class, @@ -182,7 +189,7 @@ public static function provideComponentsData(): \Generator 'img:class' => 'img-class', 'sources' => ['variation-standard', 'variation-large'], ], - 'Alternative text', + 'Alternative text', ]; yield 'partial-picture-with-sources-and-skipAutoDimensions' => [ Picture::class, @@ -195,7 +202,7 @@ public static function provideComponentsData(): \Generator 'sources' => ['variation-standard', 'variation-large'], 'skipAutoDimensions' => true, ], - 'Alternative text', + 'Alternative text', ]; yield 'auto-generate-partial-picture-with-sources' => [ Picture::class, @@ -208,7 +215,7 @@ public static function provideComponentsData(): \Generator 'img:class' => 'img-class', 'sources' => ['variation-standard'], ], - 'Alternative text', + 'Alternative text', ]; yield 'picture-with-media-and-string-srcset' => [ Picture::class, @@ -226,7 +233,7 @@ public static function provideComponentsData(): \Generator 'srcset' => 'variation-large', ]], ], - 'Alternative text', + 'Alternative text', ]; yield 'picture-with-sources-and-media' => [ Picture::class, @@ -252,7 +259,7 @@ public static function provideComponentsData(): \Generator ], ]], ], - 'Alternative text', + 'Alternative text', ]; yield 'partial-picture-with-sources-and-media' => [ Picture::class, @@ -278,7 +285,7 @@ public static function provideComponentsData(): \Generator ], ]], ], - 'Alternative text', + 'Alternative text', ]; }