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 PHPStanAttributeTypeSyncer #2649

Merged
merged 9 commits into from
Jan 12, 2020
Merged

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Jan 12, 2020

Closes #2647

Related Changes

  • bump PHPStan to 0.12.5, break with number type resolution in d488d40

@TomasVotruba TomasVotruba requested a review from gnutix January 12, 2020 15:27
@TomasVotruba
Copy link
Member Author

@gnutix This rather meta-utility, to generate AttributeAware nodes from PHPStan nodes. That way we'd know about new PHPStan nodes much faster then reported in the issues.

I'd like to know your feedback.

@gnutix
Copy link
Contributor

gnutix commented Jan 12, 2020

That looks awesome! I was wondering how many more types I would discover and add in PRs like these. 😄

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Jan 12, 2020

Well, I think that 0 :D should be automated by Github Actions Cron

@gnutix
Copy link
Contributor

gnutix commented Jan 12, 2020

Just went through the code quickly ; I didn't read the logic itself nor tested the feature, just added some general comments about code style.

Is there more specific testing you'd like me to do as part of the review ?

Would this PR fix #2614 too ?

@TomasVotruba
Copy link
Member Author

TomasVotruba commented Jan 12, 2020

Thank you for review.

#2614 is unrelated to this. This only creates Attribute aware mirror nodes for PhpDocParser nodes. Basically what PhpParser has for format preserving.

The #2614 is about new node, that needs to be converted by static mapper.
There could be used similar collector approach too - wanna try to refactor it?

@gnutix
Copy link
Contributor

gnutix commented Jan 12, 2020

I will have very busy upcoming weeks, don't have much mental space to dig into these Rector/PhpStan/PhpParser layers of types (and frankly, its seriously missing documentation on these classes with complicated names - I can't understand the concepts behind it just looking at the code).

But I could yet do another PR to fix #2614... That would be fast and easy.

@TomasVotruba
Copy link
Member Author

I will have very busy upcoming weeks, don't have much mental space to dig into these Rector/PhpStan/PhpParser layers of types

I think it takes time to understand AST and related mechanism. Don't rush on yourself. It took me 1-2 years to get from tokens into state, where the printed content looked as I needed.

But I could yet do another PR to fix #2614... That would be fast and easy.

👍

@TomasVotruba TomasVotruba force-pushed the generate-attribute-aware-types branch 3 times, most recently from 75fb645 to 2ad18be Compare January 12, 2020 20:04
@TomasVotruba TomasVotruba force-pushed the generate-attribute-aware-types branch from 2ad18be to c6443b5 Compare January 12, 2020 20:42
@TomasVotruba TomasVotruba force-pushed the generate-attribute-aware-types branch 3 times, most recently from 0541389 to 16f1156 Compare January 12, 2020 22:03
@TomasVotruba TomasVotruba marked this pull request as ready for review January 12, 2020 22:04
@TomasVotruba TomasVotruba force-pushed the generate-attribute-aware-types branch from 16f1156 to 5757122 Compare January 12, 2020 22:05
@TomasVotruba TomasVotruba force-pushed the generate-attribute-aware-types branch from 6e02804 to 0afb435 Compare January 12, 2020 22:34
@TomasVotruba TomasVotruba merged commit 76a2fc5 into master Jan 12, 2020
@TomasVotruba TomasVotruba deleted the generate-attribute-aware-types branch January 12, 2020 22:41
TomasVotruba added a commit that referenced this pull request Jul 10, 2022
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.

[DX] Add automatic generator for new PHPStan types with attribute aware support + check in CI
2 participants