@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | return [ |
49 | 49 | 'text' => $e->getMessage (), |
50 | - 'line' => $e->getLine () |
|
50 | + 'line' => $e->getLine () |
|
51 | 51 | ]; |
52 | 52 | } |
53 | 53 | |
@@ -165,17 +165,17 @@ discard block |
||
165 | 165 | |
166 | 166 | function substr_icount (string $haystack, string $needle, ...$params): int |
167 | 167 | { |
168 | - return substr_count (strtolower ($haystack), strtolower ($needle), ...$params); |
|
168 | + return substr_count (strtolower ($haystack), strtolower ($needle), ...$params); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | function str_replace_assoc (string $subject, array $replacements): string |
172 | 172 | { |
173 | - return str_replace (array_keys ($replacements), array_values ($replacements), $subject); |
|
173 | + return str_replace (array_keys ($replacements), array_values ($replacements), $subject); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | function pre (...$args): void |
177 | 177 | { |
178 | - message (sizeof ($args) < 2 ? current ($args) : $args); |
|
178 | + message (sizeof ($args) < 2 ? current ($args) : $args); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | function messageBox (string $message, string $caption = '', ...$args) |
@@ -333,9 +333,9 @@ discard block |
||
333 | 333 | } |
334 | 334 | |
335 | 335 | catch (\Throwable $e) |
336 | - { |
|
337 | - continue; |
|
338 | - } |
|
336 | + { |
|
337 | + continue; |
|
338 | + } |
|
339 | 339 | |
340 | 340 | return false; |
341 | 341 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | call_user_func ($function, $self); |
359 | 359 | }; |
360 | 360 | |
361 | - $timer->start (); |
|
361 | + $timer->start (); |
|
362 | 362 | |
363 | 363 | return $timer; |
364 | 364 | } |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | |
379 | 379 | $timer->start (); |
380 | 380 | |
381 | - return $timer; |
|
381 | + return $timer; |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | class Clipboard |
@@ -4,36 +4,36 @@ discard block |
||
4 | 4 | |
5 | 5 | class Form extends Control |
6 | 6 | { |
7 | - public $class = 'System.Windows.Forms.Form'; |
|
7 | + public $class = 'System.Windows.Forms.Form'; |
|
8 | 8 | |
9 | - public function get_icon () |
|
10 | - { |
|
11 | - return new FormIcon ($this->selector); |
|
12 | - } |
|
9 | + public function get_icon () |
|
10 | + { |
|
11 | + return new FormIcon ($this->selector); |
|
12 | + } |
|
13 | 13 | |
14 | - public function get_clientSize () |
|
15 | - { |
|
16 | - $obj = $this->getProperty ('ClientSize'); |
|
14 | + public function get_clientSize () |
|
15 | + { |
|
16 | + $obj = $this->getProperty ('ClientSize'); |
|
17 | 17 | |
18 | - $w = VoidEngine::getProperty ($obj, 'Width'); |
|
19 | - $h = VoidEngine::getProperty ($obj, 'Height'); |
|
18 | + $w = VoidEngine::getProperty ($obj, 'Width'); |
|
19 | + $h = VoidEngine::getProperty ($obj, 'Height'); |
|
20 | 20 | |
21 | - VoidEngine::removeObjects ($obj); |
|
21 | + VoidEngine::removeObjects ($obj); |
|
22 | 22 | |
23 | - return [$w, $h]; |
|
24 | - } |
|
23 | + return [$w, $h]; |
|
24 | + } |
|
25 | 25 | |
26 | - public function set_clientSize (array $size) |
|
27 | - { |
|
28 | - $obj = $this->getProperty ('ClientSize'); |
|
26 | + public function set_clientSize (array $size) |
|
27 | + { |
|
28 | + $obj = $this->getProperty ('ClientSize'); |
|
29 | 29 | |
30 | - VoidEngine::setProperty ($obj, 'Width', array_shift ($size)); |
|
31 | - VoidEngine::setProperty ($obj, 'Height', array_shift ($size)); |
|
30 | + VoidEngine::setProperty ($obj, 'Width', array_shift ($size)); |
|
31 | + VoidEngine::setProperty ($obj, 'Height', array_shift ($size)); |
|
32 | 32 | |
33 | - $this->setProperty ('ClientSize', $obj); |
|
33 | + $this->setProperty ('ClientSize', $obj); |
|
34 | 34 | |
35 | - VoidEngine::removeObjects ($obj); |
|
36 | - } |
|
35 | + VoidEngine::removeObjects ($obj); |
|
36 | + } |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | class FormIcon extends Icon |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | public function loadFromFile (string $file) |
49 | - { |
|
49 | + { |
|
50 | 50 | $icon = VoidEngine::createObject ('System.Drawing.Icon', 'System.Drawing', $file); |
51 | 51 | |
52 | 52 | VoidEngine::setProperty ($this->formSelector, 'Icon', $icon); |
53 | 53 | |
54 | - if (!isset ($this->selector)) |
|
55 | - $this->selector = $icon; |
|
56 | - } |
|
54 | + if (!isset ($this->selector)) |
|
55 | + $this->selector = $icon; |
|
56 | + } |
|
57 | 57 | } |
@@ -4,48 +4,48 @@ |
||
4 | 4 | |
5 | 5 | class PictureBox extends Control |
6 | 6 | { |
7 | - public $class = 'System.Windows.Forms.PictureBox'; |
|
7 | + public $class = 'System.Windows.Forms.PictureBox'; |
|
8 | 8 | |
9 | - protected $image; |
|
9 | + protected $image; |
|
10 | 10 | |
11 | - public function __construct (Component $parent = null) |
|
12 | - { |
|
11 | + public function __construct (Component $parent = null) |
|
12 | + { |
|
13 | 13 | parent::__construct ($parent, $this->class); |
14 | 14 | |
15 | - $this->image = new PictureBoxImage ($this->selector); |
|
16 | - } |
|
15 | + $this->image = new PictureBoxImage ($this->selector); |
|
16 | + } |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | class PictureBoxImage |
20 | 20 | { |
21 | - protected $selector; |
|
21 | + protected $selector; |
|
22 | 22 | protected $pictureBoxSelector; |
23 | 23 | protected $clipboard; |
24 | 24 | |
25 | - public function __construct (int $pictureBoxSelector) |
|
26 | - { |
|
27 | - $this->pictureBoxSelector = $pictureBoxSelector; |
|
28 | - $this->selector = VoidEngine::getProperty ($pictureBoxSelector, 'Image'); |
|
29 | - $this->clipboard = new WFClass ('System.Windows.Forms.Clipboard'); |
|
30 | - } |
|
25 | + public function __construct (int $pictureBoxSelector) |
|
26 | + { |
|
27 | + $this->pictureBoxSelector = $pictureBoxSelector; |
|
28 | + $this->selector = VoidEngine::getProperty ($pictureBoxSelector, 'Image'); |
|
29 | + $this->clipboard = new WFClass ('System.Windows.Forms.Clipboard'); |
|
30 | + } |
|
31 | 31 | |
32 | - public function loadFromFile (string $file) |
|
33 | - { |
|
32 | + public function loadFromFile (string $file) |
|
33 | + { |
|
34 | 34 | VoidEngine::setProperty ($this->pictureBoxSelector, 'Image', (new Image ())->loadFromFile ($file)->selector); |
35 | - } |
|
35 | + } |
|
36 | 36 | |
37 | - public function saveToFile (string $file) |
|
38 | - { |
|
39 | - VoidEngine::callMethod ($this->selector, 'Save', $file); |
|
40 | - } |
|
37 | + public function saveToFile (string $file) |
|
38 | + { |
|
39 | + VoidEngine::callMethod ($this->selector, 'Save', $file); |
|
40 | + } |
|
41 | 41 | |
42 | - public function loadFromClipboard () |
|
43 | - { |
|
44 | - VoidEngine::setProperty ($this->pictureBoxSelector, 'Image', $this->clipboard->getImage ()); |
|
45 | - } |
|
42 | + public function loadFromClipboard () |
|
43 | + { |
|
44 | + VoidEngine::setProperty ($this->pictureBoxSelector, 'Image', $this->clipboard->getImage ()); |
|
45 | + } |
|
46 | 46 | |
47 | - public function saveToClipboard () |
|
48 | - { |
|
49 | - $this->clipboard->setImage (VoidEngine::getProperty ($this->pictureBoxSelector, 'Image')); |
|
50 | - } |
|
47 | + public function saveToClipboard () |
|
48 | + { |
|
49 | + $this->clipboard->setImage (VoidEngine::getProperty ($this->pictureBoxSelector, 'Image')); |
|
50 | + } |
|
51 | 51 | } |
@@ -4,28 +4,28 @@ |
||
4 | 4 | |
5 | 5 | class Process extends Component |
6 | 6 | { |
7 | - public $class = 'System.Diagnostics.Process'; |
|
8 | - public $namespace = 'System'; |
|
7 | + public $class = 'System.Diagnostics.Process'; |
|
8 | + public $namespace = 'System'; |
|
9 | 9 | |
10 | - public function __construct (int $pid = null) |
|
11 | - { |
|
10 | + public function __construct (int $pid = null) |
|
11 | + { |
|
12 | 12 | $this->selector = VoidEngine::createClass ($this->class, $this->namespace); |
13 | 13 | |
14 | - if ($pid !== null) |
|
14 | + if ($pid !== null) |
|
15 | 15 | $this->selector = $pid == getmypid () ? |
16 | 16 | VoidEngine::callMethod ($this->selector, 'GetCurrentProcess') : |
17 | 17 | VoidEngine::callMethod ($this->selector, 'GetProcessById', $pid); |
18 | 18 | |
19 | - Components::addComponent ($this->selector, $this); |
|
20 | - } |
|
19 | + Components::addComponent ($this->selector, $this); |
|
20 | + } |
|
21 | 21 | |
22 | - public static function getProcessById (int $pid) |
|
23 | - { |
|
24 | - return new self ($pid); |
|
25 | - } |
|
22 | + public static function getProcessById (int $pid) |
|
23 | + { |
|
24 | + return new self ($pid); |
|
25 | + } |
|
26 | 26 | |
27 | - public static function getCurrentProcess () |
|
28 | - { |
|
29 | - return new self (getmypid ()); |
|
30 | - } |
|
27 | + public static function getCurrentProcess () |
|
28 | + { |
|
29 | + return new self (getmypid ()); |
|
30 | + } |
|
31 | 31 | } |