← All changes
|
vendor/wpfluent/framework/src/WPFluent/Foundation/App.php
+22
-4
1.5.24
→
2.5.0
View file →
| @@ -1,15 +1,26 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace FluentBooking\Framework\Foundation; |
| 4 | 4 | |
| 5 | +use FluentBooking\Framework\Container\Contracts\BindingResolutionException; | |
| 5 | 6 | |
| 7 | +/** | |
| 8 | + * @method static \FluentBooking\Framework\Database\DatabaseManager db() | |
| 9 | + * @method static \FluentBooking\Framework\View\View view() | |
| 10 | + * @method static \FluentBooking\Framework\Events\Dispatcher events() | |
| 11 | + * @method static \FluentBooking\Framework\Foundation\Config config() | |
| 12 | + * @method static \FluentBooking\Framework\Http\Request\Request request() | |
| 13 | + * @method static \FluentBooking\Framework\Http\Response\Response response() | |
| 14 | + * @method static \FluentBooking\Framework\Encryption\Encrypter encrypter() | |
| 15 | + * @method static \FluentBooking\Framework\Validator\Validator validator() | |
| 16 | + */ | |
| 6 | 17 | class App |
| 7 | 18 | { |
| 8 | 19 | /** |
| 9 | 20 | * Application instance |
| 10 | 21 | * |
| 11 | - * @var FluentBooking\Framework\Foundation\Application | |
| 22 | + * @var \FluentBooking\Framework\Foundation\Application | |
| 12 | 23 | */ |
| 13 | 24 | protected static $instance = null; |
| 14 | 25 | |
| 15 | 26 | /** |
| @@ -14,9 +25,9 @@ | ||
| 14 | 25 | |
| 15 | 26 | /** |
| 16 | 27 | * Set the application instance |
| 17 | 28 | * |
| 18 | - * @param FluentBooking\Framework\Foundation\Application $app | |
| 29 | + * @param \FluentBooking\Framework\Foundation\Application $app | |
| 19 | 30 | */ |
| 20 | 31 | public static function setInstance($app) |
| 21 | 32 | { |
| 22 | 33 | static::$instance = $app; |
| @@ -26,9 +37,9 @@ | ||
| 26 | 37 | * Get the application instance |
| 27 | 38 | * |
| 28 | 39 | * @param string $module The binding/key name for a component. |
| 29 | 40 | * @param array $parameters constructor dependencies if any. |
| 30 | - * @return FluentBooking\Framework\Foundation\Application|mixed | |
| 41 | + * @return \FluentBooking\Framework\Foundation\Application|mixed | |
| 31 | 42 | */ |
| 32 | 43 | public static function getInstance($module = null, $parameters = []) |
| 33 | 44 | { |
| 34 | 45 | if ($module) { |
| @@ -42,9 +53,9 @@ | ||
| 42 | 53 | * Retrive a component from the container |
| 43 | 54 | * |
| 44 | 55 | * @param string $module The binding/key name for a component. |
| 45 | 56 | * @param array $parameters constructor dependencies if any. |
| 46 | - * @return FluentBooking\Framework\Foundation\Application|mixed | |
| 57 | + * @return \FluentBooking\Framework\Foundation\Application|mixed | |
| 47 | 58 | */ |
| 48 | 59 | public static function make($module = null, $parameters = []) |
| 49 | 60 | { |
| 50 | 61 | return static::getInstance($module, $parameters); |
| @@ -58,8 +69,15 @@ | ||
| 58 | 69 | * @return mixed |
| 59 | 70 | */ |
| 60 | 71 | public static function __callStatic($method, $params) |
| 61 | 72 | { |
| 73 | + if ($method === 'support') { | |
| 74 | + $param = array_splice($params, 0, 1); | |
| 75 | + return static::getInstance( | |
| 76 | + 'Support.' . implode('.', $param), ...$params | |
| 77 | + ); | |
| 78 | + } | |
| 79 | + | |
| 62 | 80 | if (method_exists(static::$instance, $method)) { |
| 63 | 81 | return static::$instance->{$method}(...$params); |
| 64 | 82 | } |
| 65 | 83 | |