Skip to content

[symfony42] Rector\Symfony\Rector\New_\StringToArrayArgumentProcessRector applies on classes it shouldn't (like FormTypes and tests) #2055

@gnutix

Description

@gnutix
Subject Details
PHP version PHP 7.3.9-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Sep 2 2019 12:54:24) ( NTS )
Full Command vendor/bin/rector --ansi --dry-run --debug process src

Running 0.5.13 on our entire codebase applies the following unexpected changes :

124) src/Form/SomeFormType.php

    ---------- begin diff ----------
--- Original
+++ New
@@ -18,7 +18,7 @@
     public function buildForm(FormBuilderInterface $builder, array $options): void
     {
         $builder
-            ->add('q', TextType::class, [
+            ->add(['q'], TextType::class, [
    ----------- end diff -----------

127) tests/Functional/Page/PageControllerTest.php

    ---------- begin diff ----------
--- Original
+++ New
@@ -93,7 +93,7 @@
-            static::assertGreaterThan(1, $crawler->filter('tbody tr')->count());
+            static::assertGreaterThan(1, $crawler->filter(['tbody', 'tr'])->count());
    ----------- end diff -----------

Applied rectors:

 * Rector\Symfony\Rector\New_\StringToArrayArgumentProcessRector

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions