PHPackages                             phutureproof/guardian - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phutureproof/guardian

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phutureproof/guardian
=====================

Dependency injector

3.0.0(10y ago)040MITPHP

Since Apr 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/phutureproof/Guardian)[ Packagist](https://packagist.org/packages/phutureproof/guardian)[ RSS](/packages/phutureproof-guardian/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (1)Versions (10)Used By (0)

Guardian
========

[](#guardian)

Build Status
------------

[](#build-status)

Master

[![Build Status](https://camo.githubusercontent.com/d705c3bb360a565b4a6f8640a5ea5415c4e379f7f7052308bcfc7e00523cfa77/68747470733a2f2f7472617669732d63692e6f72672f7068757475726570726f6f662f477561726469616e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/phutureproof/Guardian)

Develop

[![Build Status](https://camo.githubusercontent.com/e92238d17ab95350821b8442c7cb2ab4f8a68d62609a5d62e067fe24265f4b2c/68747470733a2f2f7472617669732d63692e6f72672f7068757475726570726f6f662f477561726469616e2e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/phutureproof/Guardian)

Code Climate

[![Code Climate](https://camo.githubusercontent.com/039db6e08756a14ae18e4ac0640082043d6220d67991426a23726523c870bb82/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f7068757475726570726f6f662f477561726469616e2f6261646765732f6770612e737667)](https://codeclimate.com/github/phutureproof/Guardian)

Basic Usage
===========

[](#basic-usage)

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

[](#installation)

via composer

```
composer require phutureproof/guardian

```

or add this to your composer.json

```
"require": {
  "phutureproof/guardian": "~3"
}

```

or manually grab the src folder and put the files where ever you want.

Usage
-----

[](#usage)

Create your dependencies and register functions to return instances of the objects in the container

```
Guardian::register('dependency.name', function()
{
    return new Dependency();
});

```

Grab an instance of the dependency

```
$instance = Guardian::make('dependency.name');

```

Register a singleton

```
Guardian::register('singleton.dependency.name', function () {
    static $instance;
    if (is_null($instance)) {
        $instance = new Dependency();
    }
    return $instance;
});

```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity69

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

Total

8

Last Release

3676d ago

Major Versions

0.1.1 → 1.0.02016-04-12

1.0.3 → 2.0.02016-04-14

2.0.0 → 3.0.02016-04-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/119378bb231320e2dfa58326842f42f9b2666a920a5c44be41c9e2c8079e2d6b?d=identicon)[PhutureProof](/maintainers/PhutureProof)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/phutureproof-guardian/health.svg)

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

###  Alternatives

[stingbo/easyexchange

easy use digital currency exchange sdk

871.3k](/packages/stingbo-easyexchange)

PHPackages © 2026

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