From 4f71371fea45916fe0ae6f01d66abe0b4e583bbd Mon Sep 17 00:00:00 2001 From: Sonata CI Date: Fri, 8 Dec 2023 08:52:12 +0000 Subject: [PATCH] DevKit updates for 4.x branch (#8133) Co-authored-by: Jordi Sala Morales Co-authored-by: Vincent Langlet --- .github/workflows/test.yaml | 13 +++++++++---- rector.php | 2 -- .../CompatibleValueResolverInterface.php | 6 +++--- src/DependencyInjection/Configuration.php | 2 +- src/Route/AdminPoolLoader.php | 2 ++ tests/Form/Widget/FormChoiceWidgetTest.php | 19 +++++++------------ 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f9a7e616d4..789d563b45 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -50,13 +50,18 @@ jobs: - php-version: '8.2' dependencies: highest allowed-to-fail: false - symfony-require: 6.2.* - variant: symfony/symfony:"6.2.*" + symfony-require: 6.3.* + variant: symfony/symfony:"6.3.*" - php-version: '8.2' dependencies: highest allowed-to-fail: false - symfony-require: 6.3.* - variant: symfony/symfony:"6.3.*" + symfony-require: 6.4.* + variant: symfony/symfony:"6.4.*" + - php-version: '8.2' + dependencies: highest + allowed-to-fail: false + symfony-require: 7.0.* + variant: symfony/symfony:"7.0.*" steps: - name: Checkout diff --git a/rector.php b/rector.php index dd4380e380..2456d3ec54 100644 --- a/rector.php +++ b/rector.php @@ -19,7 +19,6 @@ use Rector\Config\RectorConfig; use Rector\Php70\Rector\FunctionLike\ExceptionHandlerTypehintRector; -use Rector\Php71\Rector\FuncCall\CountOnNullRector; use Rector\PHPUnit\CodeQuality\Rector\Class_\AddSeeTestAnnotationRector; use Rector\PHPUnit\CodeQuality\Rector\Class_\PreferPHPUnitThisCallRector; use Rector\PHPUnit\Set\PHPUnitLevelSetList; @@ -41,7 +40,6 @@ $rectorConfig->importNames(); $rectorConfig->importShortClasses(false); $rectorConfig->skip([ - CountOnNullRector::class, ExceptionHandlerTypehintRector::class, AddSeeTestAnnotationRector::class, PreferPHPUnitThisCallRector::class, diff --git a/src/ArgumentResolver/CompatibleValueResolverInterface.php b/src/ArgumentResolver/CompatibleValueResolverInterface.php index b42b1223d1..810a17e3e1 100644 --- a/src/ArgumentResolver/CompatibleValueResolverInterface.php +++ b/src/ArgumentResolver/CompatibleValueResolverInterface.php @@ -17,14 +17,14 @@ use Symfony\Component\HttpKernel\Controller\ValueResolverInterface; // TODO: Remove this interface when dropping support of Symfony < 6.2 and replace its usage with ValueResolverInterface -if (interface_exists(ValueResolverInterface::class)) { +if (interface_exists(ArgumentValueResolverInterface::class)) { /** @internal */ - interface CompatibleValueResolverInterface extends ValueResolverInterface + interface CompatibleValueResolverInterface extends ArgumentValueResolverInterface { } } else { /** @internal */ - interface CompatibleValueResolverInterface extends ArgumentValueResolverInterface + interface CompatibleValueResolverInterface extends ValueResolverInterface { } } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 0fae9659bf..8c6b9d64b0 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -173,7 +173,7 @@ final class Configuration implements ConfigurationInterface { /** - * @psalm-suppress PossiblyNullReference, UndefinedInterfaceMethod + * @psalm-suppress UndefinedInterfaceMethod * * @see https://github.com/psalm/psalm-plugin-symfony/issues/174 */ diff --git a/src/Route/AdminPoolLoader.php b/src/Route/AdminPoolLoader.php index ed4d1cfcb0..125a949e92 100644 --- a/src/Route/AdminPoolLoader.php +++ b/src/Route/AdminPoolLoader.php @@ -20,6 +20,8 @@ /** * @author Thomas Rabaix + * + * @psalm-suppress PropertyNotSetInConstructor */ final class AdminPoolLoader extends Loader { diff --git a/tests/Form/Widget/FormChoiceWidgetTest.php b/tests/Form/Widget/FormChoiceWidgetTest.php index 75057ce8d9..5247a5df43 100644 --- a/tests/Form/Widget/FormChoiceWidgetTest.php +++ b/tests/Form/Widget/FormChoiceWidgetTest.php @@ -15,7 +15,6 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormTypeInterface; -use Symfony\Component\HttpKernel\Kernel; final class FormChoiceWidgetTest extends BaseWidgetTest { @@ -41,17 +40,13 @@ public function testLabelRendering(): void $html = $this->renderWidget($choice->createView()); - if (0 !== preg_match("/7\..\../", Kernel::VERSION)) { - static::assertStringContainsString( - '
  • ', - $this->cleanHtmlWhitespace($html) - ); - } else { - static::assertStringContainsString( - '
  • ', - $this->cleanHtmlWhitespace($html) - ); - } + // TODO: Remove this adapter when dropping support for Symfony < 7. + $html = str_replace('value="0" />', 'value="0">', $html); + + static::assertStringContainsString( + '
  • ', + $this->cleanHtmlWhitespace($html) + ); } public function testDefaultValueRendering(): void