doctrine/annotations — pull request #45 by BreiteSeite (2014-11-25 15:17:54+00:00)
Title: DocParser can now ignore whole namespaces or subnamespaces

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):

```
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Resource');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Api');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Operation');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Parameter');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\ResponseMessage');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Model');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Property');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Items');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Authorization');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Scope');
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG\Info');
```

With this PR, we could use:
```
\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('SWG');
```
And won't have to update the global ignores if a new swagger annotation is introduced (with an update).