Skip to content

Commit c03107c

Browse files
Update README.md
1 parent e3735ff commit c03107c

File tree

1 file changed

+31
-7
lines changed

1 file changed

+31
-7
lines changed

README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# The Biurad PHP Library Template
1+
# The Biurad PHP Annotations
22

33
[![Latest Version](https://img.shields.io/packagist/v/biurad/annotations.svg?style=flat-square)](https://packagist.org/packages/biurad/annotations)
44
[![Software License](https://img.shields.io/badge/License-BSD--3-brightgreen.svg?style=flat-square)](LICENSE)
@@ -8,19 +8,41 @@
88
[![Quality Score](https://img.shields.io/scrutinizer/g/biurad/php-annotations.svg?style=flat-square)](https://scrutinizer-ci.com/g/biurad/php-annotations)
99
[![Sponsor development of this project](https://img.shields.io/badge/sponsor%20this%20package-%E2%9D%A4-ff69b4.svg?style=flat-square)](https://biurad.com/sponsor)
1010

11-
**biurad/php-annotations** is a php library template repository for biurad lap. To use this library, rename **php-starter** and **BSD-3** on every file that contain it to your preferred library name and license.
12-
13-
As to why this project exist, it's to serve as a template for future open source PHP library projects. Of course, feel free to fork it and make your own recipe.
11+
**biurad/php-annotations** is an annotations and attribute reader for [PHP] 7.2+ created by [Divine Niiquaye][@divineniiquaye]. This library provides a Simple, Lazy, Fast & Lightweight [Doctrine Annotations][doctrine] and PHP 8 Attribute reader for your project.
1412

1513
## 📦 Installation & Basic Usage
1614

17-
This project requires [PHP] 7.1 or higher. The recommended way to install, is via [Composer]. Simply run:
15+
This project requires [PHP] 7.2 or higher. The recommended way to install, is via [Composer]. Simply run:
1816

1917
```bash
20-
$ composer require biurad/php-annotations
18+
$ composer require biurad/annotations
2119
```
2220

23-
Write a bit of **How To** use this package, so developers can have a bit of idea about the repository before checking out documentation.
21+
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.
22+
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.
24+
25+
**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.**
26+
27+
example of usage:
28+
29+
```php
30+
use Biurad\Annotations\AnnotationLoader;
31+
use Doctrine\Common\Annotations\AnnotationReader;
32+
33+
$annotation = new AnnotationLoader(new AnnotationReader());
34+
35+
$annotation->attachListener(...); // Add your implemented Annotation listeners
36+
37+
$annotation->attach(...); // Add a class string, classless file, or directory
38+
39+
$listeners = \iterator_to_array($annotation->load());
40+
41+
// To use a collector you implemented into your instance of `Biurad\Annotations\ListenerInterface`
42+
foreach ($$listeners as $collector) {
43+
// You can fetch the required $collector from here.
44+
}
45+
```
2446

2547
## 📓 Documentation
2648

@@ -100,3 +122,5 @@ Check out the other cool things people are doing with `biurad/php-annotations`:
100122
[Biurad Lap]: https://team.biurad.com
101123
[email]: support@biurad.com
102124
[message]: https://projects.biurad.com/message
125+
[doctrine]: https://github.com/doctrine/annotations
126+
[nette-di]: https://github.com/nette/di

0 commit comments

Comments
 (0)