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

[Php71] Skip already array destruct on ListToArrayDestructRector #6460

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

samsonasik
Copy link
Member

Given the following code:

<?php

namespace Rector\Tests\Php71\Rector\List_\ListToArrayDestructRector\Fixture;

final class SkipAlreadyArrayDestruct
{
    public function run($line, $file, $trace)
    {
        [
            'line' => $line,
            'file' => $file,
        ] = $trace;
    }
}

It somehow reprinted:

There was 1 failure:

1) Rector\Tests\Php71\Rector\List_\ListToArrayDestructRector\ListToArrayDestructRectorTest::test with data set #2 ('/Users/samsonasik/www/rector-...hp.inc')
Failed on fixture file "skip_already_array_destruct.php.inc"
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 {
     public function run($line, $file, $trace)
     {
-        [
-            'line' => $line,
-            'file' => $file,
-        ] = $trace;
+        ['line' => $line, 'file' => $file] = $trace;

which should be skipped. This PR try to fix it.

@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 57b9ccf into main Nov 21, 2024
36 checks passed
@samsonasik samsonasik deleted the skip-already-array-destruct branch November 21, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant