@@ -17,9 +17,10 @@ |
||
17 | 17 | |
18 | 18 | spl_autoload_register (function ($class) use ($classes) |
19 | 19 | { |
20 | - if (isset ($classes[$class])) |
|
21 | - include __DIR__ .'/'. $classes[$class]; |
|
22 | -}); |
|
20 | + if (isset ($classes[$class])) { |
|
21 | + include __DIR__ .'/'. $classes[$class]; |
|
22 | + } |
|
23 | + }); |
|
23 | 24 | |
24 | 25 | $required_packages = array |
25 | 26 | ( |
@@ -17,10 +17,11 @@ |
||
17 | 17 | |
18 | 18 | VoidStudioAPI::getObjects ('addPackage')['Package__Add']->enabled = true; |
19 | 19 | |
20 | - foreach (VoidStudioAPI::getObjects ('modules')['ModulesList__QeroPackages']->items->list as $line) |
|
21 | - if ((($pos = strrpos ($line, '@')) !== false && substr ($line, 0, $pos) == $package) || ($pos === false && $line == $package)) |
|
20 | + foreach (VoidStudioAPI::getObjects ('modules')['ModulesList__QeroPackages']->items->list as $line) { |
|
21 | + if ((($pos = strrpos ($line, '@')) !== false && substr ($line, 0, $pos) == $package) || ($pos === false && $line == $package)) |
|
22 | 22 | { |
23 | 23 | VoidStudioAPI::getObjects ('addPackage')['Package__Add']->enabled = false; |
24 | + } |
|
24 | 25 | |
25 | 26 | break; |
26 | 27 | } |
@@ -40,15 +40,14 @@ discard block |
||
40 | 40 | |
41 | 41 | $path = APP_DIR .'/components/icons/'. $component .'_16x.png'; |
42 | 42 | |
43 | - if (!file_exists ($path)) |
|
44 | - $path = APP_DIR .'/components/icons/Unknown_16x.png'; |
|
43 | + if (!file_exists ($path)) { |
|
44 | + $path = APP_DIR .'/components/icons/Unknown_16x.png'; |
|
45 | + } |
|
45 | 46 | |
46 | 47 | $imageList->images->add ((new Image)->loadFromFile ($path)); |
47 | 48 | $componentsList->items->add ($item); |
48 | 49 | } |
49 | - } |
|
50 | - |
|
51 | - else |
|
50 | + } else |
|
52 | 51 | { |
53 | 52 | $item = new ListViewItem (' '. $comps); |
54 | 53 | $item->group = $controlGroup; |
@@ -56,8 +55,9 @@ discard block |
||
56 | 55 | |
57 | 56 | $path = APP_DIR .'/components/icons/'. substr ($groupName, 1) .'_16x.png'; |
58 | 57 | |
59 | - if (!file_exists ($path)) |
|
60 | - $path = APP_DIR .'/components/icons/Unknown_16x.png'; |
|
58 | + if (!file_exists ($path)) { |
|
59 | + $path = APP_DIR .'/components/icons/Unknown_16x.png'; |
|
60 | + } |
|
61 | 61 | |
62 | 62 | $imageList->images->add ((new Image)->loadFromFile ($path)); |
63 | 63 | $componentsList->items->add ($item); |
@@ -9,19 +9,21 @@ discard block |
||
9 | 9 | |
10 | 10 | public function __construct (WFObject $process) |
11 | 11 | { |
12 | - if ($process->getType ()->toString () == 'System.Diagnostics.Process') |
|
13 | - $this->process = $process; |
|
14 | - |
|
15 | - else throw new \Exception ('$process argument must be an "Process" object'); |
|
12 | + if ($process->getType ()->toString () == 'System.Diagnostics.Process') { |
|
13 | + $this->process = $process; |
|
14 | + } else { |
|
15 | + throw new \Exception ('$process argument must be an "Process" object'); |
|
16 | + } |
|
16 | 17 | } |
17 | 18 | |
18 | 19 | public function dump (string $savePath, string $properties = '', bool $waitForExit = true) |
19 | 20 | { |
20 | 21 | $process = run ('"'. APP_DIR .'/system/procdump/procdump.exe"', $properties .' '. $this->process->id .' "'. filepathNoExt ($savePath) .'"'); |
21 | 22 | |
22 | - if ($waitForExit) |
|
23 | - while (!$process->hasExited) |
|
23 | + if ($waitForExit) { |
|
24 | + while (!$process->hasExited) |
|
24 | 25 | usleep (200); |
26 | + } |
|
25 | 27 | } |
26 | 28 | |
27 | 29 | public function debugRequest (string $command, array $arguments = []) |
@@ -37,9 +39,10 @@ discard block |
||
37 | 39 | { |
38 | 40 | $file = VoidStudioProjectManager::$projectPath .'/build/__debug_answer'; |
39 | 41 | |
40 | - if ($wait) |
|
41 | - while (!file_exists ($file)) |
|
42 | + if ($wait) { |
|
43 | + while (!file_exists ($file)) |
|
42 | 44 | usleep (100); |
45 | + } |
|
43 | 46 | |
44 | 47 | if (file_exists ($file)) |
45 | 48 | { |
@@ -22,8 +22,9 @@ |
||
22 | 22 | |
23 | 23 | namespace VoidBuilder; |
24 | 24 | |
25 | -if (is_dir ('qero-packages')) |
|
25 | +if (is_dir ('qero-packages')) { |
|
26 | 26 | require_once 'qero-packages/autoload.php'; |
27 | +} |
|
27 | 28 | |
28 | 29 | require 'php/Builder.php'; |
29 | 30 | require 'php/Joiner.php'; |
@@ -8,8 +8,9 @@ discard block |
||
8 | 8 | |
9 | 9 | public function __construct (string $path) |
10 | 10 | { |
11 | - if (!is_file ($path)) |
|
12 | - throw new \Exception ('Wrong $path paeam'); |
|
11 | + if (!is_file ($path)) { |
|
12 | + throw new \Exception ('Wrong $path paeam'); |
|
13 | + } |
|
13 | 14 | |
14 | 15 | $this->path = $path; |
15 | 16 | } |
@@ -27,14 +28,16 @@ discard block |
||
27 | 28 | |
28 | 29 | public function __construct (string $path) |
29 | 30 | { |
30 | - if (!is_dir ($path)) |
|
31 | - throw new \Exception ('Wrong $path param'); |
|
31 | + if (!is_dir ($path)) { |
|
32 | + throw new \Exception ('Wrong $path param'); |
|
33 | + } |
|
32 | 34 | |
33 | 35 | $this->path = $path; |
34 | 36 | |
35 | - foreach (array_slice (scandir ($path), 2) as $file) |
|
36 | - $this->files[] = is_dir ($file = $path .'/'. $file) ? |
|
37 | + foreach (array_slice (scandir ($path), 2) as $file) { |
|
38 | + $this->files[] = is_dir ($file = $path .'/'. $file) ? |
|
37 | 39 | new Folder ($file) : new File ($file); |
40 | + } |
|
38 | 41 | } |
39 | 42 | |
40 | 43 | public function toXML (): string |
@@ -54,8 +57,9 @@ discard block |
||
54 | 57 | |
55 | 58 | public function __construct (string $input, string $output) |
56 | 59 | { |
57 | - if (!is_file ($input)) |
|
58 | - throw new \Exception ('Wrong $input param'); |
|
60 | + if (!is_file ($input)) { |
|
61 | + throw new \Exception ('Wrong $input param'); |
|
62 | + } |
|
59 | 63 | |
60 | 64 | $this->input = $input; |
61 | 65 | $this->output = $output; |
@@ -10,14 +10,13 @@ |
||
10 | 10 | { |
11 | 11 | try |
12 | 12 | { |
13 | - foreach ($args as $id => $arg) |
|
14 | - $args[$id] = EngineAdditions::coupleSelector ($arg); |
|
13 | + foreach ($args as $id => $arg) { |
|
14 | + $args[$id] = EngineAdditions::coupleSelector ($arg); |
|
15 | + } |
|
15 | 16 | |
16 | 17 | return $function (($e = _c($sender)) !== false ? |
17 | 18 | $e : new WFObject ($sender), ...$args); |
18 | - } |
|
19 | - |
|
20 | - catch (\Throwable $e) |
|
19 | + } catch (\Throwable $e) |
|
21 | 20 | { |
22 | 21 | message ([ |
23 | 22 | 'type' => get_class ($e), |
@@ -338,8 +338,9 @@ |
||
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); |
@@ -104,7 +104,8 @@ |
||
104 | 104 | require 'components/FastColoredTextBox.php'; |
105 | 105 | require 'components/Scintilla.php'; |
106 | 106 | |
107 | -if (is_dir ('extensions')) |
|
107 | +if (is_dir ('extensions')) { |
|
108 | 108 | foreach (scandir ('extensions') as $ext) |
109 | 109 | if (is_dir ('extensions/'. $ext) && file_exists ($ext = 'extensions/'. $ext .'/main.php')) |
110 | 110 | require $ext; |
111 | +} |