jms/metadata
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The jms/metadata is a powerful library for class, method, and property metadata management in PHP. The library provides base classes for managing metadata that can come from various sources, such as annotations and configuration files in YAML, XML, or PHP. By abstracting these sources, jms/metadata provides a unified interface for them, making metadata management simple and straightforward for developers.
To use jms/metadata in your PHP project, start by extending the ClassMetadata
, MethodMetadata
, and PropertyMetadata
classes provided by the library, adding your application-specific properties and flags. Then, add DriverInterface
implementations that know how to populate these classes from your chosen metadata sources.
To retrieve the metadata, create an instance of MetadataFactory
using your chosen drivers, and call the getMetadataForClass
method, passing the name of your class as an argument.
Here's an example:
<?php
use Metadata\MetadataFactory;
use Metadata\Driver\DriverChain;
// Add your chosen drivers here.
$driver = new DriverChain([
// Annotation, YAML, XML, PHP, ... drivers
]);
$factory = new MetadataFactory($driver);
// Retrieve the metadata for your class.
$metadata = $factory->getMetadataForClass('MyNamespace\MyObject');
Remember to replace 'MyNamespace\MyObject'
with the actual name of your class.
The JMS/Metadata library documentation, along with other resources and details, can be accessed from its official GitHub repository at https://github.com/schmittjoh/metadata. However, the README is currently the primary source of documentation. It provides an overview of the library, usage instructions, and links to the library's Travis CI and Scrutinizer CI pages, where you can find additional information about build status and code coverage. If you need more details or have questions about the library, the Issues tab of the GitHub repository is a useful place to start.