Skip to content

Deprecate RemoveEmptyTableAttributeRector - #505

Merged
TomasVotruba merged 1 commit into
mainfrom
deprecate-remove-empty-table
Aug 7, 2026
Merged

Deprecate RemoveEmptyTableAttributeRector#505
TomasVotruba merged 1 commit into
mainfrom
deprecate-remove-empty-table

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Removing an empty #[ORM\Table] has no effect on the mapping — Doctrine derives the table name from the entity class either way. So the rule only produces diff noise, and the reader of the result is left wondering where the table mapping went.

 use Doctrine\ORM\Mapping as ORM;

-#[ORM\Table]
 #[ORM\Entity]
 class Product
 {
 }

Keeping the explicit attribute is a valid style choice, so this is not something a shared code-quality set should force.

The rule is removed from the doctrine-code-quality set and now throws on use, like the other deprecated rules.

Removing an empty #[ORM\Table] has no effect on the mapping, so the rule only
produces noise in the diff and can leave the reader wondering where the table
mapping went. Keeping the explicit attribute is a valid style choice.
@TomasVotruba
TomasVotruba merged commit b73966d into main Aug 7, 2026
7 checks passed
@TomasVotruba
TomasVotruba deleted the deprecate-remove-empty-table branch August 7, 2026 09:40
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