-
Notifications
You must be signed in to change notification settings - Fork 236
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
DocParser can now ignore whole namespaces #45
DocParser can now ignore whole namespaces #45
Conversation
@@ -700,6 +700,14 @@ private function Annotation() | |||
return false; | |||
} | |||
|
|||
foreach (array_keys($this->ignoredAnnotationNames) as $annotationName) { |
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 wouldn't pack annotation names and namespaces into the same property.
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.
Why not?
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.
Because the semantic meaning changes, which makes the code harder to read/understand.
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 don't know. IMHO it's technically the name of the annotation. Plus... a spaced name is still a name. Just more organized.
What would you name the two (new) properties?
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.
@BreiteSeite ignoredNamespaces
? :-)
Hi @Ocramius, i rebased on master and refactored to a new property Could you please give Feedback on tests and implementation? Thank you. |
If i want to use
So, i think it would be useful to ignore valid annotations (when |
Moved to #97, where I applied some additional fixes (functionality wasn't changed) |
… method, corrected property/parameter documentation
…e-namespaces Feature - #45 - allow ignoring entire namespaces
We would like to ignore whole namespaces in the annotation-reader.
We use swagger-php to document our REST-API in our source code. However, zircote/swagger-php is a dev dependency and therefore not deployed to the production environment. As we use doctrine, the Application crashes because the AnnotationReader (used by doctrine-orm) throws an Exception because it can't resolve the
@SWG\*
annotations.To fix this, we have to register every Swagger-Annotation with AnnotationReader::addGlobalIgnoredName();
This leads to this code (list of swagger annotations: http://zircote.com/swagger-php/annotations.html#annotation-hierarchy):
With this PR, we could use:
And won't have to update the global ignores if a new swagger annotation is introduced (with an update).