PHPackages                             maslosoft/addendum - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. maslosoft/addendum

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

maslosoft/addendum
==================

Powerful and easy to use PHP annotations

7.0.6(1y ago)76.6k↓100%[5 issues](https://github.com/Maslosoft/Addendum/issues)7AGPL-3.0-onlyPHPPHP &gt;=7.4CI failing

Since Oct 25Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Maslosoft/Addendum)[ Packagist](https://packagist.org/packages/maslosoft/addendum)[ Docs](https://maslosoft.com/addendum/)[ RSS](/packages/maslosoft-addendum/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (86)Used By (7)

[![Addendum Logo](https://camo.githubusercontent.com/7468a5c72cac4a07107f827c9491e15575d79182b1d67afac7af53477ff4dba5/68747470733a2f2f6d61736c6f736f66742e636f6d2f616464656e64756d2f616464656e64756d2e737667)](https://maslosoft.com/addendum/) [Maslosoft Addendum](https://maslosoft.com/addendum/)
=====================================================================================================================================================================================================================================================================================================

[](#-maslosoft-addendum)

[*Powerful and easy to use PHP annotations*](https://maslosoft.com/addendum/)

[![Latest Stable Version](https://camo.githubusercontent.com/bd766a047c434b6b7c031eedb0fbb2371d167f7832fa4582d926f875dd4d94a9/68747470733a2f2f706f7365722e707567782e6f72672f6d61736c6f736f66742f616464656e64756d2f762f737461626c652e737667)](https://packagist.org/packages/maslosoft/addendum "Latest Stable Version")[![License](https://camo.githubusercontent.com/44be90220e9b239010ac6264ac00f480781ce90fd217daa712d1447b0c17e79b/68747470733a2f2f706f7365722e707567782e6f72672f6d61736c6f736f66742f616464656e64756d2f6c6963656e73652e737667)](https://packagist.org/packages/maslosoft/addendum "License")[ ![Scrutinizer Code Quality](https://camo.githubusercontent.com/e8efff60a2ccd00fe476dcd69790a3630e80578171cf26d6b24d01638d4eb57f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61736c6f736f66742f416464656e64756d2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Maslosoft/Addendum/?branch=master)[ ![Code Coverage](https://camo.githubusercontent.com/487ecb9976ec3a77c32dfb8120b7b8ac41068c65a3033a767095058948aa7c9f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4d61736c6f736f66742f416464656e64756d2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Maslosoft/Addendum/?branch=master)### Quick Install

[](#quick-install)

```
composer require maslosoft/addendum
```

### Documentation

[](#documentation)

[Full Addendum Documentation](https://maslosoft.com/addendum/docs/)

Annotations for PHP
===================

[](#annotations-for-php)

This project provides smart annotations support for PHP language with the aim on performance and ease of use.

Annotations are in fact a kind declarative language embedded in PHP code. It does not allow and flow control structures, loops, conditions. It allows us to describe what is required or what we expect from parf of code.

Where to use annotations
------------------------

[](#where-to-use-annotations)

While (PHP) programming language itself is very flexible and allows us to describe complex bahaviors, there are some aspects where we want to only describe (or configure) such behaviors. And we want to keep our *main* code as is, while adding some additional behaviors, which might include:

- Access control
- Way to display data
- Whether to store data
- Where to store data
- Should the data be searchable

And so on, with ever growing list of aspects and behaviors. While this could be made by implementing in our classe more and more interfaces, soon those would end up in hundreds of methods.

Another way could be some kind of extra meta-data configuration, let it be in XML, JSON or YAML files. This requires us to keep those too files in sync and also separates declarations from code. But we might need extra behaviors/aspects for many libraries - resulting in code being split into two or more files.

### Embed behavior into code

[](#embed-behavior-into-code)

So the idea is to embed those extra aspects of class into code. With annotations - special comment tags placed just above class/method/property declaration.

These annotations can be interpreted independently by different parts of program. These are extensible, so that adding more annotations does not influence existing code.

Different application parts might interpret just part of annotations while ignoring unknown ones.

In below example one part will react `@Label` and `@Description` declarations, other will perform some extra operations when will encouner `@I18N` annotation.

Example:

```
class Page implements AnnotatedInterface
{
	/**
	 * Page URL
	 * @Label('Page URL')
	 * @Description('Relative URL, it should be simple lowercase string with words separated by hyphen')
	 * @SearchBoost(3.5)
	 * @I18N
	 * @SafeValidator
	 * @UrlValidator
	 * @Decorator(Action, 'update')
	 * @see Action
	 * @var string
	 */
	public $url = '';
}
```

All extra metadata is contained just where class property is declared. This is it. Annotations itself are *not* evaluated on each request. These are used to generate metadata, which is later available by using meta containers. Having any object implementing `AnnotatedInterface`, metadata can be obtained by passing either object or class name.

Example of getting meta data:

```
echo Meta::create(Page::class)->url->label;
// Will echo "Page URL"
```

This metadata is cached, so there is no overhead of parsing annotations.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity79

Established project with proven stability

 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 ~48 days

Recently: every ~249 days

Total

85

Last Release

493d ago

Major Versions

2.1.0 → 3.0.0-alpha.12014-12-19

3.1.8 → 4.0.02015-06-16

4.0.21 → 5.0.02016-08-18

5.0.21 → 6.0.02019-06-07

6.0.5 → 7.0.02022-02-22

PHP version history (3 changes)3.0.0-alpha.1PHP &gt;=5.5.0

6.0.0PHP &gt;=7.1

7.0.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0c790d4fc70028f2628e8dfd67b12a75eb8cc7c9e9db8c8347b5660c336f21c?d=identicon)[pmaselkowski](/maintainers/pmaselkowski)

---

Top Contributors

[![pmaselkowski](https://avatars.githubusercontent.com/u/520283?v=4)](https://github.com/pmaselkowski "pmaselkowski (531 commits)")

---

Tags

annotationsannotations-processorcontainerextraintrospectionmetametadataphpphpannotationsmetadataannotationaddendum

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/maslosoft-addendum/health.svg)

```
[![Health](https://phpackages.com/badges/maslosoft-addendum/health.svg)](https://phpackages.com/packages/maslosoft-addendum)
```

###  Alternatives

[minime/annotations

The KISS PHP annotations library

229378.6k36](/packages/minime-annotations)[spiral/attributes

PHP attributes reader

233.6M45](/packages/spiral-attributes)[marcin-orlowski/lombok-php

Never write boilerplate code for your data class again!

3118.6k1](/packages/marcin-orlowski-lombok-php)[hyperf/di

A DI for Hyperf.

182.8M594](/packages/hyperf-di)

PHPackages © 2026

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