PHPackages                             able/facades - 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. able/facades

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

able/facades
============

phpABLE facade pattern implementation library

1.0.0(4y ago)1819MITPHPPHP &gt;=7.2.0

Since May 31Pushed 4y ago1 watchersCompare

[ Source](https://github.com/phpable/facades)[ Packagist](https://packagist.org/packages/able/facades)[ RSS](/packages/able-facades/feed)WikiDiscussions master Synced 2d ago

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

Introduction
------------

[](#introduction)

The phpABLE abstractions library provides the facade pattern implementation.

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2.0
- [able/statics](https://github.com/phpable/statics)

Install
-------

[](#install)

There's a simple way to install `able/facades` into your project via [Composer](http://getcomposer.org):

```
composer require able/facades
```

Usage
-----

[](#usage)

Let's design a simple class to explain how facades work:

```
class Recipient {
    private $name = "Unknown";

    public function __construct(string $name) {
        $this->name = $name;
    }

    public function changeName(string $name): void {
        $this->name = $name;
    }

    public function sayHello(): void {
        echo sprintf("Hello %s!", $this->name);
    }
}
```

So the point to use a facade is an ability to call recipients method statically, without creating any instances directly. In this case, the facade class takes a gateway role. The advantage we gain - more transparent and understandable code.

```
use \Able\Facades\AFacade;
use \Able\Facades\Structures\SInit;

class FacadeExample extends AFacade {

    /**
     * The recipient class.
     */
    protected static $Recipient = Recipient::class;

    /**
     * The initialize method can be used to provide
     * some necessary arguments to the recipient class constructor if needed.
     */
    protected final static function initialize(): SInit {
        return new SInit(["John"]);
    }
}

FacadeExample::sayHello();

// Hello John!
```

It's also possible to provide the callback function as a second field of the structure. This function going to be executed directly after the creation and will obtain the created object as an argument.

```
use \Able\Facades\AFacade;
use \Able\Facades\Structures\SInit;

class FacadeExample extends AFacade {
    protected static $Recipient = Recipient::class;

    protected final static function initialize(): SInit {
        return new SInit(["John"], function(Recipient $Object){
            $Object->changeName("Barbara");
        });
    }
}

FacadeExample::sayHello();

// Hello Barbara!
```

By default, the only instance of the recipient class going to be created. This behavior is similar to a singleton pattern and could be changed via `$keepSingle` protected property.

```
use \Able\Facades\AFacade;

class FacadeExample extends AFacade {

    /**
     * If this property set to false, the new instance of the recipient object
     * going to be created before any method call.
     */
    protected static $keepSingle  = false;
}
```

License
-------

[](#license)

This package is released under the [MIT license](https://github.com/phpable/facades/blob/master/LICENSE).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1809d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/713792f971f1f5ac1719a94df2e9340e44e09b01ae8bd2987ca9b5a3a177a485?d=identicon)[able](/maintainers/able)

---

Top Contributors

[![hacpaka](https://avatars.githubusercontent.com/u/8544673?v=4)](https://github.com/hacpaka "hacpaka (2 commits)")

---

Tags

facadephpable

### Embed Badge

![Health badge](/badges/able-facades/health.svg)

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

###  Alternatives

[webpatser/laravel-uuid

Laravel integration for webpatser/uuid - High-performance drop-in UUID replacements (15% faster than Ramsey). Provides Str macros, HasUuids trait, facades, and casts. RFC 4122/9562 compliant.

1.8k17.3M129](/packages/webpatser-laravel-uuid)[imanghafoori/smart-realtime-facades

Real-time facades with IDE auto-completion.

33427.0k3](/packages/imanghafoori-smart-realtime-facades)

PHPackages © 2026

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