PHPackages                             shadowhand/cairon - 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. shadowhand/cairon

AbandonedArchivedLibrary

shadowhand/cairon
=================

Configuration wrapper for auryn dependency injector

0.1.0(9y ago)1363MITPHPPHP &gt;=5.6

Since Apr 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/shadowhand/cairon)[ Packagist](https://packagist.org/packages/shadowhand/cairon)[ RSS](/packages/shadowhand-cairon/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

cairon
======

[](#cairon)

[![Become a Supporter](https://camo.githubusercontent.com/28a4011c597c1f2866c7419fcefd80ec11a8591e34f94612242c09e86e8a30dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70617472656f6e2d73706f6e736f722532306d652d6536343631612e737667)](https://www.patreon.com/shadowhand)[![Latest Stable Version](https://camo.githubusercontent.com/917a4566b7d9eb620c1b0c7c5e4a453512a2399d3318b6e9727e6b4183fad6ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636169726f6e2f636169726f6e2e737667)](https://packagist.org/packages/shadowhand/cairon)[![License](https://camo.githubusercontent.com/0f00bfdb688b6123788628d8ee0d9f85e79012e679fc09c090701b52c3bb6ac5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736861646f7768616e642f636169726f6e2e737667)](https://github.com/shadowhand/cairon/blob/master/LICENSE)[![Build Status](https://camo.githubusercontent.com/8661ee637c3f52f324d2943c12e726cb507d4a160bec3f0044305fdfd5cfd038/68747470733a2f2f7472617669732d63692e6f72672f736861646f7768616e642f636169726f6e2e737667)](https://travis-ci.org/shadowhand/cairon)[![Code Coverage](https://camo.githubusercontent.com/aead8d6682cfe6356de41c3ba6657d6dfd5a5af3d70aaee6cb1bdf08fd0de2ec/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736861646f7768616e642f636169726f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/shadowhand/cairon/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/57d2d3fa5785ccd3bd6e1a1b7dfd258e4c4603fcda2aff93e5cb40e43422d174/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f736861646f7768616e642f636169726f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/shadowhand/cairon/?branch=master)

A tiny wrapper around an [auryn](https://github.com/elazar/auryn-configuration) that provides configuration capabilities. Attempts to be [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/), and [PSR-4](http://www.php-fig.org/psr/psr-4/) compliant.

Usage
-----

[](#usage)

The basic purpose of cairon is to apply callable configurations to auryn.

This is done using either `configure()` with a list of callables, or `apply()`with a single callable.

```
use Auryn\Injector;
use Cairon\InjectorConfig;

$injector = InjectorConfig::make()
    ->configure([
        Acme\Injector\Foo::class,
        ['SomeClass::staticMethod']
        function (Injector $injector) { /* ... */ }
        // ...
    ])
    ->apply([$someObject, 'method'])
    ->injector();
```

### Callables

[](#callables)

The only requirement for the [callable](https://github.com/elazar/auryn-configuration) is that it accept an instance of `Auryn\Injector` as the first and only argument:

```
fn(Injector $injector): void

```

***Note:** If the provided configuration is not currently callable, it is assumed to be a class name and will be resolved by calling `Injector::make()`.*

### Best Practice

[](#best-practice)

The preferred approach to using cairon is by creating a closure that is included. This removes the need to create a concrete class for configuration and promotes the idea that auryn is only used in bootstrapping.

For example, we could create `config/injection/psr7.php`:

```
use Auryn\Injector;
use Psr\Http\Message\ServerRequestInterface;
use Zend\Diactoros\ServerRequest;
use Zend\Diactoros\ServerRequestFactory;

return function (Injector $injector) {
    $injector->alias(ServerRequestInterface::class, ServerRequest::class);
    $injector->delegate(ServerRequestInterface::class, 'ServerRequestFactory::fromGlobals');
};
```

And then apply it in our bootstrap:

```
use Cairon\InjectorConfig;

$injector = InjectorConfig::make()
    ->configure([
        require __DIR__ . '/config/injection/psr7.php',
    ])
    ->injector();
```

### Existing Injector

[](#existing-injector)

If you already have an instance of `Auryn\Injector` it can be provided to the constructor:

```
$injector = new Injector();

$config = InjectorConfig::make($injector);

assert($injector === $config->injector());
```

Inspiration
-----------

[](#inspiration)

The theory behind cairon comes from [elazar/auryn-configuration](https://github.com/elazar/auryn-configuration). This same theory was also adopted by [equip/config](https://github.com/equip/config). My goal was to simplify the theory into a wrapper that could be used with any callable, without implementing a concrete interface.

License
-------

[](#license)

MIT.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

3332d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38203?v=4)[Woody Gilk](/maintainers/shadowhand)[@shadowhand](https://github.com/shadowhand)

---

Top Contributors

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

---

Tags

aurynconfigurationphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/shadowhand-cairon/health.svg)

```
[![Health](https://phpackages.com/badges/shadowhand-cairon/health.svg)](https://phpackages.com/packages/shadowhand-cairon)
```

###  Alternatives

[kelunik/acme-client

Let's Encrypt / ACME client written in PHP for the CLI.

3933.9k1](/packages/kelunik-acme-client)[honeybee/honeybee

Library for implementing CQRS driven, event-sourced and distributed architectures.

222.1k4](/packages/honeybee-honeybee)

PHPackages © 2026

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