atekushi / facade
Small Library to Implement Facade on DI Container To Your Project
Installs: 4
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/atekushi/facade
Requires
- php: ^8.2
- atekushi/container: dev-main
- atekushi/singleton: 1.*
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/containerlibrary. - 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()