Skip to content

Incorrect behavior of ScalarArgumentToExpectedParamTypeRector when named arguments are used #9353

@dczech

Description

@dczech

Bug Report

Subject Details
Rector version 2.1.6
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/090acb81-a17d-496e-b74d-e02e4b3512cd

<?php
use PHPUnit\Framework\TestCase;

final class DemoTest extends TestCase
{
    public function testSomething()
    {
        self::assertJsonResponse(contentType: 'text/html');
    }

    protected static function assertJsonResponse(int $statusCode = 200, string $contentType = 'application/json'): void
    {
		// logic
    }
}

Responsible rules

  • ScalarArgumentToExpectedParamTypeRector

Expected Behavior

The code is valid and needs no change.

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