git404hub

what is annotations fr?

doctrine/annotations — explained in plain English

Analysis updated 2026-06-24

6,745PHPAudience · developerComplexity · 2/5LicenseSetup · moderate

tl;dr

A PHP library that reads special tags written in code comments and converts them into structured data, letting frameworks like Symfony configure routing and database mappings from those comments.

vibe map

mindmap
  root((doctrine/annotations))
    What it does
      Parse PHP docblocks
      Extract annotation tags
    Typical use
      Route configuration
      ORM mappings
      Framework config
    Status
      Feature-complete
      Security fixes only
    Migration path
      PHP 8 native attributes
      No new features
    Origin
      From Doctrine Common
      Extracted for reuse

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Parse @Route or @ORM annotations in PHP docblocks so your framework can configure routing or database mappings directly from comments above each method.

VIBE 2

Build a PHP library that lets users configure behavior through annotations in code comments rather than separate configuration files.

what's the stack?

PHP

how it stacks up fr

doctrine/annotationsaonez/kekasebastianbergmann/environment
Stars6,7456,7726,779
LanguagePHPPHPPHP
Setup difficultymoderateeasyeasy
Complexity2/51/51/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 30min

New projects should use PHP 8 native attributes instead, this library is in maintenance mode with no new features planned.

Use freely for any purpose including commercial use, keep the copyright notice.

in plain english

Doctrine Annotations is a PHP library that reads special tags written inside code comments (called docblocks) and turns them into structured data that applications can act on. For example, a developer might write a tag like @Route("/homepage") in a comment above a function, and this library parses that tag so a web framework knows to connect that URL to that function. The idea is to put configuration directly alongside the code it describes rather than in separate files. The library was originally part of Doctrine Common, a set of shared utilities used across the Doctrine database toolkit for PHP. It was extracted into its own package so other projects could use the annotation parsing feature independently. The README includes an important note for anyone considering adopting this library: PHP 8 added native support for a similar concept called attributes, which accomplish the same goal through built-in language syntax rather than parsed comments. The Doctrine team considers this library feature-complete and recommends that new projects use PHP attributes instead. Libraries that currently depend on Doctrine Annotations are encouraged to add attribute-based alternatives for their users. For existing projects that already use it, the library will continue to receive security and bug fixes, but no new features are planned. Full documentation is on the Doctrine project website.

prompts (copy fr)

prompt 1
I have a PHP class with Doctrine-style @Route annotations in its docblocks. Show me how to use Doctrine Annotations to read those annotations and extract the route paths.
prompt 2
I'm migrating a PHP project from Doctrine Annotations to native PHP 8 attributes. Help me write equivalent attribute classes for my existing annotation classes.
prompt 3
Using Doctrine Annotations, help me create a custom @Validate annotation that stores validation rules I can read at runtime in my PHP framework.

Frequently asked questions

what is annotations fr?

A PHP library that reads special tags written in code comments and converts them into structured data, letting frameworks like Symfony configure routing and database mappings from those comments.

What language is annotations written in?

Mainly PHP. The stack also includes PHP.

What license does annotations use?

Use freely for any purpose including commercial use, keep the copyright notice.

How hard is annotations to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is annotations for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.