atekushi/facade

Small Library to Implement Facade on DI Container To Your Project

1.0.0 2025-01-14 09:57 UTC

This package is auto-updated.

Last update: 2025-08-15 03:56:29 UTC


README

Facade acts as a static proxy for accessing underlying objects or services, simplifying interaction with complex subsystems or dependencies.

Why Use it ?

  • Static Access: Use static calls to access methods on underlying objects.
  • Dependency Management: Automatically resolves dependencies using the atekushi/container library.
  • Simplified API: Provides a clean and elegant interface for complex subsystems.

Installation

Install the library via Composer:

  composer require atekushi/facade

Usage

  • Create new facade class

Example:

include 'vendor/autoload.php';

use Atekushi\Facade\Facade;

class BaseClass {
    public function test(){
        echo "Test"
    }
}

/**
 * @method static void test()
 *
 * @mixin BaseClass
 */
class A extends Facade
{
    protected static function getClassSubject(): string
    {
        return BaseClass::class;
    }
}

A::test()