PHPackages                             jms/metadata - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. jms/metadata

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

jms/metadata
============

Class/method/property metadata management in PHP

2.9.0(5mo ago)1.8k152.8M—5.4%71[5 issues](https://github.com/schmittjoh/metadata/issues)[3 PRs](https://github.com/schmittjoh/metadata/pulls)20MITPHPPHP ^7.2|^8.0CI failing

Since Jan 2Pushed 5mo ago11 watchersCompare

[ Source](https://github.com/schmittjoh/metadata)[ Packagist](https://packagist.org/packages/jms/metadata)[ RSS](/packages/jms-metadata/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (34)Used By (20)

Metadata is a library for class/method/property metadata management in PHP
==========================================================================

[](#metadata-is-a-library-for-classmethodproperty-metadata-management-in-php)

[Master (2.x)](https://travis-ci.org/schmittjoh/metadata)[1.x](https://github.com/schmittjoh/metadata/tree/1.x)[![Build status](https://camo.githubusercontent.com/d264437cdcbaa6df61aa091284a202d383583ef54cc7a363806ba6edf921e6fd/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7363686d6974746a6f682f6d657461646174612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/schmittjoh/metadata)[![Build status](https://camo.githubusercontent.com/2837cf2ed20a2c1c071a44fa33b1878473385faa91fcc84949bfd7c3c12d3e5a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7363686d6974746a6f682f6d657461646174612f312e782e7376673f7374796c653d666c61742d737175617265)](https://github.com/schmittjoh/metadata/tree/1.x)[![Coverage Status](https://camo.githubusercontent.com/2bcaa1f588d65f7aff35c74150d5fc3b319e4af07ab6bac99be6c54371cf5ce0/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7363686d6974746a6f682f6d657461646174612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/schmittjoh/metadata/?branch=master)[![Coverage Status](https://camo.githubusercontent.com/f080e63abfbc3f0aaa1c29f92b6ffa4d4ecd147c6bf0647bcee613612313fcae/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7363686d6974746a6f682f6d657461646174612f312e782e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/schmittjoh/metadata/?branch=1.x)Overview
--------

[](#overview)

This library provides some commonly needed base classes for managing metadata for classes, methods and properties. The metadata can come from many different sources (annotations, YAML/XML/PHP configuration files).

The metadata classes are used to abstract away that source and provide a common interface for all of them.

Usage
-----

[](#usage)

The library provides three classes that you can extend to add your application specific properties, and flags: `ClassMetadata`, `MethodMetadata`, and `PropertyMetadata`

After you have added, your properties in sub-classes, you also need to add `DriverInterface` implementations which know how to populate these classes from the different metadata sources.

Finally, you can use the `MetadataFactory` to retrieve the metadata::

```
