@Proxy is not defined Annotation #49

Merged
merged 1 commit into from May 17, 2012

4 participants

@kusmierz

Probably because I removed "doctrine" from my config file.. But since I'm using mongo (and mongo-doctrine) what I need Doctrine itself for?

@kusmierz
  [Doctrine\Common\Annotations\AnnotationException]


  [Semantical Error] The annotation "@proxy" in method Doctrine\MongoDB\Connecti
on::close() was never imported. Did you maybe forget to add a "use" statement fo
r this annotation?
@jwage jwage merged commit b5c93bf into doctrine:master May 17, 2012
@jmikola
Doctrine member

@kusmierz: Do you have any idea why this class was being scanned for annotations? I also noticed your comment on
d5ae19d reporting the same.

IIRC, these files were never scanned in the past. It makes me wonder if a recent change to the annotation driver has resulted in it scanning many more things than it should.

@kusmierz

I think it's because JMS\SecurityExtraBundle

@jmikola
Doctrine member

Ok, your first comment in this PR (when you alluded to Doctrine ORM) confused me, as Proxy isn't an annotation class in that library: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php

@proxy was simply a custom doc-block tag being used to denote methods that proxied another on the wrapped object (\Mongo in this case). This sounds more like a bug with JMSSecurityExtraBundle instead of Doctrine.

@schmittjoh: can you comment?

@schmittjoh
Doctrine member

It could under certain circumstances be scanned if it is a service, and secure_all_services is turned on.

At any rate, I think the class should be compatible with Doctrine's annotation reader. As the @proxy annotation is not ignored by default and I'm not sure whether it makes sense to add it (How common is the annotation? Is it a PHPdoc annotation?), one option is to add @IgnoreAnnotation("proxy") to the Connection's class doc comment, or the other, remove the annotation (what this PR suggests).

@jmikola
Doctrine member

It's certainly not common or standard (I've never seen it outside of Doctrine's wrapper classes). I suppose we could ask @beberlei or @jwage if it's really used for anything, such as API docs.

Thanks for pointing out the @IgnoreAnnotation solution, though. I wasn't aware that existed (nor the whitelist in the annotation reader).

@jmikola jmikola added a commit to doctrine/mongodb-odm that referenced this pull request May 30, 2012
@jmikola jmikola Remove stray @proxy doc tag 7ba7a14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment