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

Add versions to hot-patched symbols #425

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

smoench
Copy link
Contributor

@smoench smoench commented Oct 30, 2020

fixes #420

@smoench smoench force-pushed the internal-constants branch 15 times, most recently from 40e681e to 76e3643 Compare October 30, 2020 12:56
src/Reflector.php Outdated Show resolved Hide resolved
@smoench smoench force-pushed the internal-constants branch 3 times, most recently from 387fb6b to 1e26402 Compare November 1, 2020 14:48
@smoench
Copy link
Contributor Author

smoench commented Nov 1, 2020

It is related to nikic/PHP-Parser#715. Using a none emulative lexer would fix this bug. Specs needs somehow to be skipped on none supported php versions. Any ideas?

.github/workflows/build.yml Outdated Show resolved Hide resolved
@theofidry
Copy link
Member

Specs needs somehow to be skipped on none supported php versions. Any ideas?

I think it would make sense to be able to declare the min PHP version required for a given spec or spec file

@smoench smoench force-pushed the internal-constants branch 3 times, most recently from ccaf406 to ef082a6 Compare November 1, 2020 18:40
@smoench
Copy link
Contributor Author

smoench commented Nov 1, 2020

I added a minPhpVersin-key to the meta spec

@smoench smoench mentioned this pull request Nov 2, 2020
@smoench
Copy link
Contributor Author

smoench commented Nov 4, 2020

Ready for review. In #420 Sebastian Bergmann has proved it is working.

Copy link
Member

@theofidry theofidry left a comment

Choose a reason for hiding this comment

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

Thanks a lot! This is a big improvement 👏

Keep in mind that until we change the phpstorm stubs generated map to record the version used there, we are still missing the version for all of those symbols (the one you did is only the "hot patched" symbols). I'm saying this just as a note to be aware, having this is already quite quite helpful

src/Reflector.php Outdated Show resolved Hide resolved
@theofidry theofidry changed the title fix internal constants Add versions to hot-patched symbols Nov 4, 2020
@smoench
Copy link
Contributor Author

smoench commented Nov 4, 2020

Keep in mind that until we change the phpstorm stubs generated map to record the version used there, we are still missing the version for all of those symbols (the one you did is only the "hot patched" symbols). I'm saying this just as a note to be aware, having this is already quite quite helpful

Yes, I had this in mind. But unfortunately T_MATCH has no @since-annotation https://github.com/JetBrains/phpstorm-stubs/blame/master/tokenizer/tokenizer.php#L133

@smoench smoench force-pushed the internal-constants branch 4 times, most recently from 60219aa to 25f6e56 Compare November 4, 2020 10:47
@smoench
Copy link
Contributor Author

smoench commented Nov 5, 2020

Applied proposals, CS and resolved conflicts. Ready for merge :-)

A follow up task would be generating a map of classes, function and constants with the related php version they have been introduced. (or similar)

@theofidry theofidry merged commit 654637d into humbug:master Nov 5, 2020
@theofidry
Copy link
Member

Cool, thanks a lot for the work @smoench!

@smoench smoench deleted the internal-constants branch November 18, 2020 17:34
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.

Cannot scope PHPUnit 8.5
3 participants