Skip to content

Add InheritsVisibleProperty for parent property visibility lookup - #9

Merged
TomasVotruba merged 1 commit into
mainfrom
add-inherits-visible-property
Oct 15, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
add-inherits-visible-property

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Mirrors InheritsVisibleMethod for properties: walks a class's parent chain and reports whether an ancestor declares a given property protected or public - the visibilities PHP forbids a subclass redeclaration from reducing below.

The registry now records each property's declared visibility (plain declarations and constructor-promoted parameters), so a consumer can tell whether narrowing a property to private would break the inheritance constraint.

Enables a privatize-final-class-protected-properties rule in reco, the property counterpart to the existing protected-methods rule.

@TomasVotruba
TomasVotruba merged commit 662f670 into main Oct 15, 2026
5 checks passed
@TomasVotruba
TomasVotruba deleted the add-inherits-visible-property branch October 15, 2026 10:48
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