Naming conventions

This document is here to help you choose a name for your asset type.

As a general rule, the consumer (i.e. the package consuming the assets) should decide the name of the asset type.

Class assets

If your assets are classes that implement a common interface, it is a good practice to use the name of the interface as an asset type.

For instance:

discovery.json
{
    "Interop\\Container\\ServiceProviderInterface": "My\\ServiceProvider"
}

Here: the package is advertising that it contains a My\ServiceProvider class that implements the Interop\Container\ServiceProviderInterface. A container could use that information to discover all service providers implementing this interface.

Warning! The purpose of thecodingmachine/discovery is not to replace your favorite framework's dependency injection container! Most of the time, the dependency injection container from your framework can help you register a class provided by a package in your application. However, thecodingmachine/discovery can be very handy when you don't have a container yet (for instance it is very handy to provide service providers to the container when the container is still being built).

Other assets

If your assets are something else (maybe documentation files, or JS/CSS files, ...), we strongly recommend to prefix your assets name with your vendor name.

For instance:

discovery.json
{
    "my_vendor_name/docs": [
        "doc/index.md",
        "doc/advanced.md"
    ]
}

Found a typo? Something is wrong in this documentation? Just fork and edit it!