PHPackages                             dangerousdan/dimaria - 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. dangerousdan/dimaria

ActiveLibrary

dangerousdan/dimaria
====================

A super fast Dependency Injection Container for PHP 7+

1.2.0(8y ago)41381BSD-2-ClausePHPPHP ^7

Since Feb 27Pushed 6y ago1 watchersCompare

[ Source](https://github.com/dangerousdan/DiMaria)[ Packagist](https://packagist.org/packages/dangerousdan/dimaria)[ Docs](https://github.com/dangerousdan/dimaria)[ RSS](/packages/dangerousdan-dimaria/feed)WikiDiscussions master Synced today

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

DiMaria Dependency Injector
===========================

[](#dimaria-dependency-injector)

[![Build Status](https://camo.githubusercontent.com/1bd9eb257f73f1f0e935265f8101c20069dd784e06c98d674ad4f8cb9af86a98/68747470733a2f2f7472617669732d63692e6f72672f64616e6765726f757364616e2f44694d617269612e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dangerousdan/DiMaria)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ea5582dbdc9559bf8b03821e738d3de7f765a3d743fa602c856454d4b9682352/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64616e6765726f757364616e2f44694d617269612f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dangerousdan/DiMaria/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/28ba8bc3713e5f941d4af09755c17447feac5db860ce0711f195b3cd8c694697/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64616e6765726f757364616e2f44694d617269612f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dangerousdan/DiMaria/?branch=master)[![Build Status](https://camo.githubusercontent.com/829c0a80afaeb33ac2a496920aa99ea9864f9b182ff12aee1d2d6f3591d25276/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64616e6765726f757364616e2f44694d617269612f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/dangerousdan/DiMaria/build-status/master)[![Code Climate](https://camo.githubusercontent.com/746dec55cad97b02d900a63bd6e3d2833a4ef4724f1940c94144b5b2464d0649/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f64616e6765726f757364616e2f44694d617269612f6261646765732f6770612e737667)](https://codeclimate.com/github/dangerousdan/DiMaria)[![SensioLabsInsight](https://camo.githubusercontent.com/17392b3d13a77b695a51ae973215c3be098102e4de07bf85d9c21dcedb568208/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f61303035313437302d616563642d343566322d616536322d3034663164643464353137652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/a0051470-aecd-45f2-ae62-04f1dd4d517e)

DiMaria is a Dependency Injection Container for PHP 7+ with no dependencies. It's written to be extremely fast and lightweight.

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

[](#installation)

Fetch DiMaria with composer via packagist. Add it with

```
composer require dangerousdan/dimaria

```

Usage
-----

[](#usage)

DiMaria should work out of the box. Just call `get()` with the class name you wish to create.

```
$di = new DD\DiMaria;
$object = $di->get('ClassName');

```

DiMaria implements the [PSR7 Container interface](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-11-container.md).

DiMaria can:

- Automatically fetch type-hinted dependencies in classes
- Set and override parameters and create aliases
- Set preferences for interfaces or classes
- Configure classes to return shared or new instances
- Support variadic parameters
- Configure Setter injection

For more info, see [the docs](http://dangerousdan.github.io/DiMaria/)

[![DiMaria](https://camo.githubusercontent.com/bee3a317a956831a3477089c2ccd2a49614979e55b83bcdecf696c35d5bb907a/687474703a2f2f6e6577732e626263696d672e636f2e756b2f6d656469612f696d616765732f37353937393030302f6a70672f5f37353937393832305f676f616c63656c6562732e6a7067)](https://camo.githubusercontent.com/bee3a317a956831a3477089c2ccd2a49614979e55b83bcdecf696c35d5bb907a/687474703a2f2f6e6577732e626263696d672e636f2e756b2f6d656469612f696d616765732f37353937393030302f6a70672f5f37353937393832305f676f616c63656c6562732e6a7067)

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

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 ~343 days

Total

3

Last Release

2989d ago

PHP version history (2 changes)1.0.0PHP ~7.0

1.2.0PHP ^7

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

dependency-injectiondidicdependency injection container

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dangerousdan-dimaria/health.svg)

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

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k47.0M874](/packages/php-di-php-di)[laminas/laminas-servicemanager

Factory-Driven Dependency Injection Container

15954.0M648](/packages/laminas-laminas-servicemanager)[aura/di

A serializable dependency injection container with constructor and setter injection, interface and trait awareness, configuration inheritance, and much more.

357963.4k50](/packages/aura-di)[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.

438712.4k16](/packages/level-2-dice)[mrclay/props-dic

Props is a simple DI container that allows retrieving values via custom property and method names

3611.3M2](/packages/mrclay-props-dic)[woohoolabs/zen

Woohoo Labs. Zen DI Container and preload file generator

976.2k](/packages/woohoolabs-zen)

PHPackages © 2026

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