Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support $foo::BAR where $foo is declared as class-string<Foo> #186

Merged
merged 1 commit into from
Apr 25, 2023
Merged

Support $foo::BAR where $foo is declared as class-string<Foo> #186

merged 1 commit into from
Apr 25, 2023

Conversation

eithed
Copy link
Contributor

@eithed eithed commented Apr 24, 2023

As discussed in #185:

This PR will:

  • update ClassConstantUsages rule to not fail when accessing constant on class-string that can be resolved to appropriate class

Fixes #44 (partly, not the general class-string case)

@eithed eithed marked this pull request as ready for review April 24, 2023 20:20
Fixes #44 (partly, not the general `class-string` case)
@spaze spaze changed the title update constant use rule Support $foo::BAR where $foo is declared as class-string<Foo> Apr 25, 2023
Copy link
Owner

@spaze spaze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have kept the current test with the $tz::UTC constant and added yours as a new test to make sure that your fix stays working.

@spaze spaze self-assigned this Apr 25, 2023
@spaze spaze merged commit 2baf1ae into spaze:main Apr 25, 2023
@spaze
Copy link
Owner

spaze commented Apr 25, 2023

Thanks a lot, good job! This is a very nice fix for #44, even if partial!

@spaze
Copy link
Owner

spaze commented Apr 25, 2023

Released in 2.14.1 (replaced 2.14.0 with a quick fix #189)

spaze added a commit that referenced this pull request Apr 26, 2023
Mixed type object may have the constant but we're not sure, only throw the error when we're damn sure. This regression has been introduced in #186
spaze added a commit that referenced this pull request Apr 26, 2023
Mixed type object may have the constant but we're not sure, only throw the error when we're damn sure. This regression has been introduced in #186
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.

Support $foo::BAR where foo is declared as a string or a class-string
2 participants