Passed
Branch master (4b7a9f)
by Observer
01:48
created
engine/common/Others.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         return [
49 49
             'text' => $e->getMessage (), 
50
-			'line' => $e->getLine ()
50
+            'line' => $e->getLine ()
51 51
         ];
52 52
     }
53 53
 
@@ -170,20 +170,20 @@  discard block
 block discarded – undo
170 170
 
171 171
 function substr_icount (string $haystack, string $needle, ...$params): int
172 172
 {
173
-	return substr_count (strtolower ($haystack), strtolower ($needle), ...$params);
173
+    return substr_count (strtolower ($haystack), strtolower ($needle), ...$params);
174 174
 }
175 175
 
176 176
 function str_replace_assoc (string $subject, array $replacements): string
177 177
 {
178
-	return str_replace (array_keys ($replacements), array_values ($replacements), $subject);
178
+    return str_replace (array_keys ($replacements), array_values ($replacements), $subject);
179 179
 }
180 180
 
181 181
 function pre (...$args): void
182 182
 {
183
-	if (sizeof ($args) < 2)
184
-		$args = current ($args);
183
+    if (sizeof ($args) < 2)
184
+        $args = current ($args);
185 185
 	
186
-	message (print_r ($args, true));
186
+    message (print_r ($args, true));
187 187
 }
188 188
 
189 189
 function messageBox (string $message, string $caption = '', ...$args)
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
                     }
342 342
 
343 343
                     catch (\Throwable $e)
344
-					{
345
-						continue;
346
-					}
344
+                    {
345
+                        continue;
346
+                    }
347 347
 
348 348
                 return false;
349 349
             }
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
         call_user_func ($function, $self);
367 367
     };
368 368
     
369
-	$timer->start ();
369
+    $timer->start ();
370 370
     
371 371
     return $timer;
372 372
 }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     
387 387
     $timer->start ();
388 388
     
389
-	return $timer;
389
+    return $timer;
390 390
 }
391 391
 
392 392
 class Clipboard
Please login to merge, or discard this patch.
Spacing   +137 added lines, -138 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
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['error_status'];
8 8
 
@@ -12,183 +12,183 @@  discard block
 block discarded – undo
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 text (string $text): ?string
57
+function text(string $text): ?string
58 58
 {
59
-    return \VoidCore::to1251 ($text);
59
+    return \VoidCore::to1251($text);
60 60
 }
61 61
 
62
-function enum (string $name): array
62
+function enum(string $name): array
63 63
 {
64 64
     return [
65
-        substr ($name, strrpos ($name, '.') + 1),
66
-        ($name = substr ($name, 0, strrpos ($name, '.'))) .', '. substr ($name, 0, strrpos ($name, '.'))
65
+        substr($name, strrpos($name, '.') + 1),
66
+        ($name = substr($name, 0, strrpos($name, '.'))).', '.substr($name, 0, strrpos($name, '.'))
67 67
     ];
68 68
 }
69 69
 
70
-function getNetArray (string $type, array $items = []): WFObject
70
+function getNetArray(string $type, array $items = []): WFObject
71 71
 {
72
-    $array = (new WFClass ('System.Array', null))
73
-        ->createInstance (VoidEngine::objectType ($type), $size = sizeof ($items));
72
+    $array = (new WFClass('System.Array', null))
73
+        ->createInstance(VoidEngine::objectType($type), $size = sizeof($items));
74 74
 
75 75
     for ($i = 0; $i < $size; ++$i)
76
-        $array[$i] = array_shift ($items);
76
+        $array[$i] = array_shift($items);
77 77
     
78 78
     return $array;
79 79
 }
80 80
 
81
-function dir_create (string $path, int $mode = 0777): void
81
+function dir_create(string $path, int $mode = 0777): void
82 82
 {
83
-    if (!is_dir ($path))
84
-        mkdir ($path, $mode, true);
83
+    if (!is_dir($path))
84
+        mkdir($path, $mode, true);
85 85
 }
86 86
 
87
-function dir_delete (string $path): bool
87
+function dir_delete(string $path): bool
88 88
 {
89
-    if (!is_dir ($path))
89
+    if (!is_dir($path))
90 90
         return false;
91 91
 
92
-    foreach (array_slice (scandir ($path), 2) as $file)
93
-        if (is_dir ($file = $path .'/'. $file))
92
+    foreach (array_slice(scandir($path), 2) as $file)
93
+        if (is_dir($file = $path.'/'.$file))
94 94
         {
95
-            dir_delete ($file);
95
+            dir_delete($file);
96 96
 
97
-            if (is_dir ($file))
98
-                rmdir ($file);
97
+            if (is_dir($file))
98
+                rmdir($file);
99 99
         }
100 100
 
101
-        else unlink ($file);
101
+        else unlink($file);
102 102
 
103
-    rmdir ($path);
103
+    rmdir($path);
104 104
 
105 105
     return true;
106 106
 }
107 107
 
108
-function dir_clean (string $path): void
108
+function dir_clean(string $path): void
109 109
 {
110
-    dir_delete ($path);
111
-    dir_create ($path);
110
+    dir_delete($path);
111
+    dir_create($path);
112 112
 }
113 113
 
114
-function dir_copy (string $from, string $to): bool
114
+function dir_copy(string $from, string $to): bool
115 115
 {
116
-    if (!is_dir ($from))
116
+    if (!is_dir($from))
117 117
         return false;
118 118
 
119
-    if (!is_dir ($to))
120
-        dir_create ($to);
119
+    if (!is_dir($to))
120
+        dir_create($to);
121 121
 
122
-    foreach (array_slice (scandir ($from), 2) as $file)
123
-        if (is_dir ($f = $from .'/'. $file))
124
-            dir_copy ($f, $to .'/'. $file);
122
+    foreach (array_slice(scandir($from), 2) as $file)
123
+        if (is_dir($f = $from.'/'.$file))
124
+            dir_copy($f, $to.'/'.$file);
125 125
 
126
-        else copy ($f, $to .'/'. $file);
126
+        else copy($f, $to.'/'.$file);
127 127
 
128 128
     return true;
129 129
 }
130 130
 
131
-function getARGBColor (string $color)
131
+function getARGBColor(string $color)
132 132
 {
133
-    return (new WFClass ('System.Drawing.ColorTranslator'))->fromHtml ($color);
133
+    return (new WFClass('System.Drawing.ColorTranslator'))->fromHtml($color);
134 134
 }
135 135
 
136
-function replaceSl (string $string): string
136
+function replaceSl(string $string): string
137 137
 {
138
-    return str_replace ('\\', '/', $string);
138
+    return str_replace('\\', '/', $string);
139 139
 }
140 140
 
141
-function replaceSr (string $string): string
141
+function replaceSr(string $string): string
142 142
 {
143
-    return str_replace ('/', '\\', $string);
143
+    return str_replace('/', '\\', $string);
144 144
 }
145 145
 
146
-function basenameNoExt (string $path): string
146
+function basenameNoExt(string $path): string
147 147
 {
148
-    return pathinfo ($path, PATHINFO_FILENAME);
148
+    return pathinfo($path, PATHINFO_FILENAME);
149 149
 }
150 150
 
151
-function file_ext (string $path): string
151
+function file_ext(string $path): string
152 152
 {
153
-    return strtolower (pathinfo ($path, PATHINFO_EXTENSION));
153
+    return strtolower(pathinfo($path, PATHINFO_EXTENSION));
154 154
 }
155 155
 
156
-function filepathNoExt (string $path): string
156
+function filepathNoExt(string $path): string
157 157
 {
158
-    return dirname ($path) .'/'. basenameNoExt ($path);
158
+    return dirname($path).'/'.basenameNoExt($path);
159 159
 }
160 160
 
161
-function array_first (array $array)
161
+function array_first(array $array)
162 162
 {
163
-    return array_shift ($array);
163
+    return array_shift($array);
164 164
 }
165 165
 
166
-function array_end (array $array)
166
+function array_end(array $array)
167 167
 {
168
-    return array_pop ($array);
168
+    return array_pop($array);
169 169
 }
170 170
 
171
-function substr_icount (string $haystack, string $needle, ...$params): int
171
+function substr_icount(string $haystack, string $needle, ...$params): int
172 172
 {
173
-	return substr_count (strtolower ($haystack), strtolower ($needle), ...$params);
173
+	return substr_count(strtolower($haystack), strtolower($needle), ...$params);
174 174
 }
175 175
 
176
-function str_replace_assoc (string $subject, array $replacements): string
176
+function str_replace_assoc(string $subject, array $replacements): string
177 177
 {
178
-	return str_replace (array_keys ($replacements), array_values ($replacements), $subject);
178
+	return str_replace(array_keys($replacements), array_values($replacements), $subject);
179 179
 }
180 180
 
181
-function pre (...$args): void
181
+function pre(...$args): void
182 182
 {
183
-	if (sizeof ($args) < 2)
184
-		$args = current ($args);
183
+	if (sizeof($args) < 2)
184
+		$args = current($args);
185 185
 	
186
-	message (print_r ($args, true));
186
+	message(print_r($args, true));
187 187
 }
188 188
 
189
-function messageBox (string $message, string $caption = '', ...$args)
189
+function messageBox(string $message, string $caption = '', ...$args)
190 190
 {
191
-    return (new MessageBox)->show ($message, $caption, ...$args);
191
+    return (new MessageBox)->show($message, $caption, ...$args);
192 192
 }
193 193
 
194 194
 class Components
@@ -196,47 +196,47 @@  discard block
 block discarded – undo
196 196
     static $components = [];
197 197
     static $events = [];
198 198
 
199
-    public static function addComponent (int $selector, object $object): void
199
+    public static function addComponent(int $selector, object $object): void
200 200
     {
201 201
         self::$components[$selector] = $object;
202 202
         self::$events[$selector] = [];
203 203
     }
204 204
 
205
-    public static function getComponent (int $selector)
205
+    public static function getComponent(int $selector)
206 206
     {
207 207
         return isset (self::$components[$selector]) ?
208 208
             self::$components[$selector] : false;
209 209
     }
210 210
 
211
-    public static function componentExists (int $selector): bool
211
+    public static function componentExists(int $selector): bool
212 212
     {
213 213
         return isset (self::$components[$selector]);
214 214
     }
215 215
 
216
-    public static function setComponentEvent (int $selector, string $eventName, string $code): void
216
+    public static function setComponentEvent(int $selector, string $eventName, string $code): void
217 217
     {
218
-        self::$events[$selector][strtolower ($eventName)] = $code;
218
+        self::$events[$selector][strtolower($eventName)] = $code;
219 219
     }
220 220
 
221
-    public static function getComponentEvent (int $selector, string $eventName)
221
+    public static function getComponentEvent(int $selector, string $eventName)
222 222
     {
223
-        $eventName = strtolower ($eventName);
223
+        $eventName = strtolower($eventName);
224 224
 
225 225
         return isset (self::$events[$selector][$eventName]) ?
226 226
             self::$events[$selector][$eventName] : false;
227 227
     }
