Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Merge pull request #5 from gimler/register_annontation_namespace

correct method name
  • Loading branch information...
commit 3cb594e14499bd077054ff6f6c780b4cc3e967a4 2 parents d9e69bd + 87ea8b8
@guilhermeblanco guilhermeblanco authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 en/reference/annotations.rst
8 en/reference/annotations.rst
@@ -73,15 +73,15 @@ To anticipate the configuration section, making the above PHP class work with Do
use Doctrine\Common\Annotations\AnnotationRegistry;
- AnnotationRegistry::registerAnnotationNamespace("Symfony\Component\Validator\Constraint", "/path/to/symfony/src");
- AnnotationRegistry::registerAnnotationNamespace("MyProject\Annotations", "/path/to/myproject/src");
+ AnnotationRegistry::registerAutoloadNamespace("Symfony\Component\Validator\Constraint", "/path/to/symfony/src");
+ AnnotationRegistry::registerAutoloadNamespace("MyProject\Annotations", "/path/to/myproject/src");
$reader = new AnnotationReader();
The second block with the annotation registry calls registers all the three different annotation namespaces that are used.
Doctrine saves all its annotations in a single file, that is why ``AnnotationRegistry#registerFile`` is used in contrast to
-``AnnotationRegistry#registerAnnotationNamespace`` which creates a PSR-0 compatible loading mechanism for class to file names.
+``AnnotationRegistry#registerAutoloadNamespace`` which creates a PSR-0 compatible loading mechanism for class to file names.
In the third block, we create the actual AnnotationReader instance. Note that we also add "dummy" to the global list of annotations
for which we do not throw exceptions. Setting this is necessary in our example case, otherwise @dummy would trigger an exception to
@@ -523,4 +523,4 @@ IDE Support
Some IDEs already provide support for annotations:
-- Eclipse via the `Symfony2 Plugin <>`_
+- Eclipse via the `Symfony2 Plugin <>`_
Please sign in to comment.
Something went wrong with that request. Please try again.