PHPackages                             adiletmaks/annotations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. adiletmaks/annotations

ActiveLibrary

adiletmaks/annotations
======================

The KISS PHP annotations library

4.0.0(4y ago)031MITPHPPHP ^7.0

Since Sep 7Pushed 4y agoCompare

[ Source](https://github.com/adiletmaks/annotations)[ Packagist](https://packagist.org/packages/adiletmaks/annotations)[ RSS](/packages/adiletmaks-annotations/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (35)Used By (0)

Minime \\ Annotations
=====================

[](#minime--annotations)

[![Build Status](https://camo.githubusercontent.com/685ea4d7534019d411d0c82f0240858b5d822624f3f036370b0b6431c46ea560/68747470733a2f2f7472617669732d63692e6f72672f6d617263696f416c6d6164612f616e6e6f746174696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/marcioAlmada/annotations)[![Coverage Status](https://camo.githubusercontent.com/68e9aab1ad17f7f0c374e9472579634191f9a66f0b842a81845f0eeb2ced4b9d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6d617263696f416c6d6164612f616e6e6f746174696f6e732f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/marcioAlmada/annotations?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a451b9eb785cd7e0ababb0d03e89817716c449e990f5d1bbdb8d8948cb754fdc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617263696f416c6d6164612f616e6e6f746174696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/marcioAlmada/annotations/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/a10d1138f2b9a38ee8645b2aea59f465253b47939f43b2faf813c9699743eede/68747470733a2f2f706f7365722e707567782e6f72672f6d696e696d652f616e6e6f746174696f6e732f762f737461626c652e706e67)](https://packagist.org/packages/minime/annotations)[![Total Downloads](https://camo.githubusercontent.com/c493ed5da144be5c5686bdaea321157332ae91f6a4a19667887025588891ec3e/68747470733a2f2f706f7365722e707567782e6f72672f6d696e696d652f616e6e6f746174696f6e732f646f776e6c6f6164732e706e67)](https://packagist.org/packages/minime/annotations)[![Reference Status](https://camo.githubusercontent.com/7f513a59da7f89f1f14d272f8020f7b90dd4d21ac6c16596feffe537ae610e27/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f6d696e696d653a616e6e6f746174696f6e732f7265666572656e63655f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/php/minime:annotations/references)[![License](https://camo.githubusercontent.com/715aaf8f5392b58df2601a371eedaf189020c99cec772562be021792d8162a8f/68747470733a2f2f706f7365722e707567782e6f72672f6d696e696d652f616e6e6f746174696f6e732f6c6963656e73652e706e67)](https://packagist.org/packages/minime/annotations)[![SensioLabsInsight](https://camo.githubusercontent.com/1080f2636e14ffec271213eaa692f2d016fb9fc8e0627d198aae2ec9b19b55d1/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f35303635656236382d613834312d343837372d396533302d3833666432653232346632392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/5065eb68-a841-4877-9e30-83fd2e224f29)

Minime\\Annotations is the first KISS PHP annotations library.

Composer Installation
---------------------

[](#composer-installation)

```
{
  "require": {
    "minime/annotations": "~3.0"
  }
}
```

Through terminal: `composer require minime/annotations:~3.0` 🎱

Setup
-----

[](#setup)

First grab an instance of the `Minime\Annotations\Reader` the lazy way:

```
$reader = \Minime\Annotations\Reader::createFromDefaults();
```

Or instantiate the annotations reader yourself with:

```
use Minime\Annotations\Reader;
use Minime\Annotations\Parser;
use Minime\Annotations\Cache\ArrayCache;

$reader = new Reader(new Parser, new ArrayCache);
```

Notice that `Reader::createFromDefaults()` creates a reader instance with array cache enabled. On production you might want to use a persistent cache handler like `FileCache` instead:

```
use Minime\Annotations\Cache\FileCache;

$reader->setCache(new FileCache('app/storage/path'));
```

Reading Annotations
-------------------

[](#reading-annotations)

Consider the following class with some docblock annotations:

```
