| 1 |
<?php |
| 2 |
|
| 3 |
namespace SureCart\Models\Concerns; |
| 4 |
|
| 5 |
trait Facade { |
| 6 |
/** |
| 7 |
* Forward call to method |
| 8 |
* |
| 9 |
* @param string $method Method to call. |
| 10 |
* @param mixed $params Method params. |
| 11 |
*/ |
| 12 |
public function __call( $method, $params ) { |
| 13 |
return call_user_func_array( [ $this, $method ], $params ); |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* Static Facade Accessor |
| 18 |
* |
| 19 |
* @param string $method Method to call. |
| 20 |
* @param mixed $params Method params. |
| 21 |
* |
| 22 |
* @return mixed |
| 23 |
*/ |
| 24 |
public static function __callStatic( $method, $params ) { |
| 25 |
return call_user_func_array( [ new static(), $method ], $params ); |
| 26 |
} |
| 27 |
} |
| 28 |
|