PHPackages                             lion/dependency-injection - 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. [Framework](/categories/framework)
4. /
5. lion/dependency-injection

ActiveLibrary[Framework](/categories/framework)

lion/dependency-injection
=========================

Container for dependency injection with DI-PHP.

v5.1.0(2mo ago)14.4k↑925%2MITPHPPHP &gt;=8.5CI passing

Since Jan 8Pushed 2mo agoCompare

[ Source](https://github.com/lion-packages/dependency-injection)[ Packagist](https://packagist.org/packages/lion/dependency-injection)[ Docs](https://dev.lion-packages.com)[ RSS](/packages/lion-dependency-injection/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelog (10)Dependencies (14)Versions (36)Used By (2)

 [ ![presentation-lion-packages](https://private-user-images.githubusercontent.com/56183278/520999732-19ddbc0a-8d5b-495f-9568-e5e115e22378.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0MzUyNjcsIm5iZiI6MTc3NDQzNDk2NywicGF0aCI6Ii81NjE4MzI3OC81MjA5OTk3MzItMTlkZGJjMGEtOGQ1Yi00OTVmLTk1NjgtZTVlMTE1ZTIyMzc4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzI1VDEwMzYwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE3ZDVlZTNlZTBhNjVkMjI2NGZlZDM0ODdjZWExNzM3YzZiMmUwYjFiNzYyNWMwMjJjNWI1ZWZjMTU0MTVjMmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.D_DqwSOibNLx41sj0C2k8fhpneOBCd8CO2mYknTZbF8) ](https://dev.lion-packages.com/docs/library/content)

 [ ![Latest Stable Version](https://camo.githubusercontent.com/0c51e53fed9c06596b21666aadf934df5245c2aa3af0eae6dcccf2ccc7667e9a/68747470733a2f2f706f7365722e707567782e6f72672f6c696f6e2f646570656e64656e63792d696e6a656374696f6e2f76) ](https://packagist.org/packages/lion/dependency-injection) [ ![Total Downloads](https://camo.githubusercontent.com/252f3d76aeebe8df5ba7d1c17e201c282549b0a26d7b14d6cbf2b802a63fbaea/68747470733a2f2f706f7365722e707567782e6f72672f6c696f6e2f646570656e64656e63792d696e6a656374696f6e2f646f776e6c6f616473) ](https://packagist.org/packages/lion/dependency-injection) [ ![License](https://camo.githubusercontent.com/f3201190b5ce93a0c6f33543f2562ce24f69df04f380d03dade5643f0b5dc3d9/68747470733a2f2f706f7365722e707567782e6f72672f6c696f6e2f646570656e64656e63792d696e6a656374696f6e2f6c6963656e7365) ](https://github.com/lion-packages/dependency-injection/blob/main/LICENSE) [ ![PHP Version Require](https://camo.githubusercontent.com/6ae83f5d7668c063866dd6a0b65bf963db081fb68b9c74ab5d12c34aec845d67/68747470733a2f2f706f7365722e707567782e6f72672f6c696f6e2f646570656e64656e63792d696e6a656374696f6e2f726571756972652f706870) ](https://www.php.net/)

🚀 **Lion-DependencyInjection** Container for dependency injection with DI-PHP.

---

📖 Features
----------

[](#-features)

✔️ Resolves a class or dependency from the container.
✔️ Calls a method on an object with automatic dependency injection.
✔️ Executes a callback with automatic dependency injection.

---

📦 Installation
--------------

[](#-installation)

Install the dependency-injection using **Composer**:

```
composer require lion/dependency-injection
```

Usage Example #1
----------------

[](#usage-example-1)

```
