PHPackages                             thecodingmachine/service-provider-utils - 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. thecodingmachine/service-provider-utils

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

thecodingmachine/service-provider-utils
=======================================

This package contains a set of tools to work with container-interop's service-providers.

1.0.x-dev(10y ago)14MITPHP

Since Apr 19Pushed 10y ago6 watchersCompare

[ Source](https://github.com/thecodingmachine/service-provider-utils)[ Packagist](https://packagist.org/packages/thecodingmachine/service-provider-utils)[ RSS](/packages/thecodingmachine-service-provider-utils/feed)WikiDiscussions 1.0 Synced 2mo ago

READMEChangelogDependencies (3)Versions (1)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/43926f54d7de45a0e1700da790a2c82b8e57392915545b1e11a04554aceeb45e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f746865636f64696e676d616368696e652f736572766963652d70726f76696465722d7574696c732f6261646765732f7175616c6974792d73636f72652e706e673f623d312e30)](https://scrutinizer-ci.com/g/thecodingmachine/service-provider-utils/?branch=1.0)[![Build Status](https://camo.githubusercontent.com/3f25d55ef68ba6c65f960c7f1e5cec938d0b5e99f871dc42de5a968e768d0444/68747470733a2f2f7472617669732d63692e6f72672f746865636f64696e676d616368696e652f736572766963652d70726f76696465722d7574696c732e7376673f6272616e63683d312e30)](https://travis-ci.org/thecodingmachine/service-provider-utils)[![Coverage Status](https://camo.githubusercontent.com/060d1618354e065d0b298e9647e87be60d22766a91f208d17eb8555f0db8cfeb/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f746865636f64696e676d616368696e652f736572766963652d70726f76696465722d7574696c732f62616467652e7376673f6272616e63683d312e3026736572766963653d676974687562)](https://coveralls.io/github/thecodingmachine/service-provider-utils?branch=1.0)

Service-provider utils
======================

[](#service-provider-utils)

This package contains a set of tools to work with [container-interop's service-providers](https://github.com/container-interop/definition-interop/).

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

[](#installation)

You can install this package through Composer:

```
{
    "require": {
        "thecodingmachine/service-provider-utils": "~1.0"
    }
}
```

The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility between minor versions.

Usage
-----

[](#usage)

This package contains a single utility method that analyses a factory (i.e. a callable) and returns if the second argument (the `$previous` argument) is used or not.

```
// $previous is not used in this callable
$callable = function(ContainerInterface $container, $previous) {
    return new MyService();
});

$factoryAnalyser = new FactoryAnalyzer();
$isPreviousUsed = $factoryAnalyser->isPreviousArgumentUsed($callable);
// $isPreviousUsed === false
```

Note: this function can sometimes return false positives, in particular if your body contains calls to `func_get_args` or refences by variable name (`$$foo`). It should however never return false negatives.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

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

3678d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

![](https://avatars.githubusercontent.com/u/1847918?v=4)[TheCodingMachine](/maintainers/thecodingmachine)[@thecodingmachine](https://github.com/thecodingmachine)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thecodingmachine-service-provider-utils/health.svg)

```
[![Health](https://phpackages.com/badges/thecodingmachine-service-provider-utils/health.svg)](https://phpackages.com/packages/thecodingmachine-service-provider-utils)
```

###  Alternatives

[infinum/eightshift-libs

WordPress libs developed by Eightshift team to use in modern WordPress.

63118.9k3](/packages/infinum-eightshift-libs)[moltin/laravel-cart

Shopping cart package

27624.9k](/packages/moltin-laravel-cart)[andriichuk/laracash

PHP Laravel Money Package

74108.2k1](/packages/andriichuk-laracash)

PHPackages © 2026

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