Skip to content

Feat: missing console attribute rectors#509

Merged
peterfox merged 10 commits into
driftingly:mainfrom
MrPunyapal:feat/console-attribute-rectors
May 21, 2026
Merged

Feat: missing console attribute rectors#509
peterfox merged 10 commits into
driftingly:mainfrom
MrPunyapal:feat/console-attribute-rectors

Conversation

@MrPunyapal
Copy link
Copy Markdown
Contributor

PR Description: feat/console-attribute-rectors

Rules Added

  • SignaturePropertyToSignatureAttributeRector
  • DescriptionPropertyToDescriptionAttributeRector
  • AliasesPropertyToAliasesAttributeRector
  • HelpPropertyToHelpAttributeRector
  • CommandHiddenPropertyToHiddenAttributeRector

Before/After

SignaturePropertyToSignatureAttributeRector

Before:

use Illuminate\Console\Command;

class SendMailCommand extends Command
{
    protected $signature = 'mail:send {user}';
}

After:

use Illuminate\Console\Attributes\Signature;
use Illuminate\Console\Command;

#[Signature('mail:send {user}')]
class SendMailCommand extends Command
{
}

DescriptionPropertyToDescriptionAttributeRector

Before:

use Illuminate\Console\Command;

class SendMailCommand extends Command
{
    protected $description = 'Send email to a user';
}

After:

use Illuminate\Console\Attributes\Description;
use Illuminate\Console\Command;

#[Description('Send email to a user')]
class SendMailCommand extends Command
{
}

AliasesPropertyToAliasesAttributeRector

Before:

use Illuminate\Console\Command;

class SendMailCommand extends Command
{
    protected $aliases = ['mail:dispatch', 'mail:go'];
}

After:

use Illuminate\Console\Attributes\Aliases;
use Illuminate\Console\Command;

#[Aliases(['mail:dispatch', 'mail:go'])]
class SendMailCommand extends Command
{
}

HelpPropertyToHelpAttributeRector

Before:

use Illuminate\Console\Command;

class SendMailCommand extends Command
{
    protected $help = 'Use this command to send emails manually.';
}

After:

use Illuminate\Console\Attributes\Help;
use Illuminate\Console\Command;

#[Help('Use this command to send emails manually.')]
class SendMailCommand extends Command
{
}

CommandHiddenPropertyToHiddenAttributeRector

Before:

use Illuminate\Console\Command;

class InternalCommand extends Command
{
    protected $hidden = true;
}

After:

use Illuminate\Console\Attributes\Hidden;
use Illuminate\Console\Command;

#[Hidden]
class InternalCommand extends Command
{
}

Comment thread src/Rector/Class_/AliasesPropertyToAliasesAttributeRector.php Outdated
MrPunyapal and others added 3 commits May 20, 2026 22:50
@MrPunyapal MrPunyapal requested a review from peterfox May 20, 2026 17:28
@peterfox peterfox merged commit 0ee7c1c into driftingly:main May 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants