Skip to content

Add DowngradeDeprecatedAttributeRector - #393

Merged
TomasVotruba merged 1 commit into
mainfrom
downgrade-deprecated-attribute
Aug 29, 2026
Merged

Add DowngradeDeprecatedAttributeRector#393
TomasVotruba merged 1 commit into
mainfrom
downgrade-deprecated-attribute

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Aug 29, 2026

Copy link
Copy Markdown
Member

New downgrade rule for PHP 8.4 #[\Deprecated] attribute.

Flips the attribute to a @deprecated annotation, docblock-way:

 #[\Deprecated(message: 'use someOtherMethod() instead', since: '1.5')]
 public function someMethod(): void
 {
 }

into:

 /**
  * @deprecated 1.5 use someOtherMethod() instead
  */
 public function someMethod(): void
 {
 }
  • Handles methods, functions, class constants and enum cases.
  • Reads message and since args (named or positional); multiline heredoc messages are collapsed to a single line.
  • Registered in the downgrade-php84.php set.

@TomasVotruba
TomasVotruba merged commit 3b4122f into main Aug 29, 2026
9 checks passed
@TomasVotruba
TomasVotruba deleted the downgrade-deprecated-attribute branch August 29, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant