| Total Complexity | 10 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | $APPLICATION = new class |
||
| 6 | { |
||
| 7 | public $application; |
||
| 8 | public $executablePath; |
||
| 9 | |||
| 10 | public function __construct () |
||
| 14 | } |
||
| 15 | |||
| 16 | public function run ($form = null): void |
||
| 17 | { |
||
| 18 | if ($form instanceof WFObject) |
||
| 19 | $this->application->run ($form->selector); |
||
| 20 | |||
| 21 | elseif (is_int ($form) && VoidEngine::objectExists ($form)) |
||
| 22 | $this->application->run ($form); |
||
| 23 | |||
| 24 | elseif ($form === null) |
||
| 25 | $this->application->run (); |
||
| 26 | |||
| 27 | else throw new \Exception ('$form param must be instance of "VoidEngine\WFObject" ("VoidEngine\Form"), be null or object selector'); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function restart (): void |
||
| 31 | { |
||
| 32 | $this->application->restart (); |
||
| 33 | $this->close (); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function close (): void |
||
| 39 | } |
||
| 40 | |||
| 41 | public function __call (string $name, array $args) |
||
| 42 | { |
||
| 43 | return $this->application->$name (...$args); |
||
| 44 | } |
||
| 45 | |||
| 46 | public function __get (string $name) |
||
| 49 | } |
||
| 50 | }; |
||
| 51 | |||
| 89 |