Skip to content

ThrowWithPreviousExceptionRector not using named argument for code #8698

@nikolicaleksa

Description

@nikolicaleksa

Bug Report

Subject Details
Rector version last dev-main

See https://getrector.com/demo/8bb41109-893d-4232-a54d-d7b4d24eaba5

<?php

namespace Rector\Tests\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector\Fixture;

use LogicException;

class NamedArgumentForMessageAndPrevious
{
    public function run()
    {
        try {
            $this->run();
        }catch(\Throwable $throwable) {
            throw new LogicException(message: 'Some exception', previous: $throwable);
        }
    }
}

?>

Expected Behaviour

Rector should add code argument as a named argument

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