PHPackages                             pitch/annotation - 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. [API Development](/categories/api)
4. /
5. pitch/annotation

ActiveSymfony-bundle[API Development](/categories/api)

pitch/annotation
================

Annotation abstraction for Doctrine Annotations and PHP8 attributes as (Controller) Annotations

v1.0.0(5y ago)13892MITPHPPHP &gt;=7.4

Since May 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ph-fritsche/symfony-annotation)[ Packagist](https://packagist.org/packages/pitch/annotation)[ RSS](/packages/pitch-annotation/feed)WikiDiscussions master Synced 6d ago

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

Annotation
==========

[](#annotation)

This bundle provides a unified API for [Doctrine Annotations](https://www.doctrine-project.org/projects/annotations.html) and [PHP8 Attributes](https://www.php.net/manual/de/language.attributes.overview.php) as (Controller) Annotations.

Usage
-----

[](#usage)

### Read attributes and annotations

[](#read-attributes-and-annotations)

```
namespace App;

use Attribute;
use Doctrine\Common\Annotation\Reader as DoctrineReader;
use Pitch\Annotation\Annotation;
use Pitch\Annotation\Reader as PitchReader;

/**
 * @Annotation
 */
#[Attribute]
class MyAnnotation implements Annotation
{
    public string $value;
}

/**
 * @MyAnnotation('foo')
 */
class MyClass
{
    #[MyAnnotation('bar')]
    public function myMethod() {}
}

$pitchReader = new PitchReader(new DoctrineReader());
$reflection = new ReflectionMethod(MyClass::class, 'myMethod');

foreach($pitchReader->getAnnotations($reflection)->all() as $annotation) {
    echo $annotation->value; // outputs: foobar
}
```

### Controller request attributes

[](#controller-request-attributes)

This bundle registers an `EventSubscriber` on the `kernel.controller` event and stores the controller annotations on `Request::attributes`, so that they can easily be accessed on other events.

```
namespace App\Annotation;

#[Attribute]
class MyAnnotation
{
    public function __construct(
        public string $value,
    ) {}
}
```

```
namespace App\Controller;

use Symfony\Component\HttpFoundation\Request;
use App\Annotation\MyAnnotation;

class MyController {
    #[MyAnnotation("foo")]
    #[MyAnnotation("bar")]
    public function __invoke(Request $request)
    {
        foreach ($request->attributes->get('_' . MyAnnotation::class) as $a) {
            echo $a->value; // outputs: foobar
        }
    }
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

1826d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/14faf0e942f2e3361ad07e017bf356d02bb7b76ab47d66a0d52faf4c03e6faec?d=identicon)[ph.fritsche](/maintainers/ph.fritsche)

---

Top Contributors

[![ph-fritsche](https://avatars.githubusercontent.com/u/39068198?v=4)](https://github.com/ph-fritsche "ph-fritsche (12 commits)")

---

Tags

symfonycontrollerannotationattribute

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pitch-annotation/health.svg)

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

###  Alternatives

[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

47073.9k5](/packages/deepseek-php-deepseek-php-client)[prooph/service-bus-symfony-bundle

88392.2k3](/packages/prooph-service-bus-symfony-bundle)

PHPackages © 2026

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