PHPackages                             mrubiosan/facade - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. mrubiosan/facade

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

mrubiosan/facade
================

Facade pattern ready to use

2.0.1(7y ago)516.9k21GPL-3.0PHPPHP &gt;=7.0CI failing

Since Aug 4Pushed 6y ago2 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (8)Used By (1)

facade
======

[](#facade)

Facade pattern for PHP

[![Build Status](https://camo.githubusercontent.com/245dfff0b2594eddf64529867008d9c0b6a0819ef877afdd7c523cc804375a4e/68747470733a2f2f7472617669732d63692e6f72672f6d727562696f73616e2f6661636164652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mrubiosan/facade) [![Maintainability](https://camo.githubusercontent.com/f931b449d577707cdefc1ca106b1df8d330b818f4be13ba6f499f7bab968d733/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31396462373835393166356239626533653534362f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/mrubiosan/facade/maintainability) [![Test Coverage](https://camo.githubusercontent.com/011a35fd5facea2611c89b361530780f5ea6fe704bb464bb544e8df0691b96be/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f31396462373835393166356239626533653534362f746573745f636f766572616765)](https://codeclimate.com/github/mrubiosan/facade/test_coverage)

As seen in the Laravel framework. You can call a method statically, and it will fetch an object from the container and call its method.

It's very useful for unbounded services like Logging. You can call it statically but change the underlying implementation(i.e: for testing).

Also a good compromise when refactoring code that uses static class access.

**Usage example**

```
//First declare your facade class
namespace MyDummyNameSpace;

class Foo extends \Mrubiosan\Facade\FacadeAccessor
{
    public static function getServiceName()
    {
       return 'foo'; //This is the name of the service in your container
    }
}
```

```
//Then initialize the facade system
$exampleContainer = new \ArrayObject([
    'foo' => new \DateTime(),
]);
$psrAdaptedContainer = new \Mrubiosan\Facade\ServiceLocatorAdapter\ArrayAccessAdapter($exampleContainer);
\Mrubiosan\Facade\FacadeLoader::init($psrAdaptedContainer, ['FooAlias' => 'MyDummyNameSpace\Foo']);
```

```
//Ready to use
echo \MyDummyNameSpace\Foo::getTimestamp();
echo \FooAlias::getTimestamp();
```

Wiring it up
------------

[](#wiring-it-up)

### Step 1

[](#step-1)

If you're using a PSR11 Container, you can skip this step. Oterwise you'll need to use an adapter:

- `Mrubiosan\Facade\ServiceLocatorAdapter\ArrayAccessAdapter`: if you're using pimple you can use this.
- `Mrubiosan\Facade\ServiceLocatorAdapter\CallableAdapter`: you can provide a callable parameter that will receive the service name it should retrieve.

Or straight implement `Psr\Container\ContainerInterface`

### Step 2

[](#step-2)

Initialize the facade system

```
Mrubiosan\Facade\FacadeLoader::init($psrContainer);
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 79.3% 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 ~260 days

Recently: every ~252 days

Total

6

Last Release

2638d ago

Major Versions

0.1.1 → 1.02016-09-24

1.1 → 2.02018-08-03

PHP version history (2 changes)0.1PHP &gt;=5.4.4

2.0PHP &gt;=7.0

### Community

Maintainers

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

---

Top Contributors

[![mrubiosan](https://avatars.githubusercontent.com/u/1294819?v=4)](https://github.com/mrubiosan "mrubiosan (23 commits)")[![marcrubiocmp](https://avatars.githubusercontent.com/u/17856285?v=4)](https://github.com/marcrubiocmp "marcrubiocmp (6 commits)")

---

Tags

containerfacadeservice locatorstatic access

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/mrubiosan-facade/health.svg)

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

###  Alternatives

[pimple/pimple

Pimple, a simple Dependency Injection Container

2.7k130.5M1.4k](/packages/pimple-pimple)[league/container

A fast and intuitive dependency injection container.

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

The dependency injection container for humans

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

Provides adapters for various third-party service containers.

219390.6k15](/packages/acclimate-container)[aura/di

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

356968.3k58](/packages/aura-di)[league/tactician-container

Tactician integration for any container implementing PSR-11

7710.1M23](/packages/league-tactician-container)

PHPackages © 2026

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