PHPackages                             xylemical/composer-discovery - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xylemical/composer-discovery

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

xylemical/composer-discovery
============================

Provides a composer plugin for discovery of items within packages.

05PHP

Since Jun 30Pushed 4y ago1 watchersCompare

[ Source](https://github.com/xylemical/composer-discovery)[ Packagist](https://packagist.org/packages/xylemical/composer-discovery)[ RSS](/packages/xylemical-composer-discovery/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Composer discovery
==================

[](#composer-discovery)

Provides composer with a way to perform discovery processes.

Install
-------

[](#install)

The recommended way to install this library is [through composer](http://getcomposer.org).

```
composer require xylemical/composer-discovery
```

Usage
-----

[](#usage)

Once a discovery process has been defined in a package, any package or project that requires the package will have the discovery applied.

Adding a discovery is as simple as defining the discovery class in the extra key of the composer.json file:

```
{
  "extra": {
    "discovery": [
      "My\\Discovery"
    ]
  }
}
```

An example discovery that prints out all the package readme files is as follows:

```
namespace My;

use Xylemical\Composer\Discovery\ComposerDiscoveryBase;

/**
 * Performs output of README.md for any package that defines it.
 */
class Discovery extends ComposerDiscoveryBase {

  /**
   * {@inheritdoc}
   */
  public function getName(): string {
    return 'My Discovery';
  }

  /**
   * {@inheritdoc}
   */
  public function discover(Package $package): void {
    $path = $package->getPath() . '/README.md';
    if (file_exists($path)) {
      $this->io->write(file_get_contents($path));
    }
  }

}
```

License
-------

[](#license)

MIT, see LICENSE.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a6f5fc80d04ffca782072d391a679cd679265cf62959fb6f67749f6063199eb?d=identicon)[rhys-mcguckin](/maintainers/rhys-mcguckin)

---

Top Contributors

[![rhys-mcguckin](https://avatars.githubusercontent.com/u/5679170?v=4)](https://github.com/rhys-mcguckin "rhys-mcguckin (5 commits)")

### Embed Badge

![Health badge](/badges/xylemical-composer-discovery/health.svg)

```
[![Health](https://phpackages.com/badges/xylemical-composer-discovery/health.svg)](https://phpackages.com/packages/xylemical-composer-discovery)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
