@@ -6,8 +6,8 @@ |
||
6 | 6 | { |
7 | 7 | public $class = 'System.Windows.Forms.FolderBrowserDialog'; |
8 | 8 | |
9 | - public function get_path () |
|
9 | + public function get_path() |
|
10 | 10 | { |
11 | - return $this->getProperty ('SelectedPath'); |
|
11 | + return $this->getProperty('SelectedPath'); |
|
12 | 12 | } |
13 | 13 | } |
@@ -6,8 +6,8 @@ |
||
6 | 6 | { |
7 | 7 | public $class = 'System.Windows.Forms.MessageBox'; |
8 | 8 | |
9 | - public function __construct () |
|
9 | + public function __construct() |
|
10 | 10 | { |
11 | - parent::__construct ($this->class); |
|
11 | + parent::__construct($this->class); |
|
12 | 12 | } |
13 | 13 | } |
@@ -4,5 +4,5 @@ |
||
4 | 4 | |
5 | 5 | class CheckBox extends Control |
6 | 6 | { |
7 | - public $class = 'System.Windows.Forms.CheckBox'; |
|
7 | + public $class = 'System.Windows.Forms.CheckBox'; |
|
8 | 8 | } |
@@ -4,36 +4,36 @@ |
||
4 | 4 | |
5 | 5 | class Chart extends Control |
6 | 6 | { |
7 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Chart'; |
|
8 | - public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
7 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Chart'; |
|
8 | + public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
9 | 9 | } |
10 | 10 | |
11 | 11 | class Annotation extends Control |
12 | 12 | { |
13 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Annotation'; |
|
14 | - public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
13 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Annotation'; |
|
14 | + public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | class ChartArea extends Control |
18 | 18 | { |
19 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.ChartArea'; |
|
20 | - public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
19 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.ChartArea'; |
|
20 | + public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | class Legend extends Control |
24 | 24 | { |
25 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Legend'; |
|
26 | - public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
25 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Legend'; |
|
26 | + public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | class Series extends Control |
30 | 30 | { |
31 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Series'; |
|
32 | - public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
31 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Series'; |
|
32 | + public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | class Title extends Control |
36 | 36 | { |
37 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Title'; |
|
38 | - public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
37 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Title'; |
|
38 | + public $namespace = 'System.Windows.Forms.DataVisualization'; |
|
39 | 39 | } |
@@ -4,36 +4,36 @@ |
||
4 | 4 | |
5 | 5 | class Chart extends Control |
6 | 6 | { |
7 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Chart'; |
|
7 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Chart'; |
|
8 | 8 | public $namespace = 'System.Windows.Forms.DataVisualization'; |
9 | 9 | } |
10 | 10 | |
11 | 11 | class Annotation extends Control |
12 | 12 | { |
13 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Annotation'; |
|
13 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Annotation'; |
|
14 | 14 | public $namespace = 'System.Windows.Forms.DataVisualization'; |
15 | 15 | } |
16 | 16 | |
17 | 17 | class ChartArea extends Control |
18 | 18 | { |
19 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.ChartArea'; |
|
19 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.ChartArea'; |
|
20 | 20 | public $namespace = 'System.Windows.Forms.DataVisualization'; |
21 | 21 | } |
22 | 22 | |
23 | 23 | class Legend extends Control |
24 | 24 | { |
25 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Legend'; |
|
25 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Legend'; |
|
26 | 26 | public $namespace = 'System.Windows.Forms.DataVisualization'; |
27 | 27 | } |
28 | 28 | |
29 | 29 | class Series extends Control |
30 | 30 | { |
31 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Series'; |
|
31 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Series'; |
|
32 | 32 | public $namespace = 'System.Windows.Forms.DataVisualization'; |
33 | 33 | } |
34 | 34 | |
35 | 35 | class Title extends Control |
36 | 36 | { |
37 | - public $class = 'System.Windows.Forms.DataVisualization.Charting.Title'; |
|
37 | + public $class = 'System.Windows.Forms.DataVisualization.Charting.Title'; |
|
38 | 38 | public $namespace = 'System.Windows.Forms.DataVisualization'; |
39 | 39 | } |
@@ -11,9 +11,9 @@ discard block |
||
11 | 11 | { |
12 | 12 | public $class = 'System.Windows.Forms.ListViewItem'; |
13 | 13 | |
14 | - public function __construct (string $text = '') |
|
14 | + public function __construct(string $text = '') |
|
15 | 15 | { |
16 | - parent::__construct (null, $this->class); |
|
16 | + parent::__construct(null, $this->class); |
|
17 | 17 | |
18 | 18 | $this->text = $text; |
19 | 19 | } |
@@ -23,9 +23,9 @@ discard block |
||
23 | 23 | { |
24 | 24 | public $class = 'System.Windows.Forms.ColumnHeader'; |
25 | 25 | |
26 | - public function __construct (string $text = '') |
|
26 | + public function __construct(string $text = '') |
|
27 | 27 | { |
28 | - parent::__construct (null, $this->class); |
|
28 | + parent::__construct(null, $this->class); |
|
29 | 29 | |
30 | 30 | $this->text = $text; |
31 | 31 | } |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | { |
36 | 36 | public $class = 'System.Windows.Forms.ListViewGroup'; |
37 | 37 | |
38 | - public function __construct (string $text = '') |
|
38 | + public function __construct(string $text = '') |
|
39 | 39 | { |
40 | - parent::__construct (null, $this->class); |
|
40 | + parent::__construct(null, $this->class); |
|
41 | 41 | |
42 | 42 | $this->header = $text; |
43 | 43 | } |
@@ -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 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace VoidEngine; |
4 | 4 | |
5 | -function err_status (bool $status = null): bool |
|
5 | +function err_status(bool $status = null): bool |
|
6 | 6 | { |
7 | 7 | $oldStatus = $GLOBALS['__debug']['error_status']; |
8 | 8 | |
@@ -12,203 +12,203 @@ discard block |
||
12 | 12 | return $oldStatus; |
13 | 13 | } |
14 | 14 | |
15 | -function err_no (): bool |
|
15 | +function err_no(): bool |
|
16 | 16 | { |
17 | - return err_status (false); |
|
17 | + return err_status(false); |
|
18 | 18 | } |
19 | 19 | |
20 | -function err_yes (): bool |
|
20 | +function err_yes(): bool |
|
21 | 21 | { |
22 | - return err_status (true); |
|
22 | + return err_status(true); |
|
23 | 23 | } |
24 | 24 | |
25 | -function run (string $path, ...$args) |
|
25 | +function run(string $path, ...$args) |
|
26 | 26 | { |
27 | - return (new Process)->start ($path, ...$args); |
|
27 | + return (new Process)->start($path, ...$args); |
|
28 | 28 | } |
29 | 29 | |
30 | -function vbs_exec (string $code) |
|
30 | +function vbs_exec(string $code) |
|
31 | 31 | { |
32 | - file_put_contents ($path = getenv ('temp') .'/'. crc32 ($code) .'.vbs', $code); |
|
32 | + file_put_contents($path = getenv('temp').'/'.crc32($code).'.vbs', $code); |
|
33 | 33 | |
34 | - (new \COM ('WScript.Shell'))->Run ($path, 0, true); |
|
34 | + (new \COM('WScript.Shell'))->Run($path, 0, true); |
|
35 | 35 | |
36 | - unlink ($path); |
|
36 | + unlink($path); |
|
37 | 37 | } |
38 | 38 | |
39 | -function php_errors_check (string $code): ?array |
|
39 | +function php_errors_check(string $code): ?array |
|
40 | 40 | { |
41 | 41 | try |
42 | 42 | { |
43 | - eval ('return; '. $code); |
|
43 | + eval ('return; '.$code); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | catch (\Throwable $e) |
47 | 47 | { |
48 | 48 | return [ |
49 | - 'text' => $e->getMessage (), |
|
50 | - 'line' => $e->getLine () |
|
49 | + 'text' => $e->getMessage(), |
|
50 | + 'line' => $e->getLine() |
|
51 | 51 | ]; |
52 | 52 | } |
53 | 53 | |
54 | 54 | return null; |
55 | 55 | } |
56 | 56 | |
57 | -function enum (string $name): array |
|
57 | +function enum(string $name): array |
|
58 | 58 | { |
59 | 59 | return [ |
60 | - substr ($name, strrpos ($name, '.') + 1), |
|
61 | - ($name = substr ($name, 0, strrpos ($name, '.'))) .', '. substr ($name, 0, strrpos ($name, '.')) |
|
60 | + substr($name, strrpos($name, '.') + 1), |
|
61 | + ($name = substr($name, 0, strrpos($name, '.'))).', '.substr($name, 0, strrpos($name, '.')) |
|
62 | 62 | ]; |
63 | 63 | } |
64 | 64 | |
65 | -function getNetArray (string $type, array $items = []): WFObject |
|
65 | +function getNetArray(string $type, array $items = []): WFObject |
|
66 | 66 | { |
67 | - $array = (new WFClass ('System.Array', null)) |
|
68 | - ->createInstance (VoidEngine::objectType ($type), $size = sizeof ($items)); |
|
67 | + $array = (new WFClass('System.Array', null)) |
|
68 | + ->createInstance(VoidEngine::objectType($type), $size = sizeof($items)); |
|
69 | 69 | |
70 | 70 | for ($i = 0; $i < $size; ++$i) |
71 | - $array[$i] = array_shift ($items); |
|
71 | + $array[$i] = array_shift($items); |
|
72 | 72 | |
73 | 73 | return $array; |
74 | 74 | } |
75 | 75 | |
76 | -function dir_create (string $path, int $mode = 0777): void |
|
76 | +function dir_create(string $path, int $mode = 0777): void |
|
77 | 77 | { |
78 | - if (!is_dir ($path)) |
|
79 | - mkdir ($path, $mode, true); |
|
78 | + if (!is_dir($path)) |
|
79 | + mkdir($path, $mode, true); |
|
80 | 80 | } |
81 | 81 | |
82 | -function dir_delete (string $path): bool |
|
82 | +function dir_delete(string $path): bool |
|
83 | 83 | { |
84 | - if (!is_dir ($path)) |
|
84 | + if (!is_dir($path)) |
|
85 | 85 | return false; |
86 | 86 | |
87 | - foreach (array_slice (scandir ($path), 2) as $file) |
|
88 | - if (is_dir ($file = $path .'/'. $file)) |
|
87 | + foreach (array_slice(scandir($path), 2) as $file) |
|
88 | + if (is_dir($file = $path.'/'.$file)) |
|
89 | 89 | { |
90 | - dir_delete ($file); |
|
90 | + dir_delete($file); |
|
91 | 91 | |
92 | - if (is_dir ($file)) |
|
93 | - rmdir ($file); |
|
92 | + if (is_dir($file)) |
|
93 | + rmdir($file); |
|
94 | 94 | } |
95 | 95 | |
96 | - else unlink ($file); |
|
96 | + else unlink($file); |
|
97 | 97 | |
98 | - rmdir ($path); |
|
98 | + rmdir($path); |
|
99 | 99 | |
100 | 100 | return true; |
101 | 101 | } |
102 | 102 | |
103 | -function dir_clean (string $path): void |
|
103 | +function dir_clean(string $path): void |
|
104 | 104 | { |
105 | - dir_delete ($path); |
|
106 | - dir_create ($path); |
|
105 | + dir_delete($path); |
|
106 | + dir_create($path); |
|
107 | 107 | } |
108 | 108 | |
109 | -function dir_copy (string $from, string $to): bool |
|
109 | +function dir_copy(string $from, string $to): bool |
|
110 | 110 | { |
111 | - if (!is_dir ($from)) |
|
111 | + if (!is_dir($from)) |
|
112 | 112 | return false; |
113 | 113 | |
114 | - if (!is_dir ($to)) |
|
115 | - dir_create ($to); |
|
114 | + if (!is_dir($to)) |
|
115 | + dir_create($to); |
|
116 | 116 | |
117 | - foreach (array_slice (scandir ($from), 2) as $file) |
|
118 | - if (is_dir ($f = $from .'/'. $file)) |
|
119 | - dir_copy ($f, $to .'/'. $file); |
|
117 | + foreach (array_slice(scandir($from), 2) as $file) |
|
118 | + if (is_dir($f = $from.'/'.$file)) |
|
119 | + dir_copy($f, $to.'/'.$file); |
|
120 | 120 | |
121 | - else copy ($f, $to .'/'. $file); |
|
121 | + else copy($f, $to.'/'.$file); |
|
122 | 122 | |
123 | 123 | return true; |
124 | 124 | } |
125 | 125 | |
126 | -function getARGBColor (string $color) |
|
126 | +function getARGBColor(string $color) |
|
127 | 127 | { |
128 | - return (new WFClass ('System.Drawing.ColorTranslator'))->fromHtml ($color); |
|
128 | + return (new WFClass('System.Drawing.ColorTranslator'))->fromHtml($color); |
|
129 | 129 | } |
130 | 130 | |
131 | -function replaceSl (string $string): string |
|
131 | +function replaceSl(string $string): string |
|
132 | 132 | { |
133 | - return str_replace ('\\', '/', $string); |
|
133 | + return str_replace('\\', '/', $string); |
|
134 | 134 | } |
135 | 135 | |
136 | -function replaceSr (string $string): string |
|
136 | +function replaceSr(string $string): string |
|
137 | 137 | { |
138 | - return str_replace ('/', '\\', $string); |
|
138 | + return str_replace('/', '\\', $string); |
|
139 | 139 | } |
140 | 140 | |
141 | -function basenameNoExt (string $path): string |
|
141 | +function basenameNoExt(string $path): string |
|
142 | 142 | { |
143 | - return pathinfo ($path, PATHINFO_FILENAME); |
|
143 | + return pathinfo($path, PATHINFO_FILENAME); |
|
144 | 144 | } |
145 | 145 | |
146 | -function file_ext (string $path): string |
|
146 | +function file_ext(string $path): string |
|
147 | 147 | { |
148 | - return strtolower (pathinfo ($path, PATHINFO_EXTENSION)); |
|
148 | + return strtolower(pathinfo($path, PATHINFO_EXTENSION)); |
|
149 | 149 | } |
150 | 150 | |
151 | -function filepathNoExt (string $path): string |
|
151 | +function filepathNoExt(string $path): string |
|
152 | 152 | { |
153 | - return dirname ($path) .'/'. basenameNoExt ($path); |
|
153 | + return dirname($path).'/'.basenameNoExt($path); |
|
154 | 154 | } |
155 | 155 | |
156 | -function array_first (array $array) |
|
156 | +function array_first(array $array) |
|
157 | 157 | { |
158 | - return array_shift ($array); |
|
158 | + return array_shift($array); |
|
159 | 159 | } |
160 | 160 | |
161 | -function array_end (array $array) |
|
161 | +function array_end(array $array) |
|
162 | 162 | { |
163 | - return array_pop ($array); |
|
163 | + return array_pop($array); |
|
164 | 164 | } |
165 | 165 | |
166 | -function substr_icount (string $haystack, string $needle, ...$params): int |
|
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 | -function str_replace_assoc (string $subject, array $replacements): string |
|
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 | -function pre (...$args): void |
|
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 | -function messageBox (string $message, string $caption = '', ...$args) |
|
181 | +function messageBox(string $message, string $caption = '', ...$args) |
|
182 | 182 | { |
183 | - return (new MessageBox)->show ($message, $caption, ...$args); |
|
183 | + return (new MessageBox)->show($message, $caption, ...$args); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | class Components |
187 | 187 | { |
188 | 188 | static array $components = []; |
189 | 189 | |
190 | - public static function addComponent (int $selector, object $object): void |
|
190 | + public static function addComponent(int $selector, object $object): void |
|
191 | 191 | { |
192 | 192 | self::$components[$selector] = $object; |
193 | 193 | } |
194 | 194 | |
195 | - public static function getComponent (int $selector) |
|
195 | + public static function getComponent(int $selector) |
|
196 | 196 | { |
197 | 197 | return isset (self::$components[$selector]) ? |
198 | 198 | self::$components[$selector] : false; |
199 | 199 | } |
200 | 200 | |
201 | - public static function componentExists (int $selector): bool |
|
201 | + public static function componentExists(int $selector): bool |
|
202 | 202 | { |
203 | 203 | return isset (self::$components[$selector]); |
204 | 204 | } |
205 | 205 | |
206 | - public static function removeComponent (int $selector): void |
|
206 | + public static function removeComponent(int $selector): void |
|
207 | 207 | { |
208 | 208 | unset (self::$components[$selector]); |
209 | 209 | } |
210 | 210 | |
211 | - public static function cleanJunk (): void |
|
211 | + public static function cleanJunk(): void |
|
212 | 212 | { |
213 | 213 | // TODO: более строгие правила очистки мусорных объектов |
214 | 214 | |
@@ -216,46 +216,46 @@ discard block |
||
216 | 216 | { |
217 | 217 | try |
218 | 218 | { |
219 | - if ($object->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms'))) |
|
219 | + if ($object->getType()->isSubclassOf(VoidEngine::objectType('System.Windows.Forms.Form', 'System.Windows.Forms'))) |
|
220 | 220 | continue; |
221 | 221 | } |
222 | 222 | |
223 | 223 | catch (\Exception $e) {} |
224 | 224 | |
225 | - VoidEngine::destructObject ($selector); |
|
225 | + VoidEngine::destructObject($selector); |
|
226 | 226 | |
227 | - if (!VoidEngine::objectExists ($selector)) |
|
227 | + if (!VoidEngine::objectExists($selector)) |
|
228 | 228 | unset (self::$components[$selector]); |
229 | 229 | } |
230 | 230 | } |
231 | 231 | } |
232 | 232 | |
233 | -function _c (int $selector) |
|
233 | +function _c(int $selector) |
|
234 | 234 | { |
235 | - return Components::getComponent ($selector); |
|
235 | + return Components::getComponent($selector); |
|
236 | 236 | } |
237 | 237 | |
238 | -function c ($name, bool $returnAllSimilarObjects = false) |
|
238 | +function c($name, bool $returnAllSimilarObjects = false) |
|
239 | 239 | { |
240 | - if (is_int ($name) && is_object ($object = _c ($name))) |
|
240 | + if (is_int($name) && is_object($object = _c($name))) |
|
241 | 241 | return $object; |
242 | 242 | |
243 | 243 | else |
244 | 244 | { |
245 | - $path = explode ('->', $name); |
|
245 | + $path = explode('->', $name); |
|
246 | 246 | $similar = []; |
247 | 247 | |
248 | 248 | foreach (Components::$components as $object) |
249 | 249 | try |
250 | 250 | { |
251 | - if ($object->name == end ($path)) |
|
251 | + if ($object->name == end($path)) |
|
252 | 252 | { |
253 | - if (sizeof ($path) > 1) |
|
253 | + if (sizeof($path) > 1) |
|
254 | 254 | try |
255 | 255 | { |
256 | - if (is_object ($parent = _c($object->parent->selector))) |
|
256 | + if (is_object($parent = _c($object->parent->selector))) |
|
257 | 257 | { |
258 | - if (c(join ('->', array_slice ($path, 0, -1))) == $parent) |
|
258 | + if (c(join('->', array_slice($path, 0, -1))) == $parent) |
|
259 | 259 | { |
260 | 260 | if ($returnAllSimilarObjects) |
261 | 261 | $similar[] = $object; |
@@ -289,18 +289,18 @@ discard block |
||
289 | 289 | continue; |
290 | 290 | } |
291 | 291 | |
292 | - if (sizeof ($path) == 2) |
|
292 | + if (sizeof($path) == 2) |
|
293 | 293 | { |
294 | 294 | $objects = c($path[1], true); |
295 | 295 | |
296 | - if (is_array ($objects)) |
|
296 | + if (is_array($objects)) |
|
297 | 297 | { |
298 | 298 | foreach ($objects as $id => $object) |
299 | 299 | try |
300 | 300 | { |
301 | - while (is_object ($parent = _c($object->parent->selector))) |
|
301 | + while (is_object($parent = _c($object->parent->selector))) |
|
302 | 302 | { |
303 | - if ($parent->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms')) && $parent->name == $path[0]) |
|
303 | + if ($parent->getType()->isSubclassOf(VoidEngine::objectType('System.Windows.Forms.Form', 'System.Windows.Forms')) && $parent->name == $path[0]) |
|
304 | 304 | return $objects[$id]; |
305 | 305 | |
306 | 306 | else $object = $parent; |
@@ -318,70 +318,70 @@ discard block |
||
318 | 318 | else return false; |
319 | 319 | } |
320 | 320 | |
321 | - else return $returnAllSimilarObjects && sizeof ($similar) > 0 ? |
|
321 | + else return $returnAllSimilarObjects && sizeof($similar) > 0 ? |
|
322 | 322 | $similar : false; |
323 | 323 | } |
324 | 324 | } |
325 | 325 | |
326 | -function setTimer (int $interval, callable $function): Timer |
|
326 | +function setTimer(int $interval, callable $function): Timer |
|
327 | 327 | { |
328 | 328 | $timer = new Timer; |
329 | 329 | $timer->interval = $interval; |
330 | 330 | |
331 | - $timer->tickEvent = function ($self) use ($function) |
|
331 | + $timer->tickEvent = function($self) use ($function) |
|
332 | 332 | { |
333 | - call_user_func ($function, $self); |
|
333 | + call_user_func($function, $self); |
|
334 | 334 | }; |
335 | 335 | |
336 | - $timer->start (); |
|
336 | + $timer->start(); |
|
337 | 337 | |
338 | 338 | return $timer; |
339 | 339 | } |
340 | 340 | |
341 | 341 | // FIXME: выполняется несколько раз, а не единожды |
342 | -function setTimeout (int $timeout, callable $function): Timer |
|
342 | +function setTimeout(int $timeout, callable $function): Timer |
|
343 | 343 | { |
344 | 344 | $timer = new Timer; |
345 | 345 | $timer->interval = $timeout; |
346 | 346 | |
347 | - $timer->tickEvent = function ($self) use ($function) |
|
347 | + $timer->tickEvent = function($self) use ($function) |
|
348 | 348 | { |
349 | - call_user_func ($function, $self); |
|
349 | + call_user_func($function, $self); |
|
350 | 350 | |
351 | - $self->stop (); |
|
351 | + $self->stop(); |
|
352 | 352 | }; |
353 | 353 | |
354 | - $timer->start (); |
|
354 | + $timer->start(); |
|
355 | 355 | |
356 | 356 | return $timer; |
357 | 357 | } |
358 | 358 | |
359 | 359 | class Clipboard |
360 | 360 | { |
361 | - public static function getText () |
|
361 | + public static function getText() |
|
362 | 362 | { |
363 | - return (new WFClass ('System.Windows.Forms.Clipboard'))->getText (); |
|
363 | + return (new WFClass('System.Windows.Forms.Clipboard'))->getText(); |
|
364 | 364 | } |
365 | 365 | |
366 | - public static function setText (string $text): void |
|
366 | + public static function setText(string $text): void |
|
367 | 367 | { |
368 | - (new WFClass ('System.Windows.Forms.Clipboard'))->setText ($text); |
|
368 | + (new WFClass('System.Windows.Forms.Clipboard'))->setText($text); |
|
369 | 369 | } |
370 | 370 | |
371 | - public static function getFiles (): array |
|
371 | + public static function getFiles(): array |
|
372 | 372 | { |
373 | - return (new WFClass ('System.Windows.Forms.Clipboard'))->getFileDropList ()->list; |
|
373 | + return (new WFClass('System.Windows.Forms.Clipboard'))->getFileDropList()->list; |
|
374 | 374 | } |
375 | 375 | |
376 | - public static function setFiles (array $files): void |
|
376 | + public static function setFiles(array $files): void |
|
377 | 377 | { |
378 | - $collection = new WFObject ('System.Collections.Specialized.StringCollection'); |
|
378 | + $collection = new WFObject('System.Collections.Specialized.StringCollection'); |
|
379 | 379 | |
380 | 380 | foreach ($files as $file) |
381 | - $collection->add ((string) $file); |
|
381 | + $collection->add((string) $file); |
|
382 | 382 | |
383 | - (new WFClass ('System.Windows.Forms.Clipboard'))->setFileDropList ($collection); |
|
384 | - VoidEngine::removeObjects ($collection->selector); |
|
383 | + (new WFClass('System.Windows.Forms.Clipboard'))->setFileDropList($collection); |
|
384 | + VoidEngine::removeObjects($collection->selector); |
|
385 | 385 | } |
386 | 386 | } |
387 | 387 | |
@@ -389,14 +389,13 @@ discard block |
||
389 | 389 | { |
390 | 390 | protected $cursor; |
391 | 391 | |
392 | - public function __construct (int $handle = null) |
|
392 | + public function __construct(int $handle = null) |
|
393 | 393 | { |
394 | 394 | $handle !== null ? |
395 | - $this->cursor = new WFObject ('System.Windows.Forms.Cursor', 'auto', $handle) : |
|
396 | - $this->cursor = new WFClass ('System.Windows.Forms.Cursor'); |
|
395 | + $this->cursor = new WFObject('System.Windows.Forms.Cursor', 'auto', $handle) : $this->cursor = new WFClass('System.Windows.Forms.Cursor'); |
|
397 | 396 | } |
398 | 397 | |
399 | - public function getPosition (): array |
|
398 | + public function getPosition(): array |
|
400 | 399 | { |
401 | 400 | $pos = $this->cursor->position; |
402 | 401 | |
@@ -407,22 +406,22 @@ discard block |
||
407 | 406 | } |
408 | 407 | } |
409 | 408 | |
410 | -function get_cursor_x (int $handle = null): int |
|
409 | +function get_cursor_x(int $handle = null): int |
|
411 | 410 | { |
412 | - return (new Cursor ($handle))->getPosition ()[0]; |
|
411 | + return (new Cursor($handle))->getPosition()[0]; |
|
413 | 412 | } |
414 | 413 | |
415 | -function get_cursor_y (int $handle = null): int |
|
414 | +function get_cursor_y(int $handle = null): int |
|
416 | 415 | { |
417 | - return (new Cursor ($handle))->getPosition ()[1]; |
|
416 | + return (new Cursor($handle))->getPosition()[1]; |
|
418 | 417 | } |
419 | 418 | |
420 | -function get_cursor_pos (int $handle = null): array |
|
419 | +function get_cursor_pos(int $handle = null): array |
|
421 | 420 | { |
422 | - return (new Cursor ($handle))->getPosition (); |
|
421 | + return (new Cursor($handle))->getPosition(); |
|
423 | 422 | } |
424 | 423 | |
425 | -set_error_handler (function ($no, $str, $file, $line) |
|
424 | +set_error_handler(function($no, $str, $file, $line) |
|
426 | 425 | { |
427 | 426 | // Мог ли я здесь сделать более адекватный код с использованием pow/sqrt? Да, мог |
428 | 427 | // Почему не сделал? Скорость важнее |
@@ -445,7 +444,7 @@ discard block |
||
445 | 444 | ]; |
446 | 445 | |
447 | 446 | if ($GLOBALS['__debug']['error_status']) |
448 | - message ([ |
|
447 | + message([ |
|
449 | 448 | 'type' => $errarr[$no], |
450 | 449 | 'text' => $str, |
451 | 450 | 'file' => $file, |
@@ -6,8 +6,9 @@ discard block |
||
6 | 6 | { |
7 | 7 | $oldStatus = $GLOBALS['__debug']['error_status']; |
8 | 8 | |
9 | - if ($status !== null) |
|
10 | - $GLOBALS['__debug']['error_status'] = $status; |
|
9 | + if ($status !== null) { |
|
10 | + $GLOBALS['__debug']['error_status'] = $status; |
|
11 | + } |
|
11 | 12 | |
12 | 13 | return $oldStatus; |
13 | 14 | } |
@@ -41,9 +42,7 @@ discard block |
||
41 | 42 | try |
42 | 43 | { |
43 | 44 | eval ('return; '. $code); |
44 | - } |
|
45 | - |
|
46 | - catch (\Throwable $e) |
|
45 | + } catch (\Throwable $e) |
|
47 | 46 | { |
48 | 47 | return [ |
49 | 48 | 'text' => $e->getMessage (), |
@@ -67,34 +66,39 @@ discard block |
||
67 | 66 | $array = (new WFClass ('System.Array', null)) |
68 | 67 | ->createInstance (VoidEngine::objectType ($type), $size = sizeof ($items)); |
69 | 68 | |
70 | - for ($i = 0; $i < $size; ++$i) |
|
71 | - $array[$i] = array_shift ($items); |
|
69 | + for ($i = 0; $i < $size; ++$i) { |
|
70 | + $array[$i] = array_shift ($items); |
|
71 | + } |
|
72 | 72 | |
73 | 73 | return $array; |
74 | 74 | } |
75 | 75 | |
76 | 76 | function dir_create (string $path, int $mode = 0777): void |
77 | 77 | { |
78 | - if (!is_dir ($path)) |
|
79 | - mkdir ($path, $mode, true); |
|
80 | -} |
|
78 | + if (!is_dir ($path)) { |
|
79 | + mkdir ($path, $mode, true); |
|
80 | + } |
|
81 | + } |
|
81 | 82 | |
82 | 83 | function dir_delete (string $path): bool |
83 | 84 | { |
84 | - if (!is_dir ($path)) |
|
85 | - return false; |
|
85 | + if (!is_dir ($path)) { |
|
86 | + return false; |
|
87 | + } |
|
86 | 88 | |
87 | - foreach (array_slice (scandir ($path), 2) as $file) |
|
88 | - if (is_dir ($file = $path .'/'. $file)) |
|
89 | + foreach (array_slice (scandir ($path), 2) as $file) { |
|
90 | + if (is_dir ($file = $path .'/'. $file)) |
|
89 | 91 | { |
90 | 92 | dir_delete ($file); |
93 | + } |
|
91 | 94 | |
92 | - if (is_dir ($file)) |
|
93 | - rmdir ($file); |
|
95 | + if (is_dir ($file)) { |
|
96 | + rmdir ($file); |
|
97 | + } |
|
98 | + } else { |
|
99 | + unlink ($file); |
|
94 | 100 | } |
95 | 101 | |
96 | - else unlink ($file); |
|
97 | - |
|
98 | 102 | rmdir ($path); |
99 | 103 | |
100 | 104 | return true; |
@@ -108,17 +112,22 @@ discard block |
||
108 | 112 | |
109 | 113 | function dir_copy (string $from, string $to): bool |
110 | 114 | { |
111 | - if (!is_dir ($from)) |
|
112 | - return false; |
|
115 | + if (!is_dir ($from)) { |
|
116 | + return false; |
|
117 | + } |
|
113 | 118 | |
114 | - if (!is_dir ($to)) |
|
115 | - dir_create ($to); |
|
119 | + if (!is_dir ($to)) { |
|
120 | + dir_create ($to); |
|
121 | + } |
|
116 | 122 | |
117 | - foreach (array_slice (scandir ($from), 2) as $file) |
|
118 | - if (is_dir ($f = $from .'/'. $file)) |
|
123 | + foreach (array_slice (scandir ($from), 2) as $file) { |
|
124 | + if (is_dir ($f = $from .'/'. $file)) |
|
119 | 125 | dir_copy ($f, $to .'/'. $file); |
126 | + } |
|
120 | 127 | |
121 | - else copy ($f, $to .'/'. $file); |
|
128 | + else { |
|
129 | + copy ($f, $to .'/'. $file); |
|
130 | + } |
|
122 | 131 | |
123 | 132 | return true; |
124 | 133 | } |
@@ -216,16 +225,16 @@ discard block |
||
216 | 225 | { |
217 | 226 | try |
218 | 227 | { |
219 | - if ($object->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms'))) |
|
220 | - continue; |
|
221 | - } |
|
222 | - |
|
223 | - catch (\Exception $e) {} |
|
228 | + if ($object->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms'))) { |
|
229 | + continue; |
|
230 | + } |
|
231 | + } catch (\Exception $e) {} |
|
224 | 232 | |
225 | 233 | VoidEngine::destructObject ($selector); |
226 | 234 | |
227 | - if (!VoidEngine::objectExists ($selector)) |
|
228 | - unset (self::$components[$selector]); |
|
235 | + if (!VoidEngine::objectExists ($selector)) { |
|
236 | + unset (self::$components[$selector]); |
|
237 | + } |
|
229 | 238 | } |
230 | 239 | } |
231 | 240 | } |
@@ -237,16 +246,15 @@ discard block |
||
237 | 246 | |
238 | 247 | function c ($name, bool $returnAllSimilarObjects = false) |
239 | 248 | { |
240 | - if (is_int ($name) && is_object ($object = _c ($name))) |
|
241 | - return $object; |
|
242 | - |
|
243 | - else |
|
249 | + if (is_int ($name) && is_object ($object = _c ($name))) { |
|
250 | + return $object; |
|
251 | + } else |
|
244 | 252 | { |
245 | 253 | $path = explode ('->', $name); |
246 | 254 | $similar = []; |
247 | 255 | |
248 | - foreach (Components::$components as $object) |
|
249 | - try |
|
256 | + foreach (Components::$components as $object) { |
|
257 | + try |
|
250 | 258 | { |
251 | 259 | if ($object->name == end ($path)) |
252 | 260 | { |
@@ -259,32 +267,30 @@ discard block |
||
259 | 267 | { |
260 | 268 | if ($returnAllSimilarObjects) |
261 | 269 | $similar[] = $object; |
270 | + } |
|
262 | 271 | |
263 | - else return $object; |
|
272 | + else { |
|
273 | + return $object; |
|
274 | + } |
|
275 | + } else { |
|
276 | + continue; |
|
264 | 277 | } |
265 | - |
|
266 | - else continue; |
|
278 | + } else { |
|
279 | + continue; |
|
267 | 280 | } |
268 | - |
|
269 | - else continue; |
|
270 | - } |
|
271 | - |
|
272 | - catch (\Throwable $e) |
|
281 | + } catch (\Throwable $e) |
|
273 | 282 | { |
274 | 283 | continue; |
275 | - } |
|
276 | - |
|
277 | - else |
|
284 | + } else |
|
278 | 285 | { |
279 | - if ($returnAllSimilarObjects) |
|
280 | - $similar[] = $object; |
|
281 | - |
|
282 | - else return $object; |
|
286 | + if ($returnAllSimilarObjects) { |
|
287 | + $similar[] = $object; |
|
288 | + } else { |
|
289 | + return $object; |
|
290 | + } |
|
283 | 291 | } |
284 | 292 | } |
285 | - } |
|
286 | - |
|
287 | - catch (\Exception $e) |
|
293 | + } catch (\Exception $e) |
|
288 | 294 | { |
289 | 295 | continue; |
290 | 296 | } |
@@ -295,31 +301,32 @@ discard block |
||
295 | 301 | |
296 | 302 | if (is_array ($objects)) |
297 | 303 | { |
298 | - foreach ($objects as $id => $object) |
|
299 | - try |
|
304 | + foreach ($objects as $id => $object) { |
|
305 | + try |
|
300 | 306 | { |
301 | 307 | while (is_object ($parent = _c($object->parent->selector))) |
302 | 308 | { |
303 | 309 | if ($parent->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms')) && $parent->name == $path[0]) |
304 | 310 | return $objects[$id]; |
311 | + } |
|
305 | 312 | |
306 | - else $object = $parent; |
|
313 | + else { |
|
314 | + $object = $parent; |
|
315 | + } |
|
307 | 316 | } |
308 | - } |
|
309 | - |
|
310 | - catch (\Throwable $e) |
|
317 | + } catch (\Throwable $e) |
|
311 | 318 | { |
312 | 319 | continue; |
313 | 320 | } |
314 | 321 | |
315 | 322 | return false; |
323 | + } else { |
|
324 | + return false; |
|
316 | 325 | } |
317 | - |
|
318 | - else return false; |
|
319 | - } |
|
320 | - |
|
321 | - else return $returnAllSimilarObjects && sizeof ($similar) > 0 ? |
|
326 | + } else { |
|
327 | + return $returnAllSimilarObjects && sizeof ($similar) > 0 ? |
|
322 | 328 | $similar : false; |
329 | + } |
|
323 | 330 | } |
324 | 331 | } |
325 | 332 | |
@@ -377,8 +384,9 @@ discard block |
||
377 | 384 | { |
378 | 385 | $collection = new WFObject ('System.Collections.Specialized.StringCollection'); |
379 | 386 | |
380 | - foreach ($files as $file) |
|
381 | - $collection->add ((string) $file); |
|
387 | + foreach ($files as $file) { |
|
388 | + $collection->add ((string) $file); |
|
389 | + } |
|
382 | 390 | |
383 | 391 | (new WFClass ('System.Windows.Forms.Clipboard'))->setFileDropList ($collection); |
384 | 392 | VoidEngine::removeObjects ($collection->selector); |
@@ -444,11 +452,12 @@ discard block |
||
444 | 452 | 16384 => 'E_USER_DEPRECATED' |
445 | 453 | ]; |
446 | 454 | |
447 | - if ($GLOBALS['__debug']['error_status']) |
|
448 | - message ([ |
|
455 | + if ($GLOBALS['__debug']['error_status']) { |
|
456 | + message ([ |
|
449 | 457 | 'type' => $errarr[$no], |
450 | 458 | 'text' => $str, |
451 | 459 | 'file' => $file, |
452 | 460 | 'line' => $line |
453 | 461 | ], 'PHP Script Error'); |
454 | -}); |
|
462 | + } |
|
463 | + }); |
@@ -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 | } |
@@ -8,11 +8,11 @@ discard block |
||
8 | 8 | |
9 | 9 | protected $image; |
10 | 10 | |
11 | - public function __construct (Component $parent = null) |
|
11 | + public function __construct(Component $parent = null) |
|
12 | 12 | { |
13 | - parent::__construct ($parent, $this->class); |
|
13 | + parent::__construct($parent, $this->class); |
|
14 | 14 | |
15 | - $this->image = new PictureBoxImage ($this->selector); |
|
15 | + $this->image = new PictureBoxImage($this->selector); |
|
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
@@ -22,30 +22,30 @@ discard block |
||
22 | 22 | protected $pictureBoxSelector; |
23 | 23 | protected $clipboard; |
24 | 24 | |
25 | - public function __construct (int $pictureBoxSelector) |
|
25 | + public function __construct(int $pictureBoxSelector) |
|
26 | 26 | { |
27 | 27 | $this->pictureBoxSelector = $pictureBoxSelector; |
28 | - $this->selector = VoidEngine::getProperty ($pictureBoxSelector, 'Image'); |
|
29 | - $this->clipboard = new WFClass ('System.Windows.Forms.Clipboard'); |
|
28 | + $this->selector = VoidEngine::getProperty($pictureBoxSelector, 'Image'); |
|
29 | + $this->clipboard = new WFClass('System.Windows.Forms.Clipboard'); |
|
30 | 30 | } |
31 | 31 | |
32 | - public function loadFromFile (string $file) |
|
32 | + public function loadFromFile(string $file) |
|
33 | 33 | { |
34 | - VoidEngine::setProperty ($this->pictureBoxSelector, 'Image', (new Image ())->loadFromFile ($file)->selector); |
|
34 | + VoidEngine::setProperty($this->pictureBoxSelector, 'Image', (new Image())->loadFromFile($file)->selector); |
|
35 | 35 | } |
36 | 36 | |
37 | - public function saveToFile (string $file) |
|
37 | + public function saveToFile(string $file) |
|
38 | 38 | { |
39 | - VoidEngine::callMethod ($this->selector, 'Save', $file); |
|
39 | + VoidEngine::callMethod($this->selector, 'Save', $file); |
|
40 | 40 | } |
41 | 41 | |
42 | - public function loadFromClipboard () |
|
42 | + public function loadFromClipboard() |
|
43 | 43 | { |
44 | - VoidEngine::setProperty ($this->pictureBoxSelector, 'Image', $this->clipboard->getImage ()); |
|
44 | + VoidEngine::setProperty($this->pictureBoxSelector, 'Image', $this->clipboard->getImage()); |
|
45 | 45 | } |
46 | 46 | |
47 | - public function saveToClipboard () |
|
47 | + public function saveToClipboard() |
|
48 | 48 | { |
49 | - $this->clipboard->setImage (VoidEngine::getProperty ($this->pictureBoxSelector, 'Image')); |
|
49 | + $this->clipboard->setImage(VoidEngine::getProperty($this->pictureBoxSelector, 'Image')); |
|
50 | 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 | } |
@@ -4,28 +4,27 @@ |
||
4 | 4 | |
5 | 5 | class Process extends Component |
6 | 6 | { |
7 | - public $class = 'System.Diagnostics.Process'; |
|
7 | + public $class = 'System.Diagnostics.Process'; |
|
8 | 8 | public $namespace = 'System'; |
9 | 9 | |
10 | - public function __construct (int $pid = null) |
|
10 | + public function __construct(int $pid = null) |
|
11 | 11 | { |
12 | - $this->selector = VoidEngine::createClass ($this->class, $this->namespace); |
|
12 | + $this->selector = VoidEngine::createClass($this->class, $this->namespace); |
|
13 | 13 | |
14 | 14 | if ($pid !== null) |
15 | - $this->selector = $pid == getmypid () ? |
|
16 | - VoidEngine::callMethod ($this->selector, 'GetCurrentProcess') : |
|
17 | - VoidEngine::callMethod ($this->selector, 'GetProcessById', $pid); |
|
15 | + $this->selector = $pid == getmypid() ? |
|
16 | + VoidEngine::callMethod($this->selector, 'GetCurrentProcess') : VoidEngine::callMethod($this->selector, 'GetProcessById', $pid); |
|
18 | 17 | |
19 | - Components::addComponent ($this->selector, $this); |
|
18 | + Components::addComponent($this->selector, $this); |
|
20 | 19 | } |
21 | 20 | |
22 | - public static function getProcessById (int $pid) |
|
21 | + public static function getProcessById(int $pid) |
|
23 | 22 | { |
24 | - return new self ($pid); |
|
23 | + return new self($pid); |
|
25 | 24 | } |
26 | 25 | |
27 | - public static function getCurrentProcess () |
|
26 | + public static function getCurrentProcess() |
|
28 | 27 | { |
29 | - return new self (getmypid ()); |
|
28 | + return new self(getmypid()); |
|
30 | 29 | } |
31 | 30 | } |
@@ -11,10 +11,11 @@ |
||
11 | 11 | { |
12 | 12 | $this->selector = VoidEngine::createClass ($this->class, $this->namespace); |
13 | 13 | |
14 | - if ($pid !== null) |
|
15 | - $this->selector = $pid == getmypid () ? |
|
14 | + if ($pid !== null) { |
|
15 | + $this->selector = $pid == getmypid () ? |
|
16 | 16 | VoidEngine::callMethod ($this->selector, 'GetCurrentProcess') : |
17 | 17 | VoidEngine::callMethod ($this->selector, 'GetProcessById', $pid); |
18 | + } |
|
18 | 19 | |
19 | 20 | Components::addComponent ($this->selector, $this); |
20 | 21 | } |
@@ -105,7 +105,8 @@ |
||
105 | 105 | require 'components/FastColoredTextBox.php'; |
106 | 106 | require 'components/Scintilla.php'; |
107 | 107 | |
108 | -if (is_dir ('extensions')) |
|
108 | +if (is_dir ('extensions')) { |
|
109 | 109 | foreach (scandir ('extensions') as $ext) |
110 | 110 | if (is_dir ('extensions/'. $ext) && file_exists ($ext = 'extensions/'. $ext .'/main.php')) |
111 | 111 | require $ext; |
112 | +} |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | const ENGINE_VERSION = '3.5.3 build-2019/09/13'; |
37 | 37 | const ENGINE_DIR = __DIR__; |
38 | 38 | |
39 | -chdir (ENGINE_DIR); |
|
39 | +chdir(ENGINE_DIR); |
|
40 | 40 | |
41 | 41 | $GLOBALS['__debug'] = [ |
42 | - 'start_time' => microtime (true), |
|
42 | + 'start_time' => microtime(true), |
|
43 | 43 | 'error_status' => true |
44 | 44 | ]; |
45 | 45 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | require 'common/Others.php'; |
50 | 50 | require 'common/Events.php'; |
51 | 51 | |
52 | -define ('VoidEngine\CORE_VERSION', $APPLICATION->productVersion); |
|
52 | +define('VoidEngine\CORE_VERSION', $APPLICATION->productVersion); |
|
53 | 53 | |
54 | 54 | require 'components/Component.php'; |
55 | 55 | require 'components/Control.php'; |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | require 'components/FastColoredTextBox.php'; |
99 | 99 | require 'components/Scintilla.php'; |
100 | 100 | |
101 | -if (is_dir ('extensions')) |
|
102 | - foreach (scandir ('extensions') as $ext) |
|
103 | - if (is_dir ('extensions/'. $ext) && file_exists ($ext = 'extensions/'. $ext .'/main.php')) |
|
101 | +if (is_dir('extensions')) |
|
102 | + foreach (scandir('extensions') as $ext) |
|
103 | + if (is_dir('extensions/'.$ext) && file_exists($ext = 'extensions/'.$ext.'/main.php')) |
|
104 | 104 | require $ext; |