PHPackages                             fmasa/doctrine-yaml-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. [Database &amp; ORM](/categories/database)
4. /
5. fmasa/doctrine-yaml-annotations

AbandonedArchivedLibrary[Database &amp; ORM](/categories/database)

fmasa/doctrine-yaml-annotations
===============================

Custom annotations for YAML mapping

1.1.0(8y ago)02.2kMITPHPPHP ^7.0

Since Apr 2Pushed 8y ago1 watchersCompare

[ Source](https://github.com/fmasa/doctrine-yaml-annotations)[ Packagist](https://packagist.org/packages/fmasa/doctrine-yaml-annotations)[ RSS](/packages/fmasa-doctrine-yaml-annotations/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

Doctrine YAML annotations
=========================

[](#doctrine-yaml-annotations)

[![Build Status](https://camo.githubusercontent.com/d7c49007f54b4c4f36b79c58aaf29e3547aba4da6490bc1309da156fa57bb98c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f666d6173612f646f637472696e652d79616d6c2d616e6e6f746174696f6e732f6d61737465722e737667)](https://travis-ci.org/fmasa/doctrine-yaml-annotations)[![Coverage Status](https://camo.githubusercontent.com/f85bf663a0420882eb29aa735c4786988534bf54b087f6f3fe3a25365c8eccb3/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f666d6173612f646f637472696e652d79616d6c2d616e6e6f746174696f6e732f6d61737465722e737667)](https://coveralls.io/github/fmasa/doctrine-yaml-annotations?branch=master)

One of the great features of Doctrine 2 is extensibility. Doctrine offers multiple ways to specify mapping information, but the most of the extensions only supports Annotations configuration.

This package adds custom annotations to your YAML mapping files.

What is currently supported:

- property annotations (fields and embeddables)
- class annotations

Installation
------------

[](#installation)

The best way to install fmasa/doctrine-yaml-annotations is using [Composer](https://getcomposer.org/):

```
$ composer require fmasa/doctrine-yaml-annotations

```

For example let's configure the [Consistence](https://github.com/consistence/consistence-doctrine) extension for Doctrine.

First we have to create annotation reader:

```
use Fmasa\DoctrineYamlAnnotations\YamlReader;

$configuration = $entityManager->getConfiguration();
$reader = new YamlReader($configuration, [
    'enum' => EnumAnnotation::class
]);

```

Second argument for AnnotationReader is optional map with entity aliases.

Add annotations to your mapping files:

```
Some\Entity:

    ...

    fields:
        state:
            type: enum_string
            annotations:
                Consistence\Doctrine\Enum\EnumAnnotation: # or just enum
                    class: StateEnum
```

Now you can read annotations just using `Doctrine\Common\Annotations\Reader` API:

```
$reader->getPropertyAnnotation(
    (new \ReflectionClass(Some\Entity::class))->getProperty('state'),
    EnumAnnotation::class
); // returns instance of EnumAnnotation { class => "StateEnum" }
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

3074d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23986c5d998fff583e89fc5aaa96797c37b09eb1b037512b570a03590e19e06e?d=identicon)[fmasa](/maintainers/fmasa)

---

Top Contributors

[![fmasa](https://avatars.githubusercontent.com/u/5658260?v=4)](https://github.com/fmasa "fmasa (14 commits)")

---

Tags

doctrine-extensiondoctrine2php

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fmasa-doctrine-yaml-annotations/health.svg)

```
[![Health](https://phpackages.com/badges/fmasa-doctrine-yaml-annotations/health.svg)](https://phpackages.com/packages/fmasa-doctrine-yaml-annotations)
```

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1616.4k14](/packages/2lenet-crudit-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)

PHPackages © 2026

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