228 228
 
229
-    public static function removeComponentEvent (int $selector, string $eventName): void
229
+    public static function removeComponentEvent(int $selector, string $eventName): void
230 230
     {
231
-        unset (self::$events[$selector][strtolower ($eventName)]);
231
+        unset (self::$events[$selector][strtolower($eventName)]);
232 232
     }
233 233
 
234
-    public static function removeComponent (int $selector): void
234
+    public static function removeComponent(int $selector): void
235 235
     {
236 236
         unset (self::$components[$selector], self::$events[$selector]);
237 237
     }
238 238
 
239
-    public static function cleanJunk (): void
239
+    public static function cleanJunk(): void
240 240
     {
241 241
         // TODO: более строгие правила очистки мусорных объектов
242 242
         
@@ -244,15 +244,15 @@  discard block
 block discarded – undo
244 244
         {
245 245
             try
246 246
             {
247
-                if ($object->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms')))
247
+                if ($object->getType()->isSubclassOf(VoidEngine::objectType('System.Windows.Forms.Form', 'System.Windows.Forms')))
248 248
                     continue;
249 249
             }
250 250
 
251 251
             catch (\Exception $e) {}
252 252
             
253
-            VoidEngine::destructObject ($selector);
253
+            VoidEngine::destructObject($selector);
254 254
 
255
-            if (!VoidEngine::objectExists ($selector))
255
+            if (!VoidEngine::objectExists($selector))
256 256
             {
257 257
                 unset (self::$components[$selector]);
258 258
 
@@ -263,32 +263,32 @@  discard block
 block discarded – undo
263 263
     }
264 264
 }
265 265
 
266
-function _c (int $selector)
266
+function _c(int $selector)
267 267
 {
268
-    return Components::getComponent ($selector);
268
+    return Components::getComponent($selector);
269 269
 }
270 270
 
271
-function c ($name, bool $returnAllSimilarObjects = false)
271
+function c($name, bool $returnAllSimilarObjects = false)
272 272
 {
273
-    if (is_int ($name) && is_object ($object = _c ($name)))
273
+    if (is_int($name) && is_object($object = _c($name)))
274 274
         return $object;
275 275
 
276 276
     else
277 277
     {
278
-        $path    = explode ('->', $name);
278
+        $path    = explode('->', $name);
279 279
         $similar = [];
280 280
 
281 281
         foreach (Components::$components as $object)
282 282
             try
283 283
             {
284
-                if ($object->name == end ($path))
284
+                if ($object->name == end($path))
285 285
                 {
286
-                    if (sizeof ($path) > 1)
286
+                    if (sizeof($path) > 1)
287 287
                         try
288 288
                         {
289
-                            if (is_object ($parent = _c($object->parent->selector)))
289
+                            if (is_object($parent = _c($object->parent->selector)))
290 290
                             {
291
-                                if (c(join ('->', array_slice ($path, 0, -1))) == $parent)
291
+                                if (c(join('->', array_slice($path, 0, -1))) == $parent)
292 292
                                 {
293 293
                                     if ($returnAllSimilarObjects)
294 294
                                         $similar[] = $object;
@@ -322,18 +322,18 @@  discard block
 block discarded – undo
322 322
                 continue;
323 323
             }
324 324
 
325
-        if (sizeof ($path) == 2)
325
+        if (sizeof($path) == 2)
326 326
         {
327 327
             $objects = c($path[1], true);
328 328
 
329
-            if (is_array ($objects))
329
+            if (is_array($objects))
330 330
             {
331 331
                 foreach ($objects as $id => $object)
332 332
                     try
333 333
                     {
334
-                        while (is_object ($parent = _c($object->parent->selector)))
334
+                        while (is_object($parent = _c($object->parent->selector)))
335 335
                         {
336
-                            if ($parent->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms')) && $parent->name == $path[0])
336
+                            if ($parent->getType()->isSubclassOf(VoidEngine::objectType('System.Windows.Forms.Form', 'System.Windows.Forms')) && $parent->name == $path[0])
337 337
                                 return $objects[$id];
338 338
 
339 339
                             else $object = $parent;
@@ -351,70 +351,70 @@  discard block
 block discarded – undo
351 351
             else return false;
352 352
         }
353 353
 
354
-        else return $returnAllSimilarObjects && sizeof ($similar) > 0 ?
354
+        else return $returnAllSimilarObjects && sizeof($similar) > 0 ?
355 355
             $similar : false;
356 356
     }
357 357
 }
358 358
 
359
-function setTimer (int $interval, callable $function): Timer
359
+function setTimer(int $interval, callable $function): Timer
360 360
 {
361 361
     $timer = new Timer;
362 362
     $timer->interval = $interval;
363 363
     
364
-    $timer->tickEvent = function ($self) use ($function)
364
+    $timer->tickEvent = function($self) use ($function)
365 365
     {
366
-        call_user_func ($function, $self);
366
+        call_user_func($function, $self);
367 367
     };
368 368
     
369
-	$timer->start ();
369
+	$timer->start();
370 370
     
371 371
     return $timer;
372 372
 }
373 373
 
374 374
 // FIXME: выполняется несколько раз, а не единожды
375
-function setTimeout (int $timeout, callable $function): Timer
375
+function setTimeout(int $timeout, callable $function): Timer
376 376
 {
377 377
     $timer = new Timer;
378 378
     $timer->interval = $timeout;
379 379
     
380
-    $timer->tickEvent = function ($self) use ($function)
380
+    $timer->tickEvent = function($self) use ($function)
381 381
     {
382
-        call_user_func ($function, $self);
382
+        call_user_func($function, $self);
383 383
 
384
-        $self->stop ();
384
+        $self->stop();
385 385
     };
386 386
     
387
-    $timer->start ();
387
+    $timer->start();
388 388
     
389 389
 	return $timer;
390 390
 }
391 391
 
392 392
 class Clipboard
393 393
 {
394
-    public static function getText ()
394
+    public static function getText()
395 395
     {
396
-        return (new WFClass ('System.Windows.Forms.Clipboard'))->getText ();
396
+        return (new WFClass('System.Windows.Forms.Clipboard'))->getText();
397 397
     }
398 398
     
399
-    public static function setText (string $text): void
399
+    public static function setText(string $text): void
400 400
     {
401
-        (new WFClass ('System.Windows.Forms.Clipboard'))->setText ($text);
401
+        (new WFClass('System.Windows.Forms.Clipboard'))->setText($text);
402 402
     }
403 403
     
404
-    public static function getFiles (): array
404
+    public static function getFiles(): array
405 405
     {
406
-        return (new WFClass ('System.Windows.Forms.Clipboard'))->getFileDropList ()->list;
406
+        return (new WFClass('System.Windows.Forms.Clipboard'))->getFileDropList()->list;
407 407
     }
408 408
     
409
-    public static function setFiles (array $files): void
409
+    public static function setFiles(array $files): void
410 410
     {
411
-        $collection = new WFObject ('System.Collections.Specialized.StringCollection');
411
+        $collection = new WFObject('System.Collections.Specialized.StringCollection');
412 412
 
413 413
         foreach ($files as $file)
414
-            $collection->add ((string) $file);
414
+            $collection->add((string) $file);
415 415
 
416
-        (new WFClass ('System.Windows.Forms.Clipboard'))->setFileDropList ($collection);
417
-        VoidEngine::removeObjects ($collection->selector);
416
+        (new WFClass('System.Windows.Forms.Clipboard'))->setFileDropList($collection);
417
+        VoidEngine::removeObjects($collection->selector);
418 418
     }
419 419
 }
420 420
 
@@ -422,14 +422,13 @@  discard block
 block discarded – undo
422 422
 {
423 423
     protected $cursor;
424 424
 
425
-    public function __construct (int $handle = null)
425
+    public function __construct(int $handle = null)
426 426
     {
427 427
         $handle !== null ?
428
-            $this->cursor = new WFObject ('System.Windows.Forms.Cursor', 'auto', $handle) :
429
-            $this->cursor = new WFClass ('System.Windows.Forms.Cursor');
428
+            $this->cursor = new WFObject('System.Windows.Forms.Cursor', 'auto', $handle) : $this->cursor = new WFClass('System.Windows.Forms.Cursor');
430 429
     }
431 430
 
432
-    public function getPosition (): array
431
+    public function getPosition(): array
433 432
     {
434 433
         $pos = $this->cursor->position;
435 434
 
@@ -440,35 +439,35 @@  discard block
 block discarded – undo
440 439
     }
441 440
 }
442 441
 
443
-function get_cursor_x (int $handle = null): int
442
+function get_cursor_x(int $handle = null): int
444 443
 {
445
-    $cursor = new Cursor ($handle);
444
+    $cursor = new Cursor($handle);
446 445
 
447
-    return $cursor->getPosition ()[0];
446
+    return $cursor->getPosition()[0];
448 447
 }
449 448
 
450
-function get_cursor_y (int $handle = null): int
449
+function get_cursor_y(int $handle = null): int
451 450
 {
452
-    $cursor = new Cursor ($handle);
451
+    $cursor = new Cursor($handle);
453 452
 
454
-    return $cursor->getPosition ()[1];
453
+    return $cursor->getPosition()[1];
455 454
 }
456 455
 
457
-function get_cursor_pos (int $handle = null): array
456
+function get_cursor_pos(int $handle = null): array
458 457
 {
459
-    $cursor = new Cursor ($handle);
458
+    $cursor = new Cursor($handle);
460 459
 
461
-    return $cursor->getPosition ();
460
+    return $cursor->getPosition();
462 461
 }
463 462
 
464
-set_error_handler (function (...$args)
463
+set_error_handler(function(...$args)
465 464
 {
466 465
     if ($GLOBALS['error_status'])
467
-        pre ($args);
466
+        pre($args);
468 467
 });
469 468
 
470
-set_exception_handler (function (...$args)
469
+set_exception_handler(function(...$args)
471 470
 {
472 471
     if ($GLOBALS['error_status'])
473
-        pre ($args);
472
+        pre($args);
474 473
 });
Please login to merge, or discard this patch.
Braces   +88 added lines, -77 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@  discard block
 block discarded – undo
6 6
 {
7 7
     $oldStatus = $GLOBALS['error_status'];
8 8
 
9
-    if ($status !== null)
10
-        $GLOBALS['error_status'] = $status;
9
+    if ($status !== null) {
10
+            $GLOBALS['error_status'] = $status;
11
+    }
11 12
     
12 13
     return $oldStatus;
13 14
 }
@@ -41,9 +42,7 @@  discard block
 block discarded – undo
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 (), 
@@ -72,34 +71,39 @@  discard block
 block discarded – undo
72 71
     $array = (new WFClass ('System.Array', null))
73 72
         ->createInstance (VoidEngine::objectType ($type), $size = sizeof ($items));
74 73
 
75
-    for ($i = 0; $i < $size; ++$i)
76
-        $array[$i] = array_shift ($items);
74
+    for ($i = 0; $i < $size; ++$i) {
75
+            $array[$i] = array_shift ($items);
76
+    }
77 77
     
78 78
     return $array;
79 79
 }
80 80
 
81 81
 function dir_create (string $path, int $mode = 0777): void
82 82
 {
83
-    if (!is_dir ($path))
84
-        mkdir ($path, $mode, true);
85
-}
83
+    if (!is_dir ($path)) {
84
+            mkdir ($path, $mode, true);
85
+    }
86
+    }
86 87
 
87 88
 function dir_delete (string $path): bool
88 89
 {
89
-    if (!is_dir ($path))
90
-        return false;
90
+    if (!is_dir ($path)) {
91
+            return false;
92
+    }
91 93
 
92
-    foreach (array_slice (scandir ($path), 2) as $file)
93
-        if (is_dir ($file = $path .'/'. $file))
94
+    foreach (array_slice (scandir ($path), 2) as $file) {
95
+            if (is_dir ($file = $path .'/'. $file))
94 96
         {
95 97
             dir_delete ($file);
98
+    }
96 99
 
97
-            if (is_dir ($file))
98
-                rmdir ($file);
100
+            if (is_dir ($file)) {
101
+                            rmdir ($file);
102
+            }
103
+        } else {
104
+            unlink ($file);
99 105
         }
100 106
 
101
-        else unlink ($file);
102
-
103 107
     rmdir ($path);
104 108
 
105 109
     return true;
@@ -113,17 +117,22 @@  discard block
 block discarded – undo
113 117
 
114 118
 function dir_copy (string $from, string $to): bool
115 119
 {
116
-    if (!is_dir ($from))
117
-        return false;
120
+    if (!is_dir ($from)) {
121
+            return false;
122
+    }
118 123
 
119
-    if (!is_dir ($to))
120
-        dir_create ($to);
124
+    if (!is_dir ($to)) {
125
+            dir_create ($to);
126
+    }
121 127
 
122
-    foreach (array_slice (scandir ($from), 2) as $file)
123
-        if (is_dir ($f = $from .'/'. $file))
128
+    foreach (array_slice (scandir ($from), 2) as $file) {
129
+            if (is_dir ($f = $from .'/'. $file))
124 130
             dir_copy ($f, $to .'/'. $file);
131
+    }
125 132
 
126
-        else copy ($f, $to .'/'. $file);
133
+        else {
134
+            copy ($f, $to .'/'. $file);
135
+        }
127 136
 
128 137
     return true;
129 138
 }
@@ -180,8 +189,9 @@  discard block
 block discarded – undo
180 189
 
181 190
 function pre (...$args): void
182 191
 {
183
-	if (sizeof ($args) < 2)
184
-		$args = current ($args);
192
+	if (sizeof ($args) < 2) {
193
+			$args = current ($args);
194
+	}
185 195
 	
186 196
 	message (print_r ($args, true));
187 197
 }
@@ -244,11 +254,10 @@  discard block
 block discarded – undo
244 254
         {
245 255
             try
246 256
             {
247
-                if ($object->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms')))
248
-                    continue;
249
-            }
250
-
251
-            catch (\Exception $e) {}
257
+                if ($object->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms'))) {
258
+                                    continue;
259
+                }
260
+            } catch (\Exception $e) {}
252 261
             
253 262
             VoidEngine::destructObject ($selector);
254 263
 
@@ -256,8 +265,9 @@  discard block
 block discarded – undo
256 265
             {
257 266
                 unset (self::$components[$selector]);
258 267
 
259
-                if (isset (self::$events[$selector]))
260
-                    unset (self::$events[$selector]);
268
+                if (isset (self::$events[$selector])) {
269
+                                    unset (self::$events[$selector]);
270
+                }
261 271
             }
262 272
         }
263 273
     }
@@ -270,16 +280,15 @@  discard block
 block discarded – undo
270 280
 
271 281
 function c ($name, bool $returnAllSimilarObjects = false)
272 282
 {
273
-    if (is_int ($name) && is_object ($object = _c ($name)))
274
-        return $object;
275
-
276
-    else
283
+    if (is_int ($name) && is_object ($object = _c ($name))) {
284
+            return $object;
285
+    } else
277 286
     {
278 287
         $path    = explode ('->', $name);
279 288
         $similar = [];
280 289
 
281
-        foreach (Components::$components as $object)
282
-            try
290
+        foreach (Components::$components as $object) {
291
+                    try
283 292
             {
284 293
                 if ($object->name == end ($path))
285 294
                 {
@@ -292,32 +301,30 @@  discard block
 block discarded – undo
292 301
                                 {
293 302
                                     if ($returnAllSimilarObjects)
294 303
                                         $similar[] = $object;
304
+        }
295 305
 
296
-                                    else return $object;
306
+                                    else {
307
+                                        return $object;
308
+                                    }
309
+                                } else {
310
+                                    continue;
297 311
                                 }
298
-
299
-                                else continue;
312
+                            } else {
313
+                                continue;
300 314
                             }
301
-
302
-                            else continue;
303
-                        }
304
-
305
-                        catch (\Throwable $e)
315
+                        } catch (\Throwable $e)
306 316
                         {
307 317
                             continue;
308
-                        }
309
-
310
-                    else
318
+                        } else
311 319
                     {
312
-                        if ($returnAllSimilarObjects)
313
-                            $similar[] = $object;
314
-
315
-                        else return $object;
320
+                        if ($returnAllSimilarObjects) {
321
+                                                    $similar[] = $object;
322
+                        } else {
323
+                            return $object;
324
+                        }
316 325
                     }
317 326
                 }
318
-            }
319
-
320
-            catch (\Exception $e)
327
+            } catch (\Exception $e)
321 328
             {
322 329
                 continue;
323 330
             }
@@ -328,31 +335,32 @@  discard block
 block discarded – undo
328 335
 
329 336
             if (is_array ($objects))
330 337
             {
331
-                foreach ($objects as $id => $object)
332
-                    try
338
+                foreach ($objects as $id => $object) {
339
+                                    try
333 340
                     {
334 341
                         while (is_object ($parent = _c($object->parent->selector)))
335 342
                         {
336 343
                             if ($parent->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms')) && $parent->name == $path[0])
337 344
                                 return $objects[$id];
345
+                }
338 346
 
339
-                            else $object = $parent;
347
+                            else {
348
+                                $object = $parent;
349
+                            }
340 350
                         }
341
-                    }
342
-
343
-                    catch (\Throwable $e)
351
+                    } catch (\Throwable $e)
344 352
 					{
345 353
 						continue;
346 354
 					}
347 355
 
348 356
                 return false;
357
+            } else {
358
+                return false;
349 359
             }
350
-
351
-            else return false;
352
-        }
353
-
354
-        else return $returnAllSimilarObjects && sizeof ($similar) > 0 ?
360
+        } else {
361
+            return $returnAllSimilarObjects && sizeof ($similar) > 0 ?
355 362
             $similar : false;
363
+        }
356 364
     }
357 365
 }
358 366
 
@@ -410,8 +418,9 @@  discard block
 block discarded – undo
410 418
     {
411 419
         $collection = new WFObject ('System.Collections.Specialized.StringCollection');
412 420
 
413
-        foreach ($files as $file)
414
-            $collection->add ((string) $file);
421
+        foreach ($files as $file) {
422
+                    $collection->add ((string) $file);
423
+        }
415 424
 
416 425
         (new WFClass ('System.Windows.Forms.Clipboard'))->setFileDropList ($collection);
417 426
         VoidEngine::removeObjects ($collection->selector);
@@ -463,12 +472,14 @@  discard block
 block discarded – undo
463 472
 
464 473
 set_error_handler (function (...$args)
465 474
 {
466
-    if ($GLOBALS['error_status'])
467
-        pre ($args);
468
-});
475
+    if ($GLOBALS['error_status']) {
476
+            pre ($args);
477
+    }
478
+    });
469 479
 
470 480
 set_exception_handler (function (...$args)
471 481
 {
472
-    if ($GLOBALS['error_status'])
473
-        pre ($args);
474
-});
482
+    if ($GLOBALS['error_status']) {
483
+            pre ($args);
484
+    }
485
+    });
Please login to merge, or discard this patch.
engine/common/Events.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,42 +6,42 @@
 block discarded – undo
