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

Improve ::class type for final classes #1699

Merged
merged 1 commit into from Sep 5, 2022

Conversation

rvanvelzen
Copy link
Contributor

No description provided.

@rvanvelzen rvanvelzen marked this pull request as ready for review September 5, 2022 11:16
@ondrejmirtes ondrejmirtes merged commit d0fb570 into phpstan:1.8.x Sep 5, 2022
@ondrejmirtes
Copy link
Member

Thank you!

@@ -25,13 +25,13 @@ function foo()
{
$t = new Test(new A());
$class = $t->value::class;
assertType('class-string<Bug7698\A>|class-string<Bug7698\B>', $class);
assertType("'Bug7698\\\\A'|'Bug7698\\\\B'", $class);
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we loose knowledge here, that the type involved is not just a regular string but a class-string?

Copy link
Member

Choose a reason for hiding this comment

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

No, that's what the 2nd parameter of ConstantStringType constructor is.

@rvanvelzen rvanvelzen deleted the final-class-const branch September 6, 2022 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants