{"id":19476675,"url":"https://github.com/biurad/php-annotations","last_synced_at":"2026-03-08T12:39:09.689Z","repository":{"id":48111588,"uuid":"309021313","full_name":"biurad/php-annotations","owner":"biurad","description":"⚡  A library that provides a Simple, Lazy, Fast \u0026 Lightweight Doctrine Annotations and PHP 8 Attribute reader for your project.","archived":false,"fork":false,"pushed_at":"2024-03-13T12:00:20.000Z","size":124,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T21:49:38.631Z","etag":null,"topics":["annotations","attribute-reader","biurad","doctrine-annotations","php","phpdoc","phpdoc-comments"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/biurad.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"biurad","custom":["https://biurad.com/sponsor"]}},"created_at":"2020-11-01T04:15:03.000Z","updated_at":"2022-04-10T10:04:04.000Z","dependencies_parsed_at":"2024-11-10T19:41:42.606Z","dependency_job_id":"d63f5f37-1062-4076-93e9-f39747f7fa4a","html_url":"https://github.com/biurad/php-annotations","commit_stats":{"total_commits":79,"total_committers":3,"mean_commits":"26.333333333333332","dds":0.07594936708860756,"last_synced_commit":"4070e524fce0e6e53e8f76ab3cae353121020c04"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":"biurad/php-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biurad%2Fphp-annotations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biurad%2Fphp-annotations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biurad%2Fphp-annotations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/biurad%2Fphp-annotations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/biurad","download_url":"https://codeload.github.com/biurad/php-annotations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250834166,"owners_count":21494921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["annotations","attribute-reader","biurad","doctrine-annotations","php","phpdoc","phpdoc-comments"],"created_at":"2024-11-10T19:41:26.387Z","updated_at":"2026-03-08T12:39:09.633Z","avatar_url":"https://github.com/biurad.png","language":"PHP","readme":"\u003cdiv align=\"center\"\u003e\n\n# The Poakium Annotations\n\n[![Latest Version](https://img.shields.io/packagist/v/biurad/annotations?include_prereleases\u0026label=Latest\u0026style=flat-square)](https://packagist.org/packages/biurad/annotations)\n[![Workflow Status](https://img.shields.io/github/actions/workflow/status/biurad/poakium/ci.yml?branch=master\u0026label=Workflow\u0026style=flat-square)](https://github.com/biurad/poakium/actions?query=workflow)\n[![Software License](https://img.shields.io/badge/License-BSD--3-brightgreen.svg?\u0026label=Poakium\u0026style=flat-square)](LICENSE)\n[![Maintenance Status](https://img.shields.io/maintenance/yes/2023?label=Maintained\u0026style=flat-square)](https://github.com/biurad/poakium)\n\n\u003c/div\u003e\n\n---\n\nA lightweight [PHP][1] library providing simple, fast, and easy use of [Doctrine Annotations][2] and [Attributes][3] support for your [PHP][1] projects.\nThis can help to improve code organization, reduce the risk of errors, and make it easier to maintain and update code over time. From [PHP][1] 7.2 to 7.4 projects requires installing [`spiral/attributes`][4].\n\n## 📦 Installation\n\nThis project requires [PHP][1] 7.2 or higher. The recommended way to install, is by using [Composer][5]. Simply run:\n\n```bash\n$ composer require biurad/annotations\n```\n\n## 📍 Quick Start\n\nThis library acts as a manager enabling you use all your annotations/attributes in one place. Add all resources you want fetch annotations/attributes from using the `resource()` method. Then add your listener(s) which will listeners to your annotated/attributed implementation. Use the `load()` method when you want to use the returned result of a specific listener. **(NB: Listeners can be named)**.\n\nHere is an example of how to use the library:\n\n```php\nuse Biurad\\Annotations\\AnnotationLoader;\nuse Spiral\\Attributes\\AnnotationReader;\nuse Spiral\\Attributes\\AttributeReader;\nuse Spiral\\Attributes\\Composite\\MergeReader;\n\n// The doctrine annotation reader requires doctrine/annotations library\n$doctrine = new AnnotationReader();\n\n// With spiral/attributes library, we can use PHP 8 attributes in PHP 7.2 +\n$attribute = new AttributeReader();\n\n// Create a new annotation loader from readers ...\n$annotation = new AnnotationLoader(new MergeReader([$doctrine, $attribute]));\n\n$annotation-\u003elistener(...); // Add your implemented Annotation listeners\n\n$annotation-\u003eresource(...); // Add a class/function string, class file, or directory\n\n$listeners = $annotation-\u003eload(); // Compile once, then load cached ...\n\n// To use a collector you implemented into your instance of `Biurad\\Annotations\\ListenerInterface`\nforeach ($listeners as $collector) {\n    // You can fetch the required $collector from here.\n}\n```\n\n\u003e **NB:** If you are on [PHP][1] 8 and wishes to use attributes only, please avoid using [`spiral/attributes`][4] package for best performance, contributing to why this library was not shipped with [`spiral/attributes`][4] package.\n\n## 📓 Documentation\n\nIn-depth documentation on how to use this library can be found at [docs.biurad.com][6]. It is also recommended to browse through unit tests in the [tests](./tests/) directory.\n\n## 🙌 Sponsors\n\nIf this library made it into your project, or you interested in supporting us, please consider [donating][7] to support future development.\n\n## 👥 Credits \u0026 Acknowledgements\n\n- [Divine Niiquaye Ibok][8] is the author this library.\n- [All Contributors][9] who contributed to this project.\n\n## 📄 License\n\nPoakium Annotations is completely free and released under the [BSD 3 License](LICENSE).\n\n[1]: https://php.net\n[2]: https://github.com/doctrine/annotations\n[3]: https://php.watch/versions/8.0/attributes\n[4]: https://github.com/spiral/attributes\n[5]: https://getcomposer.org\n[6]: https://docs.biurad.com/poakium/annotations\n[7]: https://biurad.com/sponsor\n[8]: https://github.com/divineniiquaye\n[9]: https://github.com/biurad/php-annotations/contributors\n","funding_links":["https://patreon.com/biurad","https://biurad.com/sponsor"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiurad%2Fphp-annotations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbiurad%2Fphp-annotations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbiurad%2Fphp-annotations/lists"}