PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.5
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.5
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / vendor / wpfluent / framework / src / WPFluent / Foundation / App.php

App.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.5, at vendor/wpfluent/framework/src/WPFluent/Foundation/App.php

88 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\Framework\Foundation;
4
5 use FluentForm\Framework\Container\Contracts\BindingResolutionException;
6
7 /**
8 * @method static db();
9 * @method static view();
10 * @method static events();
11 * @method static config();
12 * @method static request();
13 * @method static response();
14 * @method static encrypter();
15 * @method static validator();
16 */
17
18 class App
19 {
20 /**
21 * Application instance
22 *
23 * @var \FluentForm\Framework\Foundation\Application
24 */
25 protected static $instance = null;
26
27 /**
28 * Set the application instance
29 *
30 * @param \FluentForm\Framework\Foundation\Application $app
31 */
32 public static function setInstance($app)
33 {
34 static::$instance = $app;
35 }
36
37 /**
38 * Get the application instance
39 *
40 * @param string $module The binding/key name for a component.
41 * @param array $parameters constructor dependencies if any.
42 * @return \FluentForm\Framework\Foundation\Application|mixed
43 */
44 public static function getInstance($module = null, $parameters = [])
45 {
46 if ($module) {
47 return static::$instance->make($module, $parameters);
48 }
49
50 return static::$instance;
51 }
52
53 /**
54 * Retrive a component from the container
55 *
56 * @param string $module The binding/key name for a component.
57 * @param array $parameters constructor dependencies if any.
58 * @return \FluentForm\Framework\Foundation\Application|mixed
59 */
60 public static function make($module = null, $parameters = [])
61 {
62 return static::getInstance($module, $parameters);
63 }
64
65 /**
66 * Handle dynamic method calls
67 *
68 * @param string $method
69 * @param array $params
70 * @return mixed
71 */
72 public static function __callStatic($method, $params)
73 {
74 if ($method === 'support') {
75 $param = array_splice($params, 0, 1);
76 return static::getInstance(
77 'Support.' . implode('.', $param), ...$params
78 );
79 }
80
81 if (method_exists(static::$instance, $method)) {
82 return static::$instance->{$method}(...$params);
83 }
84
85 return static::getInstance($method, ...$params);
86 }
87 }
88