PHPackages                             paritybit/dependency-resolver - 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. paritybit/dependency-resolver

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

paritybit/dependency-resolver
=============================

A simple component to resolve dependencies

v1.0.0(10y ago)254MITPHPPHP &gt;=5.5.0

Since May 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/ParityBitSystems/dependency-resolver)[ Packagist](https://packagist.org/packages/paritybit/dependency-resolver)[ RSS](/packages/paritybit-dependency-resolver/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Simple dependency resolver
==========================

[](#simple-dependency-resolver)

[![Coverage Status](https://camo.githubusercontent.com/3efefa8f361231d562303ff24fb811091c2635b5417348b83f35b7f703cef771/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f50617269747942697453797374656d732f646570656e64656e63792d7265736f6c7665722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/ParityBitSystems/dependency-resolver?branch=master) [![Build Status](https://camo.githubusercontent.com/b5bdc3af873b9779664b5e0ddef052b1ec45f8c1c3f9c8c8562977636e71dd87/68747470733a2f2f7472617669732d63692e6f72672f50617269747942697453797374656d732f646570656e64656e63792d7265736f6c7665722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ParityBitSystems/dependency-resolver)

A simple framework for resolving dependencies in code and managing a mapping of configurations to determine how specific dependencies should be resolved.

This isn't optimal and there are likely better implementations out there, but I needed something very quickly for a few specific, temporary, use cases. So it may not be very useful in general.

Installation
------------

[](#installation)

With composer

```
php composer.phar require paritybit/dependency-resolver

```

Usage
-----

[](#usage)

There is an example `Resolution` implementation `CallableResolution`. A `Resolution`is the encapsulation of a particular dependency. If one of your dependencies is an object, then you would tell the `Resolution` how to create or get this object in order for it to be provided when something is dependent on it. In most cases you would want to create your own `Resolution` implementation. My own use case was to get an object from a container until the container could be refactored away.

Create a map of your dependencies

```
use ParityBit\DependencyResolver\DependencyMap;
use ParityBit\DependencyResolver\DependencyConfigurations\CallableResolution;
use My\Applications\Dependency;

$map = new DependencyMap();
$map->registerResolution(
    Dependency::class,
    new CallableResolution(function () {
        return new Dependency();
    })
);

```

Instantiate the appropriate resolver

```
$resolver = new ParityBit\DependencyResolver\ConstructorArgumentResolver($map);

```

Resolve your dependencies

```
use Class\With\Dependencies\In\Constructor as ToResolve;

// find dependencies, instantiate dependent object and inject dependencies
$resolved = $resolver->resolve(ToResolve::class);

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3700d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6132ed4ce3683ee41415742612934b9b6e521288782316250a7ede778711f8bf?d=identicon)[mkpeacock](/maintainers/mkpeacock)

---

Top Contributors

[![mkpeacock](https://avatars.githubusercontent.com/u/437037?v=4)](https://github.com/mkpeacock "mkpeacock (23 commits)")

---

Tags

dependenciesdependency resolver

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paritybit-dependency-resolver/health.svg)

```
[![Health](https://phpackages.com/badges/paritybit-dependency-resolver/health.svg)](https://phpackages.com/packages/paritybit-dependency-resolver)
```

###  Alternatives

[dephpend/dephpend

Dependency analysis for PHP

533102.4k2](/packages/dephpend-dephpend)[jbzoo/composer-graph

Render composer.json + composer.lock dependencies graph

67743.0k2](/packages/jbzoo-composer-graph)[mmoreram/symfony-bundle-dependencies

Dependencies resolver for Symfony Bundles

57193.7k54](/packages/mmoreram-symfony-bundle-dependencies)[symfony-bundles/bundle-dependency

Symfony BundleDependency Component

19139.5k8](/packages/symfony-bundles-bundle-dependency)[varunsridharan/wp-dependencies

Provides Function To Check if a plugin is active/inactive &amp; function to compare versions.

1032.5k1](/packages/varunsridharan-wp-dependencies)

PHPackages © 2026

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