Skip to content

Commit 728ac82

Browse files
Update README.md file
1 parent 3f5d9c5 commit 728ac82

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,26 @@ $ composer require biurad/annotations
2020

2121
We all know writing annotations support for a project takes alot of time, work and sometimes end up changing the whole code to suite the current changes of [PHP], example of project that has messy annotations is [Nette DI][nette-di]. In short, this library is meant to be a base building block that utilizes [Doctrine Annotations][doctrine] and attributes introduced in [PHP] 8.
2222

23-
Let's you working on a few projects and you need to annotation support for each. With this library we make your work easier,all you need is a instance of `Biurad\Annotations\ListenerInterface` and an annotated class for finding annotations or attributes.
23+
Let's say you working on a few projects and you need annotations support for each. With this library we make your work easier, all you need is a instance of `Biurad\Annotations\ListenerInterface` and an annotated class for finding annotations or attributes.
2424

2525
**To know more about how to use this library, try going through the `tests` directory and find out how to integrate this library into your project.**
2626

2727
example of usage:
2828

2929
```php
3030
use Biurad\Annotations\AnnotationLoader;
31-
use Doctrine\Common\Annotations\AnnotationReader;
31+
use Spiral\Attributes\AnnotationReader;
32+
use Spiral\Attributes\AttributeReader;
33+
use Spiral\Attributes\Composite\MergeReader;
3234

33-
$annotation = new AnnotationLoader(new AnnotationReader());
35+
// The doctrine annotation reader
36+
$doctrine = new AnnotationReader();
37+
38+
// With spiral/attributes library, we can use PHP 8 attributes in PHP 7.2 +
39+
$attribute = new AttributeReader();
40+
41+
// Create a new annotation loader from readers ...
42+
$annotation = new AnnotationLoader(new MergeReader([$doctrine, $attribute]));
3443

3544
$annotation->attachListener(...); // Add your implemented Annotation listeners
3645

0 commit comments

Comments
 (0)