Skip to content

Incorrect behavior of NullToStrictStringFuncCallArgRector #9284

@calebdw

Description

@calebdw

Bug Report

Hello!

For some reason, this rule seems to be double and even triple casting

Subject Details
Rector version last dev-main
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/fe8e0dea-bc72-4d91-9ba4-9c0dcd2734c5

<?php

final class DemoFile
{
    public function run()
    {
        return $relpath
            . '/' . rawurlencode((string) $this->Get('account_code') ?: $this->Get('customer_id'));
    }

    public function Get($fieldname)
    {
        return $this->{$fieldname} ?? null;
    }
}

Responsible rules

  • NullToStrictStringFuncCallArgRector

Expected Behavior

there should be no change

Thanks!

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