PHPackages                             php-platform/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. php-platform/annotations

ActiveLibrary

php-platform/annotations
========================

v0.1.2(7y ago)02.0k↓100%PHPPHP &gt;=5.3

Since Jan 6Pushed 7y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

PHP Platform Annotations
========================

[](#php-platform-annotations)

This package provides APIs to access annotations in PHP

[![Build Status](https://camo.githubusercontent.com/f6f07b98543d14856ac9e000103b6b19cd4537ebfdecb902c5b2345889695615/68747470733a2f2f7472617669732d63692e6f72672f504850506c6174666f726d2f616e6e6f746174696f6e732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/PHPPlatform/annotations)

Usage
-----

[](#usage)

### Getting the Annotations

[](#getting-the-annotations)

```
PhpPlatform\Annotations\Annotation::getAnnotations($className, $propertyName="*", $constantName="*", $methodName="*");
```

where

- `$className` is complete name of the class for which annotations are needed
- `$propertyName` is a *string* of a property or *array* of properties for which annotations are needed
- `$constantName` is a *string* of a constant or *array* of constants for which annotations are needed
- `$methodName` is a *string* of a method name or *array* of method names for which annotations are needed

### Declaring Annotations

[](#declaring-annotations)

This library supports annotations in DocComments Annotation declaration has the format of

```
 * @KEY VALUE(S)

```

Where `KEY` may contain subkeys seperated by `.`and `VALUES` are `space` or `comma` seperated strings

Example
-------

[](#example)

This Example shows the different forms of annotations and their expected values

```
/**
 * @key1
 *  @key2
 * @key3.subKey1
 * @key3.subKey2.subkey21 success
 * @key4 v1
 * @key5 (v2)
 * @key6 v3 v4
 * @key7 "v5\"With Space and Quotes\""
 * @key8 ("v6\"With Space and Quotes\"", v7)
 * @key9 ("v8\"With Space and Quotes\"", v9) description1
 * @key10 ("v10 With \\", v11) description2
 * @key11 ("123", v12) description3
 * @key12 ("true", "false")
 * @key13 v13
 * @key13 1234
 * @key14 (v14)
 * @key14 v15
 * @ notKey
 * @wrongKey(v16) desc
 *
 */
public $testDifferrentFormatsOfAnnoptations;
```

The array of annotations returned from

```
PhpPlatform\Annotations\Annotation::getAnnotations($className, 'testDifferrentFormatsOfAnnoptations');
```

Will be

```
[
    "testDifferrentFormatsOfAnnoptations" => [
	    "key1" => true,
	    "key2" => true,
	    "key3" => [
	        "subKey1" => true,
	        "subKey2" => [
	            "subkey21" => "success"
	        ]
	    ],
	    "key4" => "v1",
	    "key5" => ["v2"],
	    "key6" => ["v3", "v4"],
	    "key7" => 'v5"With Space and Quotes"',
	    "key8" => ['v6"With Space and Quotes"', "v7"],
	    "key9" => ['v8"With Space and Quotes"', "v9"],
	    "key10" => ["v10 With \\", "v11"],
	    "key11" => [123, "v12"],
	    "key12" => [true, false],
	    "key13" => ['v13', 1234],
	    "key14" => ["v14", "v15"]
	]
]
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~178 days

Total

4

Last Release

2873d ago

PHP version history (2 changes)v0.1.0PHP ~5.3

v0.1.1PHP &gt;=5.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/92306cd4ec1342daeba6fb633880eb9907cdd022874ae39be11ab7ae274171c7?d=identicon)[Raaghu](/maintainers/Raaghu)

---

Top Contributors

[![Raaghu](https://avatars.githubusercontent.com/u/8255650?v=4)](https://github.com/Raaghu "Raaghu (6 commits)")

---

Tags

annotationsphp-platform

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/php-platform-annotations/health.svg)

```
[![Health](https://phpackages.com/badges/php-platform-annotations/health.svg)](https://phpackages.com/packages/php-platform-annotations)
```

###  Alternatives

[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M117](/packages/doctrine-lexer)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)[jms/di-extra-bundle

Allows to configure dependency injection using annotations

32813.3M88](/packages/jms-di-extra-bundle)[jms/aop-bundle

Adds AOP capabilities to Symfony2

20413.7M22](/packages/jms-aop-bundle)[jms/security-extra-bundle

Enhances the Symfony2 Security Component by adding several new features

2628.1M59](/packages/jms-security-extra-bundle)[dereuromark/cakephp-ide-helper

CakePHP IdeHelper Plugin to improve auto-completion

1862.1M26](/packages/dereuromark-cakephp-ide-helper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
