Skip to content

Move isOffsetAccessLegal to MaybeOffsetAccessibleTypeTrait#4205

Merged
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
VincentLanglet:refactorOffsetLegal
Aug 5, 2025
Merged

Move isOffsetAccessLegal to MaybeOffsetAccessibleTypeTrait#4205
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
VincentLanglet:refactorOffsetLegal

Conversation

@VincentLanglet
Copy link
Contributor

Is there a reason for not having this offset-related method in the MaybeOffsetAccessibleTypeTrait when all the implementation returns maybe (?)

@ondrejmirtes
Copy link
Member

I'm fine with this, although I'm not a fan of these traits at all.

I can tolerate them, but I'd really like some custom rules around them (like that if a class is using the trait, it has to use the whole trait and not override any of its methods).

@ondrejmirtes ondrejmirtes merged commit 605b7a6 into phpstan:2.1.x Aug 5, 2025
438 of 447 checks passed
@ondrejmirtes
Copy link
Member

Thank you.

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