Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented Sep 24, 2025

Given the following code:

class NotZeroPosition
{
    public function go()
    {
        $this->run([], ['item1', 'item2']);
    }

    private function run(array $data, array $items)
    {
    }
}

It cause crash:

message": "System error: \"Call to a member function isNull() on null
There was 1 error:

1) Rector\Tests\TypeDeclarationDocblocks\Rector\Class_\ClassMethodArrayDocblockParamFromLocalCallsRector\ClassMethodArrayDocblockParamFromLocalCallsRectorTest::test with data set #10 ('/home/runner/work/rector-src/...hp.inc')
Error: Call to a member function isNull() on null

see https://getrector.com/demo/4e14f065-f5fc-4aa6-87c9-6579a05f4769

This PR fix it.

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @TomasVotruba

@samsonasik
Copy link
Member Author

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

@samsonasik samsonasik enabled auto-merge (squash) September 24, 2025 18:33
@samsonasik samsonasik merged commit d7c7d35 into main Sep 24, 2025
50 checks passed
@samsonasik samsonasik deleted the crash-next-empty-array branch September 24, 2025 18:33
@TomasVotruba
Copy link
Member

Great job 👍

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.

3 participants