hassankhan / frontman
A simple package to create your own Laravel-style facades
Installs: 4 462
Dependents: 2
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 4.*
- scrutinizer/ocular: ~1.1
- squizlabs/php_codesniffer: ~2.2
This package is not auto-updated.
Last update: 2020-01-24 15:31:44 UTC
README
Frontman is a simple class that you can extend to create your own Laravel-style facades (or proxies, as they should be called).
Install
Via Composer
$ composer require hassankhan/frontman
Usage
use Frontman\Proxy; use Frontman\ProxyInterface; class MyClass { public function foo() { echo 'Foo'; } } class MyOtherClass { protected $value; public function __construct($value) { $this->value = $value; } public function bar() { echo 'Bar'; } } class MyProxy extends Proxy implements ProxyInterface { public static function getRealClass() { return 'MyClass'; } } class MyOtherProxy extends Proxy implements ProxyInterface { public static function getRealClass() { return 'MyOtherClass'; } public static function getConstructorArguments() { return array('5'); } } MyProxy::foo(); // 'Foo' MyOtherProxy::bar(); // 'Bar'
Contributing
Please see CONTRIBUTING.md for details.
Credits
License
The MIT License (MIT). Please see LICENSE.md for more information.