PHPackages                             corex/ioc - 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. corex/ioc

Abandoned → [corex/container](/?search=corex%2Fcontainer)Library[Framework](/categories/framework)

corex/ioc
=========

CoRex IoC

1.0.2(7y ago)068MITPHPPHP &gt;=7.0

Since Jan 26Pushed 6y agoCompare

[ Source](https://github.com/corex/ioc)[ Packagist](https://packagist.org/packages/corex/ioc)[ RSS](/packages/corex-ioc/feed)WikiDiscussions master Synced 3d ago

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

CoRex IoC
=========

[](#corex-ioc)

[![License](https://camo.githubusercontent.com/e4c32ba0c37afc3a15b28852475f700840285d5e8f164bca03a2c6a0f6ce54a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f7265782f696f632e737667)](https://camo.githubusercontent.com/e4c32ba0c37afc3a15b28852475f700840285d5e8f164bca03a2c6a0f6ce54a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f7265782f696f632e737667)[![Build Status](https://camo.githubusercontent.com/3fa714a0413940ee7d12ade47cd527c0a25b0804e6773e8f34771ceace64e619/68747470733a2f2f7472617669732d63692e6f72672f636f7265782f696f632e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/3fa714a0413940ee7d12ade47cd527c0a25b0804e6773e8f34771ceace64e619/68747470733a2f2f7472617669732d63692e6f72672f636f7265782f696f632e7376673f6272616e63683d6d6173746572)[![codecov](https://camo.githubusercontent.com/9158381fbd49e4f3025d4744f226414e6be58d94d5b4ea4741206238004b5325/68747470733a2f2f636f6465636f762e696f2f67682f636f7265782f696f632f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://camo.githubusercontent.com/9158381fbd49e4f3025d4744f226414e6be58d94d5b4ea4741206238004b5325/68747470733a2f2f636f6465636f762e696f2f67682f636f7265782f696f632f6272616e63682f6d61737465722f67726170682f62616467652e737667)

This is a simple container helping managing class dependencies and performing dependency injection.

Methods.
--------

[](#methods)

- getInstance() - Get instance of container.
- clear() - Clear container for all bindings and instances.
- getBindings() - Get bindings.
- getBinding() - Get specific binding.
- has() - Check if class or interface has been bound.
- hasInstance() - Check if class or interface has been instantiated.
- isShared() - Check if class or interface is shared/is a singleton.
- isSingleton() - Check if class or interface is shared/is a singleton.
- forget() - Forget specified binding and instance.
- bind() - Bind class or instance.
- singleton() - Bind class or instance as shared/singleton.
- instance() - Set instance on existing binding.
- make() - Make instance of class or interface.

### Create a container.

[](#create-a-container)

```
// Create new container.
$container = new Container();

// Create/use existing container.
$container = Container::getInstance();
```

### Make a class without binding.

[](#make-a-class-without-binding)

```
$myClass = Container::getInstance()->make(MyClass::class);
```

### Make a class with binding and parameters.

[](#make-a-class-with-binding-and-parameters)

```
$container = Container::getInstance();

$container->bind(MyClassInterface::class, MyClass::class);

$myClass = $container->make(MyClass::class, [
    'test' => 'my.value'
]);
```

- When making a class via bound interface, the instance class will be checked if it implements the bound interface.
- When making a class via bound base-class, the instance class will be checked if it extends the bound base class.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

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

Total

3

Last Release

2615d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2168107cb28f49e937f963a925553ebac5923aa27cad2e1cf90ddbcabf663d6d?d=identicon)[corex](/maintainers/corex)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/corex-ioc/health.svg)

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

###  Alternatives

[laravel/telescope

An elegant debug assistant for the Laravel framework.

5.2k67.8M192](/packages/laravel-telescope)[spiral/roadrunner

RoadRunner: High-performance PHP application server and process manager written in Go and powered with plugins

8.4k12.2M84](/packages/spiral-roadrunner)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

708181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)

PHPackages © 2026

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