Skip to content

Commit

Permalink
Merge pull request #310 from l-vo/add_precision_about_autoloading
Browse files Browse the repository at this point in the history
Add precisions about annotations autoloading
  • Loading branch information
SenseException authored Mar 12, 2020
2 parents cce5faa + 7bd39e8 commit 53c09e9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ annotations of a class. A common one is

.. code-block:: php
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
// Deprecated and will be removed in 2.0 but currently needed
AnnotationRegistry::registerLoader('class_exists');
$reflectionClass = new ReflectionClass(Foo::class);
$property = $reflectionClass->getProperty('bar');
Expand All @@ -73,6 +79,13 @@ annotations of a class. A common one is
A reader has multiple methods to access the annotations of a class.

Note that ``AnnotationRegistry::registerLoader('class_exists')`` only works
if you already have an autoloader configured (i.e. composer autoloader).
Otherwise, :ref:`please take a look to the other annotation autoload mechanisms <annotations>`.

A reader has multiple methods to access the annotations
of a class.

:ref:`Read more about handling annotations. <annotations>`

IDE Support
Expand Down

0 comments on commit 53c09e9

Please sign in to comment.