That would be convenient indeed, but its not practical.

Say you use @param. or @var or @example or anything. What would stop the 
annotation reader from throwing an exception in these cases?

This is why no exceptions are thrown and unknown annotations are just skipped.

greetings,
Benjamin

On Wed, 9 Mar 2011 17:16:04 +0000
Dan Leech <[email protected]> wrote:

> hello all
> 
> Today I have been working on a custom validator and it took longer
> than expected, but have finally got working.
> 
> It took longer than expected I think because the annotation reader
> ignores classes which dont exist, so at
> first I had no idea why
> 
>     @validation:MyValidator
> 
> or
> 
>     @validation:Foo\Bar\MyValidator
> 
> didnt work.
> 
> Then after digging into the source code I added the namespace for my
> validator in the DIC so now
> 
>     @myValidation:MyValidator
> 
> was pointing to the correct class, but unforunately I had a typo in my
> namespace declaration so it
> took me longer still!
> 
> Anyway, just putting it out there, it would be cool if the annotation
> reader could identify a class reference
> and throw an exception if the class doesnt exist.
> 
> I have written a little blog post for posterity:
> http://www.dantleech.com/blog/creating-a-custom-validation-constraint-in-conjunction-with-annotations
> -- 
> Dan Leech
> 
> Web Developer
> www.dantleech.com
> 
> -- 
> If you want to report a vulnerability issue on symfony, please send it to 
> security at symfony-project.com
> 
> You received this message because you are subscribed to the Google
> Groups "symfony developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/symfony-devs?hl=en
> 

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to