6 6
 {
7 7
     static $events = [];
8 8
 
9
-    static function setObjectEvent (int $object, string $eventName, $function)
9
+    static function setObjectEvent(int $object, string $eventName, $function)
10 10
     {
11
-        $eventName = strtolower ($eventName);
11
+        $eventName = strtolower($eventName);
12 12
         self::$events[$object][$eventName] = $function;
13 13
 
14
-        VoidEngine::setObjectEvent ($object, $eventName, "
14
+        VoidEngine::setObjectEvent($object, $eventName, "
15 15
             if (VoidEngine\Events::getObjectEvent ('$object', '$eventName') !== false)
16 16
                 VoidEngine\Events::getObjectEvent ('$object', '$eventName') (VoidEngine\_c('$object'),
17 17
                     isset (\$args) ? (is_int (\$args) && VoidEngine\VoidEngine::objectExists (\$args) && VoidEngine\VoidEngine::objectExists (\$argsSelector = VoidCore::getArrayValue (\$args, 1)) ?
18 18
                         new VoidEngine\WFObject (\$argsSelector) : \$args) : null);");
19 19
     }
20 20
 
21
-    static function reserveObjectEvent (int $object, string $eventName)
21
+    static function reserveObjectEvent(int $object, string $eventName)
22 22
     {
23
-        $eventName = strtolower ($eventName);
24
-        self::$events[$object][$eventName] = function ($self) {};
23
+        $eventName = strtolower($eventName);
24
+        self::$events[$object][$eventName] = function($self) {};
25 25
 
26
-        VoidEngine::setObjectEvent ($object, $eventName, '');
26
+        VoidEngine::setObjectEvent($object, $eventName, '');
27 27
     }
28 28
 
29
-    static function removeObjectEvent (int $object, string $eventName)
29
+    static function removeObjectEvent(int $object, string $eventName)
30 30
     {
31
-        $eventName = strtolower ($eventName);
32
-        VoidEngine::removeObjectEvent ($object, $eventName);
31
+        $eventName = strtolower($eventName);
32
+        VoidEngine::removeObjectEvent($object, $eventName);
33 33
 
34 34
         unset (self::$events[$object][$eventName]);
35 35
     }
36 36
 
37
-    static function getObjectEvent (int $object, string $eventName)
37
+    static function getObjectEvent(int $object, string $eventName)
38 38
     {
39
-        $eventName = strtolower ($eventName);
39
+        $eventName = strtolower($eventName);
40 40
         
41 41
         return self::$events[$object][$eventName] ?: false;
42 42
     }
43 43
 
44
-    static function getObjectEvents (int $object)
44
+    static function getObjectEvents(int $object)
45 45
     {
46 46
         return self::$events[$object] ?: false;
47 47
     }
Please login to merge, or discard this patch.
engine/common/Constants.php 3 patches
Indentation   +299 added lines, -299 removed lines patch added patch discarded remove patch
@@ -8,338 +8,338 @@
 block discarded – undo
8 8
 $converter = new WFClass ('System.Drawing.ColorTranslator');
9 9
 
10 10
 $constants = [
11
-	# Информация об окружении
11
+    # Информация об окружении
12 12
 	
13
-	'EXE_NAME'     => $APPLICATION->executablePath,
14
-	'DOC_ROOT'     => dirname ($APPLICATION->executablePath),
15
-	'IS_ADMIN'     => is_writable (getenv ('SystemRoot')),
16
-	'START_PARAMS' => $params,
17
-	'USERNAME'	   => $env->username,
13
+    'EXE_NAME'     => $APPLICATION->executablePath,
14
+    'DOC_ROOT'     => dirname ($APPLICATION->executablePath),
15
+    'IS_ADMIN'     => is_writable (getenv ('SystemRoot')),
16
+    'START_PARAMS' => $params,
17
+    'USERNAME'	   => $env->username,
18 18
 
19
-	# Константы MessageBox'а
19
+    # Константы MessageBox'а
20 20
 	
21
-	'MB_YESNO' 			  => 4,
22
-	'MB_YESNOCANCEL' 	  => 3,
23
-	'MB_OK' 			  => 0,
24
-	'MB_OKCANCEL' 		  => 1,
25
-	'MB_RETRYCANCEL' 	  => 5,
26
-	'MB_ABORTRETRYIGNORE' => 2,
27
-	'MBI_ASTERISK' 		  => 64,
28
-	'MBI_ERROR' 		  => 16,
29
-	'MBI_EXCLAMATION' 	  => 48,
30
-	'MBI_HAND' 			  => 16,
31
-	'MBI_INFORMATION' 	  => 64,
32
-	'MBI_NONE' 			  => 0,
33
-	'MBI_QUESTION' 		  => 32,
34
-	'MBI_STOP' 			  => 16,
35
-	'MBI_WARNING' 		  => 48,
36
-	'MBDB_1' 			  => 0,
37
-	'MBDB_2' 			  => 256,
38
-	'MBDB_3' 			  => 512,
21
+    'MB_YESNO' 			  => 4,
22
+    'MB_YESNOCANCEL' 	  => 3,
23
+    'MB_OK' 			  => 0,
24
+    'MB_OKCANCEL' 		  => 1,
25
+    'MB_RETRYCANCEL' 	  => 5,
26
+    'MB_ABORTRETRYIGNORE' => 2,
27
+    'MBI_ASTERISK' 		  => 64,
28
+    'MBI_ERROR' 		  => 16,
29
+    'MBI_EXCLAMATION' 	  => 48,
30
+    'MBI_HAND' 			  => 16,
31
+    'MBI_INFORMATION' 	  => 64,
32
+    'MBI_NONE' 			  => 0,
33
+    'MBI_QUESTION' 		  => 32,
34
+    'MBI_STOP' 			  => 16,
35
+    'MBI_WARNING' 		  => 48,
36
+    'MBDB_1' 			  => 0,
37
+    'MBDB_2' 			  => 256,
38
+    'MBDB_3' 			  => 512,
39 39
 	
40
-	# Константы DialogResult
40
+    # Константы DialogResult
41 41
 	
42
-	'drOk'	   => 1,
43
-	'drYes'    => 6,
44
-	'drNo' 	   => 7,
45
-	'drCancel' => 2,
46
-	'drRetry'  => 4,
47
-	'drAbort'  => 3,
48
-	'drIgnore' => 5,
49
-	'drNone'   => 0,
42
+    'drOk'	   => 1,
43
+    'drYes'    => 6,
44
+    'drNo' 	   => 7,
45
+    'drCancel' => 2,
46
+    'drRetry'  => 4,
47
+    'drAbort'  => 3,
48
+    'drIgnore' => 5,
49
+    'drNone'   => 0,
50 50
 	
51
-	# Константы форм
51
+    # Константы форм
52 52
 	
53
-	'fbsNone'			   => 0,
54
-	'fbsSingle'			   => 1,
55
-	'fbs3D'				   => 2,
56
-	'fbsDialog'			   => 3,
57
-	'fbsSizable'		   => 4,
58
-	'fbsToolWindow'		   => 5,
59
-	'fbsSizableToolWindow' => 6,
60
-
61
-	'fwsNormal'	   => 0,
62
-	'fwsMinimized' => 1,
63
-	'fwsMaximized' => 2,
64
-
65
-	'fspManual' 				=> 0,
66
-	'fspCenterScreen' 			=> 1,
67
-	'fspWindowsDefaultLocation' => 2,
68
-	'fspWindowsDefaultBounds'   => 3,
69
-	'fspCenterParent' 			=> 4,
70
-
71
-	# Константы стиля оконтовки
72
-
73
-	'bsNone' 		=> 0,
74
-	'bsFixedSingle' => 1,
75
-	'bsFixed3D' 	=> 2,
76
-
77
-	# Константы выравнивания
78
-
79
-	'alTopLeft' 	 => 1,
80
-	'alTopCenter' 	 => 2,
81
-	'alTopRight' 	 => 4,
82
-	'alMiddleLeft' 	 => 16,
83
-	'alMiddleCenter' => 32,
84
-	'alMiddleRight'  => 64,
85
-	'alBottomLeft' 	 => 256,
86
-	'alBottomCenter' => 512,
87
-	'alBottomRight'  => 1024,
88
-
89
-	# Константы притягивания (Anchor)
90
-
91
-	'acNone'   => 0,
92
-	'acTop'	   => 1,
93
-	'acBottom' => 2,
94
-	'acLeft'   => 4,
95
-	'acRight'  => 8,
96
-
97
-	# Константы SizeMode-параметра PictureBox'а
98
-
99
-	'smNormal' 		 => 0,
100
-	'smStretchImage' => 1,
101
-	'smAutoSize' 	 => 2,
102
-	'smCenterImage'  => 3,
103
-	'smZoom' 		 => 4,
104
-
105
-	# Константы View-параметра ListView'а
53
+    'fbsNone'			   => 0,
54
+    'fbsSingle'			   => 1,
55
+    'fbs3D'				   => 2,
56
+    'fbsDialog'			   => 3,
57
+    'fbsSizable'		   => 4,
58
+    'fbsToolWindow'		   => 5,
59
+    'fbsSizableToolWindow' => 6,
60
+
61
+    'fwsNormal'	   => 0,
62
+    'fwsMinimized' => 1,
63
+    'fwsMaximized' => 2,
64
+
65
+    'fspManual' 				=> 0,
66
+    'fspCenterScreen' 			=> 1,
67
+    'fspWindowsDefaultLocation' => 2,
68
+    'fspWindowsDefaultBounds'   => 3,
69
+    'fspCenterParent' 			=> 4,
70
+
71
+    # Константы стиля оконтовки
72
+
73
+    'bsNone' 		=> 0,
74
+    'bsFixedSingle' => 1,
75
+    'bsFixed3D' 	=> 2,
76
+
77
+    # Константы выравнивания
78
+
79
+    'alTopLeft' 	 => 1,
80
+    'alTopCenter' 	 => 2,
81
+    'alTopRight' 	 => 4,
82
+    'alMiddleLeft' 	 => 16,
83
+    'alMiddleCenter' => 32,
84
+    'alMiddleRight'  => 64,
85
+    'alBottomLeft' 	 => 256,
86
+    'alBottomCenter' => 512,
87
+    'alBottomRight'  => 1024,
88
+
89
+    # Константы притягивания (Anchor)
90
+
91
+    'acNone'   => 0,
92
+    'acTop'	   => 1,
93
+    'acBottom' => 2,
94
+    'acLeft'   => 4,
95
+    'acRight'  => 8,
96
+
97
+    # Константы SizeMode-параметра PictureBox'а
98
+
99
+    'smNormal' 		 => 0,
100
+    'smStretchImage' => 1,
101
+    'smAutoSize' 	 => 2,
102
+    'smCenterImage'  => 3,
103
+    'smZoom' 		 => 4,
104
+
105
+    # Константы View-параметра ListView'а
106 106
 	
107
-	'vwLargeIcon' => 0,
108
-	'vwDetails'	  => 1,
109
-	'vwSmallIcon' => 2,
110
-	'vwList' 	  => 3,
111
-	'vwTile' 	  => 4,
107
+    'vwLargeIcon' => 0,
108
+    'vwDetails'	  => 1,
109
+    'vwSmallIcon' => 2,
110
+    'vwList' 	  => 3,
111
+    'vwTile' 	  => 4,
112 112
 
113
-	# Константы dropDownStyle компонента ComboBox
113
+    # Константы dropDownStyle компонента ComboBox
114 114
 
115
-	'ddSimple'		 => 0,
116
-	'ddDropDown' 	 => 1,
117
-	'ddDropDownList' => 2,
115
+    'ddSimple'		 => 0,
116
+    'ddDropDown' 	 => 1,
117
+    'ddDropDownList' => 2,
118 118
 
119
-	# Константы причины закрытия формы
119
+    # Константы причины закрытия формы
120 120
 	
121
-	'fcrNone'                => 0,
122
-	'fcrWindowsShutDown'     => 1,
123
-	'fcrMdiFormClosing'      => 2,
124
-	'fcrUserClosing'         => 3,
125
-	'fcrTaskManagerClosing'  => 4,
126
-	'fcrFormOwnerClosing'    => 5,
127
-	'fcrApplicationExitCall' => 6,
121
+    'fcrNone'                => 0,
122
+    'fcrWindowsShutDown'     => 1,
123
+    'fcrMdiFormClosing'      => 2,
124
+    'fcrUserClosing'         => 3,
125
+    'fcrTaskManagerClosing'  => 4,
126
+    'fcrFormOwnerClosing'    => 5,
127
+    'fcrApplicationExitCall' => 6,
128 128
 	
129
-	# Константы дока
129
+    # Константы дока
130 130
 	
131
-	'dsBottom' => 2,
132
-	'dsFill'   => 5,
133
-	'dsLeft'   => 3,
134
-	'dsNone'   => 0,
135
-	'dsRight'  => 4,
136
-	'dsTop'    => 1,
131
+    'dsBottom' => 2,
132
+    'dsFill'   => 5,
133
+    'dsLeft'   => 3,
134
+    'dsNone'   => 0,
135
+    'dsRight'  => 4,
136
+    'dsTop'    => 1,
137 137
 	
138
-	# Константы FCTB.Language
138
+    # Константы FCTB.Language
139 139
 	
140
-	'langCSharp' => 1,
141
-	'langCustom' => 2,
142
-	'langHTML' 	 => 3,
143
-	'langJS' 	 => 4,
144
-	'langLua'	 => 5,
145
-	'langPHP' 	 => 6,
146
-	'langSQL' 	 => 7,
147
-	'langVB' 	 => 8,
148
-	'langXML' 	 => 9,
140
+    'langCSharp' => 1,
141
+    'langCustom' => 2,
142
+    'langHTML' 	 => 3,
143
+    'langJS' 	 => 4,
144
+    'langLua'	 => 5,
145
+    'langPHP' 	 => 6,
146
+    'langSQL' 	 => 7,
147
+    'langVB' 	 => 8,
148
+    'langXML' 	 => 9,
149 149
 	
150
-	# Константы видимости окна процесса
150
+    # Константы видимости окна процесса
151 151
 	
152
-	'pwsHidden'    => 0,
153
-	'pwsMaximized' => 3,
154
-	'pwsMinimized' => 2,
155
-	'pwsNormal'    => 1,
152
+    'pwsHidden'    => 0,
153
+    'pwsMaximized' => 3,
154
+    'pwsMinimized' => 2,
155
+    'pwsNormal'    => 1,
156 156
 	
157
-	# Константы запуска
157
+    # Константы запуска
158 158
 	
159
-	'runNo'     => 0,
160
-	'runYes'    => 1,
161
-	'runThread' => 2,
159
+    'runNo'     => 0,
160
+    'runYes'    => 1,
161
+    'runThread' => 2,
162 162
 
163
-	# Константы стиля ProgressBar'а
163
+    # Константы стиля ProgressBar'а
164 164
 
165
-	'pbBlocks'	   => 0,
166
-	'pbContinuous' => 1,
167
-	'pbMarquee'    => 2,
165
+    'pbBlocks'	   => 0,
166
+    'pbContinuous' => 1,
167
+    'pbMarquee'    => 2,
168 168
 
169
-	# Константы свойства FlatStyle
169
+    # Константы свойства FlatStyle
170 170
 	
171
-	'flFlat'	 => 0,
172
-	'flPopup'	 => 1,
173
-	'flStandard' => 2,
174
-	'flSystem'   => 3,
171
+    'flFlat'	 => 0,
172
+    'flPopup'	 => 1,
173
+    'flStandard' => 2,
174
+    'flSystem'   => 3,
175 175
 
176
-	# Константы свойства DrawMode
176
+    # Константы свойства DrawMode
177 177
 
178
-	'dwNormal'			  => 0,
179
-	'dwOwnerDrawFixed'	  => 1,
180
-	'dwOwnerDrawVariable' => 2,
178
+    'dwNormal'			  => 0,
179
+    'dwOwnerDrawFixed'	  => 1,
180
+    'dwOwnerDrawVariable' => 2,
181 181
 
182
-	# Константы свойства SizeMode PictureBox'а
182
+    # Константы свойства SizeMode PictureBox'а
183 183
 
184
-	'smNormal' 		 => 0,
185
-	'smStretchImage' => 1,
186
-	'smAutoSize'	 => 2,
187
-	'smCenterImage'  => 3,
188
-	'smZoom'		 => 4,
184
+    'smNormal' 		 => 0,
185
+    'smStretchImage' => 1,
186
+    'smAutoSize'	 => 2,
187
+    'smCenterImage'  => 3,
188
+    'smZoom'		 => 4,
189 189
 
190
-	# Цветовые константы
190
+    # Цветовые константы
191 191
 	
192
-	'clAliceBlue'			 => 0xFFF0F8FF,
193
-	'clAntiqueWhite'		 => 0xFFFAEBD7,
194
-	'clAqua'				 => 0xFF00FFFF,
195
-	'clAquamarine'			 => 0xFF7FFFD4,
196
-	'clAzure'				 => 0xFFF0FFFF,
197
-	'clBeige'				 => 0xFFF5F5DC,
198
-	'clBisque'				 => 0xFFFFE4C4,
199
-	'clBlack'				 => 0xFF000000,
200
-	'clBlanchedAlmond'		 => 0xFFFFEBCD,
201
-	'clBlue'				 => 0xFF0000FF,
202
-	'clBlueViolet'			 => 0xFF8A2BE2,
203
-	'clBrown'				 => 0xFFA52A2A,
204
-	'clBurlyWood'			 => 0xFFDEB887,
205
-	'clCadetBlue' 			 => 0xFF5F9EA0,
206
-	'clChartreuse'			 => 0xFF7FFF00,
207
-	'clChocolate'			 => 0xFFD2691E,
208
-	'clCoral'				 => 0xFFFF7F50,
209
-	'clCornflowerBlue'		 => 0xFF6495ED,
210
-	'clCornsilk'			 => 0xFFFFF8DC,
211
-	'clCrimson'				 => 0xFFDC143C,
212
-	'clCyan'				 => 0xFF00FFFF,
213
-	'clDarkBlue'			 => 0xFF00008B,
214
-	'clDarkCyan'			 => 0xFF008B8B,
215
-	'clDarkGoldenrod'		 => 0xFFB8860B,
216
-	'clDarkGray'			 => 0xFFA9A9A9,
217
-	'clDarkGreen'			 => 0xFF006400,
218
-	'clDarkKhaki'			 => 0xFFBDB76B,
219
-	'clDarkMagenta'			 => 0xFF8B008B,
220
-	'clDarkOliveGreen'		 => 0xFF556B2F,
221
-	'clDarkOrange'			 => 0xFFFF8C00,
222
-	'clDarkOrchid'			 => 0xFF9932CC,
223
-	'clDarkRed'				 => 0xFF8B0000,
224
-	'clDarkSalmon'			 => 0xFFE9967A,
225
-	'clDarkSeaGreen'		 => 0xFF8FBC8F,
226
-	'clDarkSlateBlue'		 => 0xFF483D8B,
227
-	'clDarkSlateGray'		 => 0xFF2F4F4F,
228
-	'clDarkTurquoise'		 => 0xFF00CED1,
229
-	'clDarkViolet'			 => 0xFF9400D3,
230
-	'clDeepPink'			 => 0xFFFF1493,
231
-	'clDeepSkyBlue'			 => 0xFF00BFFF,
232
-	'clDimGray'				 => 0xFF696969,
233
-	'clDodgerBlue'			 => 0xFF1E90FF,
234
-	'clFirebrick'			 => 0xFFB22222,
235
-	'clFloralWhite'			 => 0xFFFFFAF0,
236
-	'clForestGreen'			 => 0xFF228B22,
237
-	'clFuchsia'				 => 0xFFFF00FF,
238
-	'clGainsboro'			 => 0xFFDCDCDC,
239
-	'clGhostWhite'			 => 0xFFF8F8FF,
240
-	'clGold'				 => 0xFFFFD700,
241
-	'clGoldenrod'			 => 0xFFDAA520,
242
-	'clGray'				 => 0xFF808080,
243
-	'clGreen'				 => 0xFF008000,
244
-	'clGreenYellow'			 => 0xFFADFF2F,
245
-	'clHoneydew'			 => 0xFFF0FFF0,
246
-	'clHotPink'				 => 0xFFFF69B4,
247
-	'clIndianRed'			 => 0xFFCD5C5C,
248
-	'clIndigo'				 => 0xFF4B0082,
249
-	'clIvory'				 => 0xFFFFFFF0,
250
-	'clKhaki'				 => 0xFFF0E68C,
251
-	'clLavender'			 => 0xFFE6E6FA,
252
-	'clLavenderBlush'		 => 0xFFFFF0F5,
253
-	'clLawnGreen'			 => 0xFF7CFC00,
254
-	'clLemonChiffon'		 => 0xFFFFFACD,
255
-	'clLightBlue'			 => 0xFFADD8E6,
256
-	'clLightCoral'			 => 0xFFF08080,
257
-	'clLightCyan'			 => 0xFFE0FFFF,
258
-	'clLightGoldenrodYellow' => 0xFFFAFAD2,
259
-	'clLightGray' 			 => 0xFFD3D3D3,
260
-	'clLightGreen'			 => 0xFF90EE90,
261
-	'clLightPink' 			 => 0xFFFFB6C1,
262
-	'clLightSalmon'			 => 0xFFFFA07A,
263
-	'clLightSeaGreen'		 => 0xFF20B2AA,
264
-	'clLightSkyBlue'		 => 0xFF87CEFA,
265
-	'clLightSlateGray'		 => 0xFF778899,
266
-	'clLightSteelBlue'		 => 0xFFB0C4DE,
267
-	'clLightYellow'			 => 0xFFFFFFE0,
268
-	'clLime'				 => 0xFF00FF00,
269
-	'clLimeGreen'			 => 0xFF32CD32,
270
-	'clLinen'				 => 0xFFFAF0E6,
271
-	'clMagenta'				 => 0xFFFF00FF,
272
-	'clMaroon'				 => 0xFF800000,
273
-	'clMediumAquamarine'	 => 0xFF66CDAA,
274
-	'clMediumBlue' 			 => 0xFF0000CD,
275
-	'clMediumOrchid'		 => 0xFFBA55D3,
276
-	'clMediumPurple'		 => 0xFF9370DB,
277
-	'clMediumSeaGreen'		 => 0xFF3CB371,
278
-	'clMediumSlateBlue'		 => 0xFF7B68EE,
279
-	'clMediumSpringGreen'	 => 0xFF00FA9A,
280
-	'clMediumTurquoise'		 => 0xFF48D1CC,
281
-	'clMediumVioletRed'		 => 0xFFC71585,
282
-	'clMidnightBlue'		 => 0xFF191970,
283
-	'clMintCream'			 => 0xFFF5FFFA,
284
-	'clMistyRose'			 => 0xFFFFE4E1,
285
-	'clMoccasin'			 => 0xFFFFE4B5,
286
-	'clNavajoWhite'			 => 0xFFFFDEAD,
287
-	'clNavy'				 => 0xFF000080,
288
-	'clOldLace'				 => 0xFFFDF5E6,
289
-	'clOlive'				 => 0xFF808000,
290
-	'clOliveDrab'			 => 0xFF6B8E23,
291
-	'clOrange'				 => 0xFFFFA500,
292
-	'clOrangeRed'			 => 0xFFFF4500,
293
-	'clOrchid'				 => 0xFFDA70D6,
294
-	'clPaleGoldenrod'		 => 0xFFEEE8AA,
295
-	'clPaleGreen'			 => 0xFF98FB98,
296
-	'clPaleTurquoise'		 => 0xFFAFEEEE,
297
-	'clPaleVioletRed'		 => 0xFFDB7093,
298
-	'clPapayaWhip'			 => 0xFFFFEFD5,
299
-	'clPeachPuff'			 => 0xFFFFDAB9,
300
-	'clPeru'				 => 0xFFCD853F,
301
-	'clPink'				 => 0xFFFFC0CB,
302
-	'clPlum'				 => 0xFFDDA0DD,
303
-	'clPowderBlue'			 => 0xFFB0E0E6,
304
-	'clPurple'				 => 0xFF800080,
305
-	'clRed'					 => 0xFFFF0000,
306
-	'clRosyBrown'			 => 0xFFBC8F8F,
307
-	'clRoyalBlue'			 => 0xFF4169E1,
308
-	'clSaddleBrown'			 => 0xFF8B4513,
309
-	'clSalmon'				 => 0xFFFA8072,
310
-	'clSandyBrown'			 => 0xFFF4A460,
311
-	'clSeaGreen'			 => 0xFF2E8B57,
312
-	'clSeaShell'			 => 0xFFFFF5EE,
313
-	'clSienna'				 => 0xFFA0522D,
314
-	'clSilver'				 => 0xFFC0C0C0,
315
-	'clSkyBlue'				 => 0xFF87CEEB,
316
-	'clSlateBlue'			 => 0xFF6A5ACD,
317
-	'clSlateGray'			 => 0xFF708090,
318
-	'clSnow'				 => 0xFFFFFAFA,
319
-	'clSpringGreen'			 => 0xFF00FF7F,
320
-	'clSteelBlue'			 => 0xFF4682B4,
321
-	'clTan'					 => 0xFFD2B48C,
322
-	'clTeal'				 => 0xFF008080,
323
-	'clThistle'				 => 0xFFD8BFD8,
324
-	'clTomato'				 => 0xFFFF6347,
325
-	'clTurquoise'			 => 0xFF40E0D0,
326
-	'clViolet'				 => 0xFFEE82EE,
327
-	'clWheat'				 => 0xFFF5DEB3,
328
-	'clWhite'				 => 0xFFFFFFFF,
329
-	'clWhiteSmoke'			 => 0xFFF5F5F5,
330
-	'clYellow'				 => 0xFFFFFF00,
331
-	'clYellowGreen'			 => 0xFF9ACD32,
332
-
333
-	# Моя подборка цветов
334
-
335
-	'clDark'	  => $converter->fromHtml ('#0D0F12'),
336
-	'clDark2'	  => $converter->fromHtml ('#121416'),
337
-	'clTurquoise' => $converter->fromHtml ('#00ADB5'),
338
-	'clLight'  	  => $converter->fromHtml ('#EEEEEE')
192
+    'clAliceBlue'			 => 0xFFF0F8FF,
193
+    'clAntiqueWhite'		 => 0xFFFAEBD7,
194
+    'clAqua'				 => 0xFF00FFFF,
195
+    'clAquamarine'			 => 0xFF7FFFD4,
196
+    'clAzure'				 => 0xFFF0FFFF,
197
+    'clBeige'				 => 0xFFF5F5DC,
198
+    'clBisque'				 => 0xFFFFE4C4,
199
+    'clBlack'				 => 0xFF000000,
200
+    'clBlanchedAlmond'		 => 0xFFFFEBCD,
201
+    'clBlue'				 => 0xFF0000FF,
202
+    'clBlueViolet'			 => 0xFF8A2BE2,
203
+    'clBrown'				 => 0xFFA52A2A,
204
+    'clBurlyWood'			 => 0xFFDEB887,
205
+    'clCadetBlue' 			 => 0xFF5F9EA0,
206
+    'clChartreuse'			 => 0xFF7FFF00,
207
+    'clChocolate'			 => 0xFFD2691E,
208
+    'clCoral'				 => 0xFFFF7F50,
209
+    'clCornflowerBlue'		 => 0xFF6495ED,
210
+    'clCornsilk'			 => 0xFFFFF8DC,
211
+    'clCrimson'				 => 0xFFDC143C,
212
+    'clCyan'				 => 0xFF00FFFF,
213
+    'clDarkBlue'			 => 0xFF00008B,
214
+    'clDarkCyan'			 => 0xFF008B8B,
215
+    'clDarkGoldenrod'		 => 0xFFB8860B,
216
+    'clDarkGray'			 => 0xFFA9A9A9,
217
+    'clDarkGreen'			 => 0xFF006400,
218
+    'clDarkKhaki'			 => 0xFFBDB76B,
219
+    'clDarkMagenta'			 => 0xFF8B008B,
220
+    'clDarkOliveGreen'		 => 0xFF556B2F,
221
+    'clDarkOrange'			 => 0xFFFF8C00,
222
+    'clDarkOrchid'			 => 0xFF9932CC,
223
+    'clDarkRed'				 => 0xFF8B0000,
224
+    'clDarkSalmon'			 => 0xFFE9967A,
225
+    'clDarkSeaGreen'		 => 0xFF8FBC8F,
226
+    'clDarkSlateBlue'		 => 0xFF483D8B,
227
+    'clDarkSlateGray'		 => 0xFF2F4F4F,
228
+    'clDarkTurquoise'		 => 0xFF00CED1,
229
+    'clDarkViolet'			 => 0xFF9400D3,
230
+    'clDeepPink'			 => 0xFFFF1493,
231
+    'clDeepSkyBlue'			 => 0xFF00BFFF,
232
+    'clDimGray'				 => 0xFF696969,
233
+    'clDodgerBlue'			 => 0xFF1E90FF,
234
+    'clFirebrick'			 => 0xFFB22222,
235
+    'clFloralWhite'			 => 0xFFFFFAF0,
236
+    'clForestGreen'			 => 0xFF228B22,
237
+    'clFuchsia'				 => 0xFFFF00FF,
238
+    'clGainsboro'			 => 0xFFDCDCDC,
239
+    'clGhostWhite'			 => 0xFFF8F8FF,
240
+    'clGold'				 => 0xFFFFD700,
241
+    'clGoldenrod'			 => 0xFFDAA520,
242
+    'clGray'				 => 0xFF808080,
243
+    'clGreen'				 => 0xFF008000,
244
+    'clGreenYellow'			 => 0xFFADFF2F,
245
+    'clHoneydew'			 => 0xFFF0FFF0,
246
+    'clHotPink'				 => 0xFFFF69B4,
247
+    'clIndianRed'			 => 0xFFCD5C5C,
248
+    'clIndigo'				 => 0xFF4B0082,
249
+    'clIvory'				 => 0xFFFFFFF0,
250
+    'clKhaki'				 => 0xFFF0E68C,
251
+    'clLavender'			 => 0xFFE6E6FA,
252
+    'clLavenderBlush'		 => 0xFFFFF0F5,
253
+    'clLawnGreen'			 => 0xFF7CFC00,
254
+    'clLemonChiffon'		 => 0xFFFFFACD,
255
+    'clLightBlue'			 => 0xFFADD8E6,
256
+    'clLightCoral'			 => 0xFFF08080,
257
+    'clLightCyan'			 => 0xFFE0FFFF,
258
+    'clLightGoldenrodYellow' => 0xFFFAFAD2,
259
+    'clLightGray' 			 => 0xFFD3D3D3,
260
+    'clLightGreen'			 => 0xFF90EE90,
261
+    'clLightPink' 			 => 0xFFFFB6C1,
262
+    'clLightSalmon'			 => 0xFFFFA07A,
263
+    'clLightSeaGreen'		 => 0xFF20B2AA,
264
+    'clLightSkyBlue'		 => 0xFF87CEFA,
265
+    'clLightSlateGray'		 => 0xFF778899,
266
+    'clLightSteelBlue'		 => 0xFFB0C4DE,
267
+    'clLightYellow'			 => 0xFFFFFFE0,
268
+    'clLime'				 => 0xFF00FF00,
269
+    'clLimeGreen'			 => 0xFF32CD32,
270
+    'clLinen'				 => 0xFFFAF0E6,
271
+    'clMagenta'				 => 0xFFFF00FF,
272
+    'clMaroon'				 => 0xFF800000,
273
+    'clMediumAquamarine'	 => 0xFF66CDAA,
274
+    'clMediumBlue' 			 => 0xFF0000CD,
275
+    'clMediumOrchid'		 => 0xFFBA55D3,
276
+    'clMediumPurple'		 => 0xFF9370DB,
277
+    'clMediumSeaGreen'		 => 0xFF3CB371,
278
+    'clMediumSlateBlue'		 => 0xFF7B68EE,
279
+    'clMediumSpringGreen'	 => 0xFF00FA9A,
280
+    'clMediumTurquoise'		 => 0xFF48D1CC,
281
+    'clMediumVioletRed'		 => 0xFFC71585,
282
+    'clMidnightBlue'		 => 0xFF191970,
283
+    'clMintCream'			 => 0xFFF5FFFA,
284
+    'clMistyRose'			 => 0xFFFFE4E1,
285
+    'clMoccasin'			 => 0xFFFFE4B5,
286
+    'clNavajoWhite'			 => 0xFFFFDEAD,
287
+    'clNavy'				 => 0xFF000080,
288
+    'clOldLace'				 => 0xFFFDF5E6,
289
+    'clOlive'				 => 0xFF808000,
290
+    'clOliveDrab'			 => 0xFF6B8E23,
291
+    'clOrange'				 => 0xFFFFA500,
292
+    'clOrangeRed'			 => 0xFFFF4500,
293
+    'clOrchid'				 => 0xFFDA70D6,
294
+    'clPaleGoldenrod'		 => 0xFFEEE8AA,
295
+    'clPaleGreen'			 => 0xFF98FB98,
296
+    'clPaleTurquoise'		 => 0xFFAFEEEE,
297
+    'clPaleVioletRed'		 => 0xFFDB7093,
298
+    'clPapayaWhip'			 => 0xFFFFEFD5,
299
+    'clPeachPuff'			 => 0xFFFFDAB9,
300
+    'clPeru'				 => 0xFFCD853F,
301
+    'clPink'				 => 0xFFFFC0CB,
302
+    'clPlum'				 => 0xFFDDA0DD,
303
+    'clPowderBlue'			 => 0xFFB0E0E6,
304
+    'clPurple'				 => 0xFF800080,
305
+    'clRed'					 => 0xFFFF0000,
306
+    'clRosyBrown'			 => 0xFFBC8F8F,
307
+    'clRoyalBlue'			 => 0xFF4169E1,
308
+    'clSaddleBrown'			 => 0xFF8B4513,
309
+    'clSalmon'				 => 0xFFFA8072,
310
+    'clSandyBrown'			 => 0xFFF4A460,
311
+    'clSeaGreen'			 => 0xFF2E8B57,
312
+    'clSeaShell'			 => 0xFFFFF5EE,
313
+    'clSienna'				 => 0xFFA0522D,
314
+    'clSilver'				 => 0xFFC0C0C0,
315
+    'clSkyBlue'				 => 0xFF87CEEB,
316
+    'clSlateBlue'			 => 0xFF6A5ACD,
317
+    'clSlateGray'			 => 0xFF708090,
318
+    'clSnow'				 => 0xFFFFFAFA,
319
+    'clSpringGreen'			 => 0xFF00FF7F,
320
+    'clSteelBlue'			 => 0xFF4682B4,
321
+    'clTan'					 => 0xFFD2B48C,
322
+    'clTeal'				 => 0xFF008080,
323
+    'clThistle'				 => 0xFFD8BFD8,
324
+    'clTomato'				 => 0xFFFF6347,
325
+    'clTurquoise'			 => 0xFF40E0D0,
326
+    'clViolet'				 => 0xFFEE82EE,
327
+    'clWheat'				 => 0xFFF5DEB3,
328
+    'clWhite'				 => 0xFFFFFFFF,
329
+    'clWhiteSmoke'			 => 0xFFF5F5F5,
330
+    'clYellow'				 => 0xFFFFFF00,
331
+    'clYellowGreen'			 => 0xFF9ACD32,
332
+
333
+    # Моя подборка цветов
334
+
335
+    'clDark'	  => $converter->fromHtml ('#0D0F12'),
336
+    'clDark2'	  => $converter->fromHtml ('#121416'),
337
+    'clTurquoise' => $converter->fromHtml ('#00ADB5'),
338
+    'clLight'  	  => $converter->fromHtml ('#EEEEEE')
339 339
 ];
340 340
 
341 341
 foreach ($constants as $name => $value)
342
-	define ($name, $value);
342
+    define ($name, $value);
343 343
 
344 344
 $argv = START_PARAMS;
345 345
 $argc = sizeof ($argv);
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -2,17 +2,17 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace VoidEngine;
4 4
 
5
-$env 	= new WFClass ('System.Environment', 'mscorlib');
6
-$params = $env->getCommandLineArgs ()->list;
5
+$env = new WFClass('System.Environment', 'mscorlib');
6
+$params = $env->getCommandLineArgs()->list;
7 7
 
8
-$converter = new WFClass ('System.Drawing.ColorTranslator');
8
+$converter = new WFClass('System.Drawing.ColorTranslator');
9 9
 
10 10
 $constants = [
11 11
 	# Информация об окружении
12 12
 	
13 13
 	'EXE_NAME'     => $APPLICATION->executablePath,
14
-	'DOC_ROOT'     => dirname ($APPLICATION->executablePath),
15
-	'IS_ADMIN'     => is_writable (getenv ('SystemRoot')),
14
+	'DOC_ROOT'     => dirname($APPLICATION->executablePath),
15
+	'IS_ADMIN'     => is_writable(getenv('SystemRoot')),
16 16
 	'START_PARAMS' => $params,
17 17
 	'USERNAME'	   => $env->username,
18 18
 
@@ -332,17 +332,17 @@  discard block
 block discarded – undo
332 332
 
333 333
 	# Моя подборка цветов
334 334
 
335
-	'clDark'	  => $converter->fromHtml ('#0D0F12'),
336
-	'clDark2'	  => $converter->fromHtml ('#121416'),
337
-	'clTurquoise' => $converter->fromHtml ('#00ADB5'),
338
-	'clLight'  	  => $converter->fromHtml ('#EEEEEE')
335
+	'clDark'	  => $converter->fromHtml('#0D0F12'),
336
+	'clDark2'	  => $converter->fromHtml('#121416'),
337
+	'clTurquoise' => $converter->fromHtml('#00ADB5'),
338
+	'clLight'  	  => $converter->fromHtml('#EEEEEE')
339 339
 ];
340 340
 
341 341
 foreach ($constants as $name => $value)
342
-	define ($name, $value);
342
+	define($name, $value);
343 343
 
344 344
 $argv = START_PARAMS;
345
-$argc = sizeof ($argv);
345
+$argc = sizeof($argv);
346 346
 
347
-VoidEngine::removeObjects ($converter->selector);
347
+VoidEngine::removeObjects($converter->selector);
348 348
 unset ($constants, $env, $params, $converter);
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -338,8 +338,9 @@
 block discarded – undo
338 338
 	'clLight'  	  => $converter->fromHtml ('#EEEEEE')
339 339
 ];
340 340
 
341
-foreach ($constants as $name => $value)
341
+foreach ($constants as $name => $value) {
342 342
 	define ($name, $value);
343
+}
343 344
 
344 345
 $argv = START_PARAMS;
345 346
 $argc = sizeof ($argv);
Please login to merge, or discard this patch.
engine/components/Scintilla.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
12 12
     protected $styles;
13 13
 
14 14
     public function __construct (Component $parent = null)
15
-	{
15
+    {
16 16
         parent::__construct ($parent, $this->class);
17 17
 
18 18
         $this->styles = $this->getProperty ('Styles');
19
-	}
19
+    }
20 20
 
21 21
     public function resetSyntax ()
22 22
     {
Please login to merge, or discard this patch.
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 namespace VoidEngine;
4 4
 
5
-EngineAdditions::loadModule ('ScintillaNET.dll');
5
+EngineAdditions::loadModule('ScintillaNET.dll');
6 6
 
7 7
 class Scintilla extends NoVisual
8 8
 {
@@ -11,71 +11,71 @@  discard block
 block discarded – undo
11 11
 
12 12
     protected $styles;
13 13
 
14
-    public function __construct (Component $parent = null)
14
+    public function __construct(Component $parent = null)
15 15
 	{
16
-        parent::__construct ($parent, $this->class);
16
+        parent::__construct($parent, $this->class);
17 17
 
18
-        $this->styles = $this->getProperty ('Styles');
18
+        $this->styles = $this->getProperty('Styles');
19 19
 	}
20 20
 
21
-    public function resetSyntax ()
21
+    public function resetSyntax()
22 22
     {
23
-        $this->callMethod ('StyleResetDefault');
23
+        $this->callMethod('StyleResetDefault');
24 24
     }
25 25
 
26
-    public function clearSyntax ()
26
+    public function clearSyntax()
27 27
     {
28
-        $this->callMethod ('StyleClearAll');
28
+        $this->callMethod('StyleClearAll');
29 29
     }
30 30
 
31
-    public function setKeywords (int $index, string $keywords)
31
+    public function setKeywords(int $index, string $keywords)
32 32
     {
33
-        $this->callMethod ('SetKeywords', [$index, 'int'], [$keywords, 'string']);
33
+        $this->callMethod('SetKeywords', [$index, 'int'], [$keywords, 'string']);
34 34
     }
35 35
 
36
-    public function propertyInit (string $propertyName, $propertyValue)
36
+    public function propertyInit(string $propertyName, $propertyValue)
37 37
     {
38
-        $this->callMethod ('SetProperty', [$propertyName, 'string'], [$propertyValue, 'string']);
38
+        $this->callMethod('SetProperty', [$propertyName, 'string'], [$propertyValue, 'string']);
39 39
     }
40 40
 
41
-    public function set_syntax ($syntax)
41
+    public function set_syntax($syntax)
42 42
     {
43
-        if (file_exists ($syntax))
44
-            $syntax = file_get_contents ($syntax);
43
+        if (file_exists($syntax))
44
+            $syntax = file_get_contents($syntax);
45 45
 
46
-        $syntax = json_decode ($syntax, true);
46
+        $syntax = json_decode($syntax, true);
47 47
 
48 48
         if (
49
-            !is_array ($syntax['syntax']) ||
50
-            !is_array ($syntax['references']) ||
49
+            !is_array($syntax['syntax']) ||
50
+            !is_array($syntax['references']) ||
51 51
             !isset ($syntax['lexer'])
52 52
         ) return false;
53 53
 
54 54
         else
55 55
         {
56
-            $this->resetSyntax ();
57
-            $this->clearSyntax ();
56
+            $this->resetSyntax();
57
+            $this->clearSyntax();
58 58
             
59 59
             foreach ($syntax['references'] as $name => $value)
60 60
                 if (isset ($syntax['syntax'][$name]))
61 61
                 {
62
-                    $element = VoidEngine::getArrayValue ($this->styles, $value);
62
+                    $element = VoidEngine::getArrayValue($this->styles, $value);
63 63
                     $color   = $syntax['syntax'][$name];
64 64
 
65
-                    if (defined ($color))
66
-                        $color = constant ($color);
65
+                    if (defined($color))
66
+                        $color = constant($color);
67 67
                     
68
-                    VoidEngine::setProperty ($element, 'ForeColor', [$color, 'color']);
68
+                    VoidEngine::setProperty($element, 'ForeColor', [$color, 'color']);
69 69
                 }
70 70
 
71 71
             $this->lexer = $syntax['lexer'];
72 72
 
73
-            if (is_array ($syntax['keywords']))
73
+            if (is_array($syntax['keywords']))
74 74
                 foreach ($syntax['keywords'] as $id => $keywords)
75
-                    $this->setKeywords ($id, $keywords);
75
+                    $this->setKeywords($id, $keywords);
76 76
 
77
-            $this->propertyInit ('fold', 1);
78
-            $this->propertyInit ('fold.compact', 1);
77
+            $this->propertyInit('fold', 1);
78
+            $this->propertyInit('fold.compact', 1);
79 79
 
80 80
             return true;
81 81
         }
Please login to merge, or discard this patch.
Braces   +15 added lines, -11 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@  discard block
 block discarded – undo
40 40
 
41 41
     public function set_syntax ($syntax)
42 42
     {
43
-        if (file_exists ($syntax))
44
-            $syntax = file_get_contents ($syntax);
43
+        if (file_exists ($syntax)) {
44
+                    $syntax = file_get_contents ($syntax);
45
+        }
45 46
 
46 47
         $syntax = json_decode ($syntax, true);
47 48
 
@@ -49,30 +50,33 @@  discard block
 block discarded – undo
49 50
             !is_array ($syntax['syntax']) ||
50 51
             !is_array ($syntax['references']) ||
51 52
             !isset ($syntax['lexer'])
52
-        ) return false;
53
-
54
-        else
53
+        ) {
54
+            return false;
55
+        } else
55 56
         {
56 57
             $this->resetSyntax ();
57 58
             $this->clearSyntax ();
58 59
             
59
-            foreach ($syntax['references'] as $name => $value)
60
-                if (isset ($syntax['syntax'][$name]))
60
+            foreach ($syntax['references'] as $name => $value) {
61
+                            if (isset ($syntax['syntax'][$name]))
61 62
                 {
62 63
                     $element = VoidEngine::getArrayValue ($this->styles, $value);
64
+            }
63 65
                     $color   = $syntax['syntax'][$name];
64 66
 
65
-                    if (defined ($color))
66
-                        $color = constant ($color);
67
+                    if (defined ($color)) {
68
+                                            $color = constant ($color);
69
+                    }
67 70
                     
68 71
                     VoidEngine::setProperty ($element, 'ForeColor', [$color, 'color']);
69 72
                 }
70 73
 
71 74
             $this->lexer = $syntax['lexer'];
72 75
 
73
-            if (is_array ($syntax['keywords']))
74
-                foreach ($syntax['keywords'] as $id => $keywords)
76
+            if (is_array ($syntax['keywords'])) {
77
+                            foreach ($syntax['keywords'] as $id => $keywords)
75 78
                     $this->setKeywords ($id, $keywords);
79
+            }
76 80
 
77 81
             $this->propertyInit ('fold', 1);
78 82
             $this->propertyInit ('fold.compact', 1);
Please login to merge, or discard this patch.
engine/components/ProgressBar.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -6,33 +6,33 @@
 block discarded – undo
6 6
 {
7 7
     public $class = 'System.Windows.Forms.ProgressBar';
8 8
 
9
-    public function get_max ()
9
+    public function get_max()
10 10
     {
11
-        return $this->getProperty ('Maximum');
11
+        return $this->getProperty('Maximum');
12 12
     }
13 13
 
14
-    public function set_max (int $max)
14
+    public function set_max(int $max)
15 15
     {
16
-        $this->setProperty ('Maximum', $max);
16
+        $this->setProperty('Maximum', $max);
17 17
     }
18 18
 
19
-    public function get_min ()
19
+    public function get_min()
20 20
     {
21
-        return $this->getProperty ('Minimum');
21
+        return $this->getProperty('Minimum');
22 22
     }
23 23
 
24
-    public function set_min (int $min)
24
+    public function set_min(int $min)
25 25
     {
26
-        $this->setProperty ('Minimum', $min);
26
+        $this->setProperty('Minimum', $min);
27 27
     }
28 28
 
29
-    public function get_position ()
29
+    public function get_position()
30 30
     {
31
-        return $this->getProperty ('Value');
31
+        return $this->getProperty('Value');
32 32
     }
33 33
 
34
-    public function set_position (int $position)
34
+    public function set_position(int $position)
35 35
     {
36
-        $this->setProperty ('Value', $position);
36
+        $this->setProperty('Value', $position);
37 37
     }
38 38
 }
Please login to merge, or discard this patch.
engine/components/CommonDialog.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@
 block discarded – undo
6 6
 {
7 7
     public $class = 'System.Windows.Forms.CommonDialog';
8 8
 
9
-    public function execute (): int
9
+    public function execute(): int
10 10
     {
11
-        return $this->callMethod ('ShowDialog');
11
+        return $this->callMethod('ShowDialog');
12 12
     }
13 13
 }
Please login to merge, or discard this patch.
engine/components/Component.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     }
50 50
 
51 51
     public function dispose (): void
52
-	{
52
+    {
53 53
         foreach (array_diff (get_object_vars ($this), ['selector']) as $param => $value)
54 54
         {
55 55
             if (is_int ($value))
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -9,80 +9,80 @@
 block discarded – undo
9 9
     public $class     = 'System.Windows.Forms.Component';
10 10
     public $namespace = 'System.Windows.Forms';
11 11
 
12
-    public function __construct ($className = null, ...$args)
12
+    public function __construct($className = null, ...$args)
13 13
     {
14
-        parent::__construct (
14
+        parent::__construct(
15 15
             $className === null ? $this->class : $className,
16 16
             $this->namespace, ...$args
17 17
         );
18 18
         
19
-        Components::addComponent ($this->selector, $this);
19
+        Components::addComponent($this->selector, $this);
20 20
     }
21 21
 	
22
-    public function __debugInfo (): array
22
+    public function __debugInfo(): array
23 23
     {
24 24
         return [
25
-            'description' => @$this->__toString (),
25
+            'description' => @$this->__toString(),
26 26
             'selector'    => @$this->selector,
27 27
             'name'        => @$this->name,
28
-            'objectInfo'  => @json_encode ($this, JSON_PRETTY_PRINT)
28
+            'objectInfo'  => @json_encode($this, JSON_PRETTY_PRINT)
29 29
         ];
30 30
     }
31 31
 
32
-    public function __unset ($name)
32
+    public function __unset($name)
33 33
     {
34 34
         if (isset ($this->$name))
35 35
         {
36
-            if (is_int ($this->$name))
36
+            if (is_int($this->$name))
37 37
             {
38
-                Components::removeComponent ($this->$name);
38
+                Components::removeComponent($this->$name);
39 39
 
40
-                if (VoidEngine::objectExists ($this->$name))
41
-                    VoidEngine::removeObjects ($this->$name);
40
+                if (VoidEngine::objectExists($this->$name))
41
+                    VoidEngine::removeObjects($this->$name);
42 42
             }
43 43
 
44 44
             elseif ($this->$name instanceof Component)
45
-                $this->$name->dispose ();
45
+                $this->$name->dispose();
46 46
         }
47 47
 
48 48
         unset ($this->$name);
49 49
     }
50 50
 
51
-    public function dispose (): void
51
+    public function dispose(): void
52 52
 	{
53
-        foreach (array_diff (get_object_vars ($this), ['selector']) as $param => $value)
53
+        foreach (array_diff(get_object_vars($this), ['selector']) as $param => $value)
54 54
         {
55
-            if (is_int ($value))
55
+            if (is_int($value))
56 56
             {
57
-                Components::removeComponent ($value);
57
+                Components::removeComponent($value);
58 58
 
59
-                if (VoidEngine::objectExists ($value))
60
-                    VoidEngine::removeObjects ($value);
59
+                if (VoidEngine::objectExists($value))
60
+                    VoidEngine::removeObjects($value);
61 61
             }
62 62
 
63 63
             elseif ($value instanceof Component)
64
-                $value->dispose ();
64
+                $value->dispose();
65 65
 
66 66
             unset ($this->$param);
67 67
         }
68 68
 
69 69
         if (isset ($this->selector))
70 70
         {
71
-            if (VoidEngine::objectExists ($this->selector))
72
-                VoidEngine::removeObjects ($this->selector);
71
+            if (VoidEngine::objectExists($this->selector))
72
+                VoidEngine::removeObjects($this->selector);
73 73
             
74
-            Components::removeComponent ($this->selector);
74
+            Components::removeComponent($this->selector);
75 75
         }
76 76
 
77
-        Components::cleanJunk ();
77
+        Components::cleanJunk();
78 78
     }
79 79
 
80
-    public function __destruct ()
80
+    public function __destruct()
81 81
     {
82
-        if (isset ($this->selector) && VoidEngine::destructObject ($this->selector))
82
+        if (isset ($this->selector) && VoidEngine::destructObject($this->selector))
83 83
         {
84
-            VoidEngine::removeObjects ($this->selector);
85
-            Components::removeComponent ($this->selector);
84
+            VoidEngine::removeObjects($this->selector);
85
+            Components::removeComponent($this->selector);
86 86
         }
87 87
     }
88 88
 }
Please login to merge, or discard this patch.
Braces   +13 added lines, -12 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
             {
38 38
                 Components::removeComponent ($this->$name);
39 39
 
40
-                if (VoidEngine::objectExists ($this->$name))
41
-                    VoidEngine::removeObjects ($this->$name);
40
+                if (VoidEngine::objectExists ($this->$name)) {
41
+                                    VoidEngine::removeObjects ($this->$name);
42
+                }
43
+            } elseif ($this->$name instanceof Component) {
44
+                            $this->$name->dispose ();
42 45
             }
43
-
44
-            elseif ($this->$name instanceof Component)
45
-                $this->$name->dispose ();
46 46
         }
47 47
 
48 48
         unset ($this->$name);
@@ -56,20 +56,21 @@  discard block
 block discarded – undo
56 56
             {
57 57
                 Components::removeComponent ($value);
58 58
 
59
-                if (VoidEngine::objectExists ($value))
60
-                    VoidEngine::removeObjects ($value);
59
+                if (VoidEngine::objectExists ($value)) {
60
+                                    VoidEngine::removeObjects ($value);
61
+                }
62
+            } elseif ($value instanceof Component) {
63
+                            $value->dispose ();
61 64
             }
62 65
 
63
-            elseif ($value instanceof Component)
64
-                $value->dispose ();
65
-
66 66
             unset ($this->$param);
67 67
         }
68 68
 
69 69
         if (isset ($this->selector))
70 70
         {
71
-            if (VoidEngine::objectExists ($this->selector))
72
-                VoidEngine::removeObjects ($this->selector);
71
+            if (VoidEngine::objectExists ($this->selector)) {
72
+                            VoidEngine::removeObjects ($this->selector);
73
+            }
73 74
             
74 75
             Components::removeComponent ($this->selector);
75 76
         }
Please login to merge, or discard this patch.
engine/components/TreeView.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
 {
7 7
     public $class = 'System.Windows.Forms.TreeView';
8 8
 
9
-    public function get_path ()
9
+    public function get_path()
10 10
     {
11 11
         try
12 12
         {
@@ -26,15 +26,15 @@  discard block
 block discarded – undo
26 26
 {
27 27
     public $class = 'System.Windows.Forms.TreeNode';
28 28
 
29
-    public function __construct (string $text = '')
29
+    public function __construct(string $text = '')
30 30
     {
31
-        parent::__construct (null, $this->class);
31
+        parent::__construct(null, $this->class);
32 32
 
33
-        $this->text  = $text;
33
+        $this->text = $text;
34 34
     }
35 35
 
36
-    public function get_path ()
36
+    public function get_path()
37 37
     {
38
-        return $this->getProperty ('FullPath');
38
+        return $this->getProperty('FullPath');
39 39
     }
40 40
 }
Please login to merge, or discard this patch.
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,9 +11,7 @@
 block discarded – undo
11 11
         try
12 12
         {
13 13
             $node = $this->selectedNode;
14
-        }
15
-
16
-        catch (\Throwable $e)
14
+        } catch (\Throwable $e)
17 15
         {
18 16
             return false;
19 17
         }
Please login to merge, or discard this patch.
engine/components/WebBrowser.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,18 +6,18 @@
 block discarded – undo
6 6
 {
7 7
     public $class = 'System.Windows.Forms.WebBrowser';
8 8
 
9
-    public function back (): void
9
+    public function back(): void
10 10
     {
11
-        $this->callMethod ('GoBack');
11
+        $this->callMethod('GoBack');
12 12
     }
13 13
 
14
-    public function forward (): void
14
+    public function forward(): void
15 15
     {
16
-        $this->callMethod ('GoForward');
16
+        $this->callMethod('GoForward');
17 17
     }
18 18
 
19
-    public function browse (string $url)
19
+    public function browse(string $url)
20 20
     {
21
-        return $this->callMethod ('Navigate', $url);
21
+        return $this->callMethod('Navigate', $url);
22 22
     }
23 23
 }
Please login to merge, or discard this patch.