Skip to content

Use custom resolver for extracting type information from docblocks #504

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

Merged
merged 6 commits into from
May 14, 2025

Conversation

micheleorselli
Copy link
Member

@micheleorselli micheleorselli commented May 13, 2025

This is a possibile approach to solve #497: the code needed to parse docblock types is now in a class indipendent from PhpParser's NameResolver. This would give us more flexibility and mantainability .

Further evolution could be (to be tackled in subsequent PRs)

  • extracting information for @throws tags and consider them as dependencies
  • simplify the way we get information on types from the docblocks

Copy link

codecov bot commented May 13, 2025

Codecov Report

Attention: Patch coverage is 91.40625% with 11 lines in your changes missing coverage. Please review.

Project coverage is 97.31%. Comparing base (96cd45c) to head (af8fe00).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/Analyzer/DocblockTypesResolver.php 93.26% 7 Missing ⚠️
src/Analyzer/DocblockParserFactory.php 71.42% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #504      +/-   ##
============================================
+ Coverage     95.92%   97.31%   +1.38%     
+ Complexity      671      624      -47     
============================================
  Files            76       78       +2     
  Lines          1839     1748      -91     
============================================
- Hits           1764     1701      -63     
+ Misses           75       47      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@micheleorselli micheleorselli marked this pull request as ready for review May 13, 2025 20:56
Copy link
Member

@AlessandroMinoccheri AlessandroMinoccheri left a comment

Choose a reason for hiding this comment

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

Despite the error in the pipeline, for me it's fine.

LGTM 👍

@micheleorselli micheleorselli merged commit 26417fe into main May 14, 2025
34 of 35 checks passed
@micheleorselli micheleorselli deleted the use_custom_docblock_resolver branch May 14, 2025 07:09
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.

2 participants