Skip to content

CommandConfigureToAttributeRector does not check for dynamic values #9862

Description

@Jean85

Bug Report

Subject Details
Rector version last dev-main, tested also with last stable (2.6.3)
Installed as composer dependency

Minimal PHP Code Causing Issue

See https://getrector.com/demo/f8dfec20-c300-4c89-8aca-356997ac7ef9

<?php

use Symfony\Component\Console\Command\Command;

class ExampleCommand extends Command
{
    public function __construct(private readonly string $description) {}
    
    public function configure(): void
    {
        $this->setDescription($this->description);
    }
}

Responsible rules

  • CommandConfigureToAttributeRector

Expected Behavior

No change expected, because $this->description is a dynamic value and cannot be passed to an attribute.
I've already opened #1054 with this example as a fixture.

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