-
-
Notifications
You must be signed in to change notification settings - Fork 47
Parsing enum file #276
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
Parsing enum file #276
Conversation
a15a343 to
1422ac5
Compare
Codecov Report
@@ Coverage Diff @@
## main #276 +/- ##
============================================
+ Coverage 93.51% 93.55% +0.03%
- Complexity 363 367 +4
============================================
Files 57 57
Lines 971 977 +6
============================================
+ Hits 908 914 +6
Misses 63 63
Help us with your feedback. Take ten seconds to tell us how you rate us. |
| $violations = new Violations(); | ||
|
|
||
| $notHaveDependencyOutsideNamespace = new Implement('MyInterface'); | ||
| $notHaveDependencyOutsideNamespace->evaluate($cd[0], $violations, 'we want to add this rule for our software'); |
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.
I am not sure I got the goal of this test
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.
It's a simple rule @micheleorselli to check if we are parsing or not the enum class.
Without the code inside the FileVisitor the enum class is not parsed and this test it's red.
We can try to find a different test to be more explicit. Any ideas?
| $this->classDescriptions[] = $classDescription; | ||
| } | ||
|
|
||
| if ($node instanceof Node\Stmt\Enum_ && null !== $this->classDescriptionBuilder) { |
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.
Here we treat enum as a class which is fine for now. I am wondering if we should add a method like isEnum or similar
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.
What is the benefit to add the method isEnum now?
I think it could be fine.
This PR should fix #275