Skip to content

[AddParamTypeBasedOnPHPUnitDataProviderRector] nested data providers #9050

Closed
rectorphp/rector-src
#6772
@grandmaster44

Description

@grandmaster44

Bug Report

Subject Details
Rector version 2.0.10

System error: "Look at "Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeBasedOnPHPUnitDataProviderRector::resolveParamOnPositionTypes()"255

ShouldNotHappenException

Minimal PHP Code Causing Issue

https://getrector.com/demo/acd2d1bf-a3ae-4e80-af57-290cafee7d2a

Expected Behaviour

Rule should add param type:

use PHPUnit\Framework\TestCase;

class SomeTest extends TestCase
{
    /**
     * @dataProvider dataProvider
     */
    public function testSomething(int $number)
    {
    }

    public function dataProvider()
    {
        return [
            1234
        ];
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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