| 1 |
<?php |
| 2 |
|
| 3 |
namespace FluentForm\Framework\Foundation; |
| 4 |
|
| 5 |
Abstract class AppFacade |
| 6 |
{ |
| 7 |
/** |
| 8 |
* $instance Application |
| 9 |
* @var FluentForm\Framework\Foundation\Application |
| 10 |
*/ |
| 11 |
static $instance = null; |
| 12 |
|
| 13 |
/** |
| 14 |
* Sets the app instance from Application |
| 15 |
* @param FluentForm\Framework\Foundation\Application $instance |
| 16 |
*/ |
| 17 |
public static function setApplication($instance) |
| 18 |
{ |
| 19 |
static::$instance = $instance; |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Get the app instance stored earlier during the bootstrap |
| 24 |
* @param FluentForm\Framework\Foundation\Application $instance |
| 25 |
*/ |
| 26 |
public static function getApplication() |
| 27 |
{ |
| 28 |
return static::$instance; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Resolve the aliased class dynamically |
| 33 |
* @param string $method |
| 34 |
* @param string $params |
| 35 |
* @return mixed |
| 36 |
*/ |
| 37 |
public static function __callStatic($method, $params) |
| 38 |
{ |
| 39 |
return call_user_func_array([ |
| 40 |
static::$instance->make(static::$key), $method |
| 41 |
], $params); |
| 42 |
} |
| 43 |
} |
| 44 |
|