Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions docs/en/annotations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ To anticipate the configuration section, making the above PHP class work with Do

.. code-block:: php

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Annotations\AnnotationReader;
use Doctrine\Annotations\AnnotationRegistry;

AnnotationRegistry::registerFile("/path/to/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
AnnotationRegistry::registerAutoloadNamespace("Symfony\Component\Validator\Constraint", "/path/to/symfony/src");
Expand All @@ -82,7 +82,7 @@ To use the annotations library is simple, you just need to create a new ``Annota

.. code-block:: php

$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader = new \Doctrine\Annotations\AnnotationReader();

This creates a simple annotation reader with no caching other than in memory (in php arrays).
Since parsing docblocks can be expensive you should cache this process by using
Expand All @@ -92,8 +92,8 @@ You can use a file caching reader:

.. code-block:: php

use Doctrine\Common\Annotations\FileCacheReader;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Annotations\FileCacheReader;
use Doctrine\Annotations\AnnotationReader;

$reader = new FileCacheReader(
new AnnotationReader(),
Expand All @@ -110,8 +110,8 @@ You can also use one of the ``Doctrine\Common\Cache\Cache`` cache implementation

.. code-block:: php

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\CachedReader;
use Doctrine\Annotations\AnnotationReader;
use Doctrine\Annotations\CachedReader;
use Doctrine\Common\Cache\ApcCache;

$reader = new CachedReader(
Expand All @@ -138,8 +138,8 @@ to be indexed by their class name you can wrap the reader in an IndexedReader:

.. code-block:: php

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\IndexedReader;
use Doctrine\Annotations\AnnotationReader;
use Doctrine\Annotations\IndexedReader;

$reader = new IndexedReader(new AnnotationReader());

Expand All @@ -154,7 +154,7 @@ Registering Annotations

As explained in the Introduction Doctrine Annotations uses its own autoloading mechanism to determine if a
given annotation has a corresponding PHP class that can be autoloaded. For Annotation Autoloading you have
to configure the ``Doctrine\Common\Annotations\AnnotationRegistry``. There are three different mechanisms
to configure the ``Doctrine\Annotations\AnnotationRegistry``. There are three different mechanisms
to configure annotation autoloading:

- Calling ``AnnotationRegistry#registerFile($file)`` to register a file that contains one or more Annotation classes.
Expand All @@ -175,7 +175,7 @@ A sample loader callback could look like:

.. code-block:: php

use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Annotations\AnnotationRegistry;
use Symfony\Component\ClassLoader\UniversalClassLoader;

AnnotationRegistry::registerLoader(function($class) {
Expand Down Expand Up @@ -204,7 +204,7 @@ You can disable this behavior for specific names if your docblocks do not follow

.. code-block:: php

$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader = new \Doctrine\Annotations\AnnotationReader();
AnnotationReader::addGlobalIgnoredName('foo');

PHP Imports
Expand All @@ -219,5 +219,5 @@ in future versions:

.. code-block:: php

$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader = new \Doctrine\Annotations\AnnotationReader();
$reader->setEnabledPhpImports(false);