-
-
Notifications
You must be signed in to change notification settings - Fork 48
Add a configuration to skip DocBlock Custom Tag detection (#336) #337
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 a configuration to skip DocBlock Custom Tag detection (#336) #337
Conversation
c55bc8b to
e052afd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please change the readme file documenting how to skip DocBlock Custom Tag detection ?
src/Analyzer/NameResolver.php
Outdated
| $customTag = str_replace('@', '', $tagValue->name); | ||
| $type = $this->resolveName(new Node\Name($customTag), Use_::TYPE_NORMAL); | ||
| $node->type = $type; | ||
| if ($this->parseDocBlockCustomTags) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to avoid another nested level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done! I also updated the docs.
e052afd to
637f0e1
Compare
Codecov Report
@@ Coverage Diff @@
## main #337 +/- ##
============================================
+ Coverage 93.99% 94.02% +0.03%
- Complexity 502 505 +3
============================================
Files 60 60
Lines 1365 1372 +7
============================================
+ Hits 1283 1290 +7
Misses 82 82
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
637f0e1 to
102465a
Compare
|
With my last commit I updated FileVisitorTest to solve a conflict with #335 and ConfigTest to increase test code coverage |
102465a to
9feb27c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
|
I am not sure if we should skip entirely the parsing of dependencies in a dobclock, since they are "soft" dependencies. What is your opinion on that? If we stick to exclude only custom docblock may I suggest to change the name of the config method to make it more explicit? Something like |
In my opinion with DocBlocks you can handle two complete different cases:
/**
* @var QueryBuilder
*/
private $foo;that is just the legacy version of
/**
* @JMS\Expose
*/
private string $foo;The class may work event without that information (that is used outside). I guess that violations about Case 1 are much more critical than Case 2. In our project we cannot easily remove dependency about Case 2. We need an option to skip violations of Case 2 (like How would you call such an option? |
|
ok, let's keep the current PR behaviour. regarding the name |
9feb27c to
5afd713
Compare
@micheleorselli I just updated the code, the test and the documentation. The GitHub check that failed is for something not related to this issue: "Composer 2.3.0 dropped support for PHP <7.2.5 and you are running 7.1.33-51+ubuntu20.04.1+deb.sury.org+1, please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting." |
|
@LuigiCardamone it's Github/composer issue, I run actions, and now it's totally green. |
This PR implements the feature described in this issue: #336
To skip the check you need to add this configuration:
No breaking change is added: if the configuration is not modified the default behavior is used (ParseDocBlockCustomTags=true).