PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 1.22
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v1.22
2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 All 42 releases
fluent-boards / vendor / wpfluent / framework / src / WPFluent / Foundation / App.php

App.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration 1.22, at vendor/wpfluent/framework/src/WPFluent/Foundation/App.php

69 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBoards\Framework\Foundation;
4
5
6 class App
7 {
8 /**
9 * Application instance
10 *
11 * @var FluentBoards\Framework\Foundation\Application
12 */
13 protected static $instance = null;
14
15 /**
16 * Set the application instance
17 *
18 * @param FluentBoards\Framework\Foundation\Application $app
19 */
20 public static function setInstance($app)
21 {
22 static::$instance = $app;
23 }
24
25 /**
26 * Get the application instance
27 *
28 * @param string $module The binding/key name for a component.
29 * @param array $parameters constructor dependencies if any.
30 * @return FluentBoards\Framework\Foundation\Application|mixed
31 */
32 public static function getInstance($module = null, $parameters = [])
33 {
34 if ($module) {
35 return static::$instance->make($module, $parameters);
36 }
37
38 return static::$instance;
39 }
40
41 /**
42 * Retrive a component from the container
43 *
44 * @param string $module The binding/key name for a component.
45 * @param array $parameters constructor dependencies if any.
46 * @return FluentBoards\Framework\Foundation\Application|mixed
47 */
48 public static function make($module = null, $parameters = [])
49 {
50 return static::getInstance($module, $parameters);
51 }
52
53 /**
54 * Handle dynamic method calls
55 *
56 * @param string $method
57 * @param array $params
58 * @return mixed
59 */
60 public static function __callStatic($method, $params)
61 {
62 if (method_exists(static::$instance, $method)) {
63 return static::$instance->{$method}(...$params);
64 }
65
66 return static::getInstance($method, ...$params);
67 }
68 }
69