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

Use phpstan/phpdoc-parser to retrieve additional type information from PhpDoc #1261

Merged
merged 6 commits into from
Nov 8, 2020
Merged

Use phpstan/phpdoc-parser to retrieve additional type information from PhpDoc #1261

merged 6 commits into from
Nov 8, 2020

Conversation

Namoshek
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
Doc updated no
BC breaks? yes
Deprecations? no
Tests pass? yes
Fixed tickets #1259
License MIT

As suggested by @goetas in #1259, this PR fixes the mentioned issue by implementing phpstan/phpdoc-parser support to read @var tags from PhpDoc. Only one test case for single-line PhpDoc parsing has been added, which works fine now.

In my opinion, a BC break is introduced by adding a constructor to DocBlockTypeResolver, since none existed before (which means possible extensions probably do not contain and call to the parent constructor so far).

This needs to be reviewed carefully, as I'm not sure if I considered all possible cases. The tests seem to work fine though.

composer.json Outdated Show resolved Hide resolved
@goetas
Copy link
Collaborator

goetas commented Nov 8, 2020

Nicely done! except only one comment, this looks good to me. @dgafka can you also check it please?

@goetas
Copy link
Collaborator

goetas commented Nov 8, 2020

since #1256 has been merged, this needs to be rebased.

@Namoshek
Copy link
Contributor Author

Namoshek commented Nov 8, 2020

I changed the dependency location and rebased.

#1256 is very welcomed by me as well by the way. since I was about to write a custom handler for CarbonInterface and realized it doesn't work just yet. 😄

@goetas
Copy link
Collaborator

goetas commented Nov 8, 2020

yay!

@goetas goetas merged commit 0f2bcfd into schmittjoh:master Nov 8, 2020
@goetas
Copy link
Collaborator

goetas commented Nov 8, 2020

thanks a lot!

@Namoshek Namoshek deleted the feature-phpstan-phpdoc-parser branch November 8, 2020 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants