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

More precise reflection-classes return types #3731

Merged
merged 2 commits into from
Dec 15, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Dec 14, 2024

@staabm staabm marked this pull request as ready for review December 14, 2024 10:17
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@staabm staabm marked this pull request as draft December 14, 2024 10:42
@staabm staabm marked this pull request as ready for review December 14, 2024 10:56
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@@ -9951,7 +9951,7 @@
'ReflectionClass::getReflectionConstant' => ['ReflectionClassConstant|false', 'name'=>'string'],
'ReflectionClass::getReflectionConstants' => ['list<ReflectionClassConstant>'],
'ReflectionClass::getShortName' => ['string'],
'ReflectionClass::getStartLine' => ['int|false'],
'ReflectionClass::getStartLine' => ['positive-int|false'],
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 valid even with eval:

<?php

eval('class A {}');

var_dump((new ReflectionClass(A::class))->getFileName());
var_dump((new ReflectionClass(A::class))->getStartLine());

@ondrejmirtes ondrejmirtes merged commit edc13ad into phpstan:1.12.x Dec 15, 2024
452 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.

4 participants