Skip to content

Disable error for property with #[Override] attribute#1823

Merged
kukulich merged 2 commits intoslevomat:masterfrom
kkmuffme:handle-override-public-properties
Jan 4, 2026
Merged

Disable error for property with #[Override] attribute#1823
kukulich merged 2 commits intoslevomat:masterfrom
kkmuffme:handle-override-public-properties

Conversation

@kkmuffme
Copy link
Copy Markdown
Contributor

@kkmuffme kkmuffme commented Jan 4, 2026

Since PHP 8.5 #[Override] can also be used on properties.

Fix false positive errors for:
SlevomatCodingStandard.Classes.ForbiddenPublicProperty.ForbiddenPublicProperty
SlevomatCodingStandard.TypeHints.PropertyTypeHint

This has already been fixed for SlevomatCodingStandard.TypeHints.ParameterTypeHint in cda88e6

Fix #1745 instead of with a new option by using the native attribute instead now, as this is more flexible and specific.

@kkmuffme kkmuffme force-pushed the handle-override-public-properties branch from 0888f7c to 8662d2f Compare January 4, 2026 03:49
@kkmuffme kkmuffme force-pushed the handle-override-public-properties branch from 2eb49b3 to 6273e9b Compare January 4, 2026 04:03
@kukulich
Copy link
Copy Markdown
Contributor

kukulich commented Jan 4, 2026

Thanks.

@kukulich kukulich merged commit 90b6881 into slevomat:master Jan 4, 2026
40 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.

SlevomatCodingStandard.TypeHints.ParameterTypeHint - option to disable for public/protected of classes that extend/implement

2 participants