PHPackages                             chkt/eve - 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. chkt/eve

ActiveLibrary

chkt/eve
========

A minimalistic and flexible and powerful dependency injection system

v1.0.0(7y ago)0562MITPHPPHP ^7.0

Since May 3Pushed 7y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (6)Used By (2)

eve
===

[](#eve)

A minimalistic, flexible and powerful dependency injector
---------------------------------------------------------

[](#a-minimalistic-flexible-and-powerful-dependency-injector)

eve is a small (~250 lines of executable code), self contained *dependency injector*choosing a *configuration approach* over reflection, annotations or similar meta-programming techniques.

Dependencies are defined in code alongside their classes offering a high level of control over object creation, sharing and caching.

### Install

[](#install)

You can use *composer* to install eve.

#### Command line

[](#command-line)

```
$ php composer.phar install chkt/eve
```

#### composer.son

[](#composerson)

```
{
  "require" : {
    "chkt/eve" : ""
  }
}
```

Alternatively you can clone the *github repository* to a place of your liking.

```
$ git clone https://github.com/chkt/eve.git
```

### Basic usage

[](#basic-usage)

The injector depends on a couple of helpers to resolve and inject dependencies. All of these are combined into the `InjectorDriver`.

```
use \eve\common\factory\BaseFactory;
use \eve\driver\InjectorDriverFactory;

$base = new BaseFactory();
$factory = $base->produce(InjectorDriverFactory::class, [ $base ]);
$driver = $factory->produce([...]);
```

The *first* line creates the `BaseFactory`, which supplies the basic means of instantiating objects. In the *second* line the BaseFactory is used to create the `InjectorDriverFactory`, which in line *three* creates the `InjectorDriver`.

The types of injectable objects depend on the configuration of the driver. The options for configuring the driver are listed in the [driver folder](./source/driver/readme.md).

Using the injector is straightforwand.

```
$injector = $driver->getInjector();

$object = $injector->produce(\namespace\ClassName::class, [...]);
```

The optional second argument allows additional configuration options to be passed to the injector.

Since eve is not using reflection or other meta-programming techniques, it depends on injectable objects implementing `\eve\inject\IInjectable`, which defines the single static method `getDependencyConfig`.

```
use eve\access\ITraverableAccessor;
use eve\inject\IInjectable;
use eve\inject\IInjector;

class ExampleClass
implements IInjectable
{

  static public function getDependencyConfig(ITraversableAccessor $config) {
    return [
      'injector:',
      'providerName:providableObject?key=value',
      [
        'type' => 'argument',
        'data' => $config->hasItem('options') ? $config->getItem('options') : []
      ]
    ];
  }

  public function __construct(IInjector $injector, ProvidableObject $object, array $options) {

  }
}
```

The `getDependencyConfig` method defines what kind of arguments new instances of the class are to be created with.

Dependencies can either be *arrays* with a `'type'` and one or more additional keys, or be defined using *entity* syntax, referring to dependencies through url formatted *strings*.

In the example above the injector will inject itself as the first constructor argument. The second argument is an object registered as `'providableObject'` at the provider named `'providerName'`and configured with `key=value`.

If the injector was supplied with an array containing a property named `'options'`, as its second argument, it is supplied as the third argument.

```
$injector->produce(\exampleNamespace\ExampleClass::class, [ 'options' => [...] ]);
```

If no second argument was supplied to the injector or it did not contain an `'options'` property, `getDependencyConfig` returns an empty array as the third argument.

```
$injector->produce(\exampleNamespace\ExampleClass::class);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~5 days

Total

5

Last Release

2911d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2e52b90c6e2fba71654e5a77e791164e526007e42badc85a240bd8280fff08a?d=identicon)[chkt](/maintainers/chkt)

---

Top Contributors

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

---

Tags

factorydependency-injectiondiproviderlocatorDependency-Container

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chkt-eve/health.svg)

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

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[league/container

A fast and intuitive dependency injection container.

86387.8M343](/packages/league-container)[nette/di

💎 Nette Dependency Injection Container: Flexible, compiled and full-featured DIC with perfectly usable autowiring and support for all new PHP features.

92140.6M1.4k](/packages/nette-di)[laminas/laminas-servicemanager

Factory-Driven Dependency Injection Container

15955.1M694](/packages/laminas-laminas-servicemanager)[level-2/dice

A minimalist Dependency injection container (DIC) for PHP. Please note: 3.0+ is only compatible with PHP 7.0. The 2.0 branch is compatbile with PHP 5.6.

437730.3k17](/packages/level-2-dice)[yiisoft/injector

PSR-11 compatible injector. Executes a callable and makes an instances by injecting dependencies from a given DI container.

942.8M38](/packages/yiisoft-injector)

PHPackages © 2026

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