Passed
Branch master (4b7a9f)
by Observer
01:48
created
engine/components/Image.php 2 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -31,14 +31,14 @@
 block discarded – undo
31 31
     }
32 32
 
33 33
     public function applyToObject (int $selector): void
34
-	{
35
-		VoidEngine::setProperty ($selector, 'Icon', $this->selector);
36
-	}
34
+    {
35
+        VoidEngine::setProperty ($selector, 'Icon', $this->selector);
36
+    }
37 37
 	
38
-	public function saveToFile (string $file): void
39
-	{
40
-		VoidEngine::callMethod ($this->selector, 'Save', $file);
41
-	}
38
+    public function saveToFile (string $file): void
39
+    {
40
+        VoidEngine::callMethod ($this->selector, 'Save', $file);
41
+    }
42 42
 }
43 43
 
44 44
 class Bitmap extends WFObject
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@  discard block
 block discarded – undo
7 7
     public $class     = 'System.Drawing.Image';
8 8
     public $namespace = 'System.Drawing';
9 9
 
10
-    public function __construct ()
10
+    public function __construct()
11 11
     {
12
-        parent::__construct ($this->class);
12
+        parent::__construct($this->class);
13 13
     }
14 14
 
15
-    public function loadFromFile (string $path)
15
+    public function loadFromFile(string $path)
16 16
     {
17
-        return $this->fromFile ($path);
17
+        return $this->fromFile($path);
18 18
     }
19 19
 }
20 20
 
@@ -23,21 +23,21 @@  discard block
 block discarded – undo
23 23
     public $class     = 'System.Drawing.Icon';
24 24
     public $namespace = 'System.Drawing';
25 25
 
26
-    public function __construct (string $file)
26
+    public function __construct(string $file)
27 27
     {
28
-        parent::__construct ($this->class);
28
+        parent::__construct($this->class);
29 29
 
30
-        $this->fromFile ($file);
30
+        $this->fromFile($file);
31 31
     }
32 32
 
33
-    public function applyToObject (int $selector): void
33
+    public function applyToObject(int $selector): void
34 34
 	{
35
-		VoidEngine::setProperty ($selector, 'Icon', $this->selector);
35
+		VoidEngine::setProperty($selector, 'Icon', $this->selector);
36 36
 	}
37 37
 	
38
-	public function saveToFile (string $file): void
38
+	public function saveToFile(string $file): void
39 39
 	{
40
-		VoidEngine::callMethod ($this->selector, 'Save', $file);
40
+		VoidEngine::callMethod($this->selector, 'Save', $file);
41 41
 	}
42 42
 }
43 43
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
     public $class     = 'System.Drawing.Bitmap';
47 47
     public $namespace = 'System.Drawing';
48 48
 
49
-    public function __construct (string $filename)
49
+    public function __construct(string $filename)
50 50
     {
51
-        parent::__construct ($this->class, $this->namespace, [$filename, 'string']);
51
+        parent::__construct($this->class, $this->namespace, [$filename, 'string']);
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
engine/components/Form.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -4,36 +4,36 @@  discard block
 block discarded – undo
4 4
 
5 5
 class Form extends Control
6 6
 {
7
-	public $class = 'System.Windows.Forms.Form';
7
+    public $class = 'System.Windows.Forms.Form';
8 8
 
9
-	public function get_icon ()
10
-	{
11
-		return new FormIcon ($this->selector);
12
-	}
9
+    public function get_icon ()
10
+    {
11
+        return new FormIcon ($this->selector);
12
+    }
13 13
 	
14
-	public function get_clientSize ()
15
-	{
16
-		$obj = $this->getProperty ('ClientSize');
14
+    public function get_clientSize ()
15
+    {
16
+        $obj = $this->getProperty ('ClientSize');
17 17
 
18
-		$w = VoidEngine::getProperty ($obj, 'Width');
19
-		$h = VoidEngine::getProperty ($obj, 'Height');
18
+        $w = VoidEngine::getProperty ($obj, 'Width');
19
+        $h = VoidEngine::getProperty ($obj, 'Height');
20 20
 		
21
-		VoidEngine::removeObjects ($obj);
21
+        VoidEngine::removeObjects ($obj);
22 22
 		
23
-		return [$w, $h];
24
-	}
23
+        return [$w, $h];
24
+    }
25 25
 	
26
-	public function set_clientSize (array $size)
27
-	{
28
-		$obj = $this->getProperty ('ClientSize');
26
+    public function set_clientSize (array $size)
27
+    {
28
+        $obj = $this->getProperty ('ClientSize');
29 29
 
30
-		VoidEngine::setProperty ($obj, 'Width', array_shift ($size));
31
-		VoidEngine::setProperty ($obj, 'Height', array_shift ($size));
30
+        VoidEngine::setProperty ($obj, 'Width', array_shift ($size));
31
+        VoidEngine::setProperty ($obj, 'Height', array_shift ($size));
32 32
 
33
-		$this->setProperty ('ClientSize', $obj);
33
+        $this->setProperty ('ClientSize', $obj);
34 34
 
35
-		VoidEngine::removeObjects ($obj);
36
-	}
35
+        VoidEngine::removeObjects ($obj);
36
+    }
37 37
 }
38 38
 
39 39
 class FormIcon extends Icon
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     public function loadFromFile (string $file)
49
-	{
49
+    {
50 50
         $icon = VoidEngine::createObject ('System.Drawing.Icon', 'System.Drawing', text ($file));
51 51
         
52 52
         VoidEngine::setProperty ($this->formSelector, 'Icon', $icon);
53 53
 
54
-		if (!isset ($this->selector))
55
-		    $this->selector = $icon;
56
-	}
54
+        if (!isset ($this->selector))
55
+            $this->selector = $icon;
56
+    }
57 57
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,33 +6,33 @@  discard block
 block discarded – undo
6 6
 {
7 7
 	public $class = 'System.Windows.Forms.Form';
8 8
 
9
-	public function get_icon ()
9
+	public function get_icon()
10 10
 	{
11
-		return new FormIcon ($this->selector);
11
+		return new FormIcon($this->selector);
12 12
 	}
13 13
 	
14
-	public function get_clientSize ()
14
+	public function get_clientSize()
15 15
 	{
16
-		$obj = $this->getProperty ('ClientSize');
16
+		$obj = $this->getProperty('ClientSize');
17 17
 
18
-		$w = VoidEngine::getProperty ($obj, 'Width');
19
-		$h = VoidEngine::getProperty ($obj, 'Height');
18
+		$w = VoidEngine::getProperty($obj, 'Width');
19
+		$h = VoidEngine::getProperty($obj, 'Height');
20 20
 		
21
-		VoidEngine::removeObjects ($obj);
21
+		VoidEngine::removeObjects($obj);
22 22
 		
23 23
 		return [$w, $h];
24 24
 	}
25 25
 	
26
-	public function set_clientSize (array $size)
26
+	public function set_clientSize(array $size)
27 27
 	{
28
-		$obj = $this->getProperty ('ClientSize');
28
+		$obj = $this->getProperty('ClientSize');
29 29
 
30
-		VoidEngine::setProperty ($obj, 'Width', array_shift ($size));
31
-		VoidEngine::setProperty ($obj, 'Height', array_shift ($size));
30
+		VoidEngine::setProperty($obj, 'Width', array_shift($size));
31
+		VoidEngine::setProperty($obj, 'Height', array_shift($size));
32 32
 
33
-		$this->setProperty ('ClientSize', $obj);
33
+		$this->setProperty('ClientSize', $obj);
34 34
 
35
-		VoidEngine::removeObjects ($obj);
35
+		VoidEngine::removeObjects($obj);
36 36
 	}
37 37
 }
38 38
 
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
 {
41 41
     protected $formSelector;
42 42
 
43
-    public function __construct (int $formSelector)
43
+    public function __construct(int $formSelector)
44 44
     {
45 45
         $this->formSelector = $formSelector;
46 46
     }
47 47
 
48
-    public function loadFromFile (string $file)
48
+    public function loadFromFile(string $file)
49 49
 	{
50
-        $icon = VoidEngine::createObject ('System.Drawing.Icon', 'System.Drawing', text ($file));
50
+        $icon = VoidEngine::createObject('System.Drawing.Icon', 'System.Drawing', text($file));
51 51
         
52
-        VoidEngine::setProperty ($this->formSelector, 'Icon', $icon);
52
+        VoidEngine::setProperty($this->formSelector, 'Icon', $icon);
53 53
 
54 54
 		if (!isset ($this->selector))
55 55
 		    $this->selector = $icon;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,7 +51,8 @@
 block discarded – undo
51 51
         
52 52
         VoidEngine::setProperty ($this->formSelector, 'Icon', $icon);
53 53
 
54
-		if (!isset ($this->selector))
55
-		    $this->selector = $icon;
54
+		if (!isset ($this->selector)) {
55
+				    $this->selector = $icon;
56
+		}
56 57
 	}
57 58
 }
Please login to merge, or discard this patch.
engine/components/MenuStrip.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,11 +18,11 @@
 block discarded – undo
18 18
 
19 19
     protected $items;
20 20
 
21
-    public function __construct (string $text = '')
21
+    public function __construct(string $text = '')
22 22
     {
23
-        parent::__construct (null, $this->class);
23
+        parent::__construct(null, $this->class);
24 24
 
25 25
         $this->text  = $text;
26
-        $this->items = new WFObject ($this->getProperty ('DropDownItems'));
26
+        $this->items = new WFObject($this->getProperty('DropDownItems'));
27 27
     }
28 28
 }
Please login to merge, or discard this patch.
engine/components/PictureBox.php 2 patches
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -4,48 +4,48 @@
 block discarded – undo
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 (text ($file))->selector);
35
-	}
35
+    }
36 36
 	
37
-	public function saveToFile (string $file)
38
-	{
39
-		VoidEngine::callMethod ($this->selector, 'Save', text ($file));
40
-	}
37
+    public function saveToFile (string $file)
38
+    {
39
+        VoidEngine::callMethod ($this->selector, 'Save', text ($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
 }
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 (text ($file))->selector);
34
+        VoidEngine::setProperty($this->pictureBoxSelector, 'Image', (new Image())->loadFromFile(text($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', text ($file));
39
+		VoidEngine::callMethod($this->selector, 'Save', text($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
 }
Please login to merge, or discard this patch.
engine/components/SplitContainer.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@
 block discarded – undo
10 10
     protected $panel2;
11 11
 
12 12
     public function __construct (Component $parent = null)
13
-	{
13
+    {
14 14
         parent::__construct ($parent, $this->class);
15 15
 
16 16
         $this->panel1 = new SplitterPanel ($this->getProperty ('Panel1'));
17 17
         $this->panel2 = new SplitterPanel ($this->getProperty ('Panel2'));
18
-	}
18
+    }
19 19
 }
20 20
 
21 21
 class SplitterPanel extends Control
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,18 +9,18 @@
 block discarded – undo
9 9
     protected $panel1;
10 10
     protected $panel2;
11 11
 
12
-    public function __construct (Component $parent = null)
12
+    public function __construct(Component $parent = null)
13 13
 	{
14
-        parent::__construct ($parent, $this->class);
14
+        parent::__construct($parent, $this->class);
15 15
 
16
-        $this->panel1 = new SplitterPanel ($this->getProperty ('Panel1'));
17
-        $this->panel2 = new SplitterPanel ($this->getProperty ('Panel2'));
16
+        $this->panel1 = new SplitterPanel($this->getProperty('Panel1'));
17
+        $this->panel2 = new SplitterPanel($this->getProperty('Panel2'));
18 18
 	}
19 19
 }
20 20
 
21 21
 class SplitterPanel extends Control
22 22
 {
23
-    public function __construct (int $selector)
23
+    public function __construct(int $selector)
24 24
     {
25 25
         $this->selector = $selector;
26 26
     }
Please login to merge, or discard this patch.
engine/components/Designer.php 2 patches
Spacing   +91 added lines, -92 removed lines patch added patch discarded remove patch
@@ -20,21 +20,20 @@  discard block
 block discarded – undo
20 20
     protected $currentSelectedItem;
21 21
     protected $formsList;
22 22
 
23
-    public function __construct (Component $parent, string $formName = 'form', PropertyGrid $propertyGrid, EventGrid $eventsList, ComboBox $currentSelectedItem, TabControl $formsList, $form = null)
23
+    public function __construct(Component $parent, string $formName = 'form', PropertyGrid $propertyGrid, EventGrid $eventsList, ComboBox $currentSelectedItem, TabControl $formsList, $form = null)
24 24
     {
25
-        $this->form = $form === null ? new Form :
26
-            EngineAdditions::coupleSelector ($form);
25
+        $this->form = $form === null ? new Form : EngineAdditions::coupleSelector($form);
27 26
 
28
-        if (!is_object ($this->form))
29
-            throw new \Exception ('$form param in "VoidEngine\VoidDesigner" constructor must be instance of "VoidEngine\WFObject" ("VoidEngine\Form") or be object selector');
27
+        if (!is_object($this->form))
28
+            throw new \Exception('$form param in "VoidEngine\VoidDesigner" constructor must be instance of "VoidEngine\WFObject" ("VoidEngine\Form") or be object selector');
30 29
 
31 30
         $this->propertyGrid        = $propertyGrid;
32 31
         $this->eventsList          = $eventsList;
33 32
         $this->currentSelectedItem = $currentSelectedItem;
34 33
         $this->formsList           = $formsList;
35 34
 
36
-        $this->selector = VoidEngine::createObject ('WinForms_PHP.FormDesigner4', null, $this->form->selector, $formName);
37
-        Components::addComponent ($this->selector, $this);
35
+        $this->selector = VoidEngine::createObject('WinForms_PHP.FormDesigner4', null, $this->form->selector, $formName);
36
+        Components::addComponent($this->selector, $this);
38 37
 
39 38
         $this->form->name = $formName;
40 39
 
@@ -44,185 +43,185 @@  discard block
 block discarded – undo
44 43
             $this->form->size = [400, 360];
45 44
         }
46 45
 
47
-        $this->control = $this->callMethod ('GetControl');
46
+        $this->control = $this->callMethod('GetControl');
48 47
         $this->objects[$formName] = ['System.Windows.Forms.Form', 'System.Windows.Forms'];
49 48
 
50
-        VoidEngine::setProperty ($this->control, 'Parent', $parent->selector);
49
+        VoidEngine::setProperty($this->control, 'Parent', $parent->selector);
51 50
 
52
-        VoidEngine::setObjectEvent ($this->control, 'KeyDown', '
51
+        VoidEngine::setObjectEvent($this->control, 'KeyDown', '
53 52
             namespace VoidEngine;
54 53
 
55 54
             if ((new WFObject ($args))->keycode == 46)
56
-                _c('. $this->selector .')->removeSelected ();
55
+                _c('. $this->selector.')->removeSelected ();
57 56
         ');
58 57
 
59
-        VoidEngine::setObjectEvent ($this->selector, 'SelectionChanged', '
58
+        VoidEngine::setObjectEvent($this->selector, 'SelectionChanged', '
60 59
             namespace VoidEngine;
61 60
 
62
-            $objects     = VoidEngine::callMethod ('. $this->selector .', "GetSelectedComponents");
61
+            $objects     = VoidEngine::callMethod ('. $this->selector.', "GetSelectedComponents");
63 62
             $firstObject = VoidEngine::getArrayValue ($objects, 0);
64 63
             
65
-            _c('. $propertyGrid->selector .')->selectedObject = $firstObject;
66
-            _c('. $eventsList->selector .')->selectedObject = $firstObject;
67
-            _c('. $currentSelectedItem->selector .')->selectedItem = _c('. $this->selector .')->getComponentName ($firstObject);
64
+            _c('. $propertyGrid->selector.')->selectedObject = $firstObject;
65
+            _c('. $eventsList->selector.')->selectedObject = $firstObject;
66
+            _c('. $currentSelectedItem->selector.')->selectedItem = _c('.$this->selector.')->getComponentName ($firstObject);
68 67
 
69 68
             if (isset (Components::$events[$firstObject]) && sizeof (Components::$events[$firstObject]) > 0)
70 69
                 foreach (Components::$events[$firstObject] as $eventName => $event)
71
-                    _c('. $eventsList->selector .')->getEventByName ($eventName)->value = text ("(добавлено)");
70
+                    _c('. $eventsList->selector.')->getEventByName ($eventName)->value = text ("(добавлено)");
72 71
 
73
-            _c('. $eventsList->selector .')->refresh ();
72
+            _c('. $eventsList->selector.')->refresh ();
74 73
         ');
75 74
     }
76 75
 
77
-    public function initDesigner (): void
76
+    public function initDesigner(): void
78 77
     {
79
-        $this->componentAddedEvent = function ($self, $args)
78
+        $this->componentAddedEvent = function($self, $args)
80 79
         {
81 80
             if (isset ($GLOBALS['new_component']))
82 81
             {
83
-                $self->setComponentToHistory ($GLOBALS['new_component'][1], $GLOBALS['new_component'][0]);
84
-                $components = VoidStudioAPI::getObjects ('main')['PropertiesPanel__SelectedComponent'];
82
+                $self->setComponentToHistory($GLOBALS['new_component'][1], $GLOBALS['new_component'][0]);
83
+                $components = VoidStudioAPI::getObjects('main')['PropertiesPanel__SelectedComponent'];
85 84
 
86
-                $components->items->clear ();
87
-                $components->items->addRange (array_keys ($self->objects));
85
+                $components->items->clear();
86
+                $components->items->addRange(array_keys($self->objects));
88 87
 
89 88
                 $components->selectedItem = $GLOBALS['new_component'][0];
90
-                $self->setSelectedComponents ($args->component);
89
+                $self->setSelectedComponents($args->component);
91 90
 
92 91
                 unset ($GLOBALS['new_component']);
93 92
             }
94 93
         };
95 94
 
96
-        $this->rightClickEvent = function ($self, $args)
95
+        $this->rightClickEvent = function($self, $args)
97 96
         {
98
-            $delItem = new ToolStripMenuItem (text ('Удалить'));
99
-            $delItem->image = (new Image)->loadFromFile (text (APP_DIR .'/system/icons/Delete_16x.png'));
100
-            $delItem->clickEvent = function () use ($self)
97
+            $delItem = new ToolStripMenuItem(text('Удалить'));
98
+            $delItem->image = (new Image)->loadFromFile(text(APP_DIR.'/system/icons/Delete_16x.png'));
99
+            $delItem->clickEvent = function() use ($self)
101 100
             {
102
-                $self->removeSelected ();
101
+                $self->removeSelected();
103 102
             };
104 103
 
105
-            $toFrontItem = new ToolStripMenuItem (text ('На передний план'));
106
-            $toFrontItem->image = (new Image)->loadFromFile (text (APP_DIR .'/system/icons/Front_16x.png'));
107
-            $toFrontItem->clickEvent = function () use ($self)
104
+            $toFrontItem = new ToolStripMenuItem(text('На передний план'));
105
+            $toFrontItem->image = (new Image)->loadFromFile(text(APP_DIR.'/system/icons/Front_16x.png'));
106
+            $toFrontItem->clickEvent = function() use ($self)
108 107
             {
109
-                $self->bringToFrontSelected ();
108
+                $self->bringToFrontSelected();
110 109
             };
111 110
 
112
-            $toBackItem = new ToolStripMenuItem (text ('На задний план'));
113
-            $toBackItem->image = (new Image)->loadFromFile (text (APP_DIR .'/system/icons/Back_16x.png'));
114
-            $toBackItem->clickEvent = function () use ($self)
111
+            $toBackItem = new ToolStripMenuItem(text('На задний план'));
112
+            $toBackItem->image = (new Image)->loadFromFile(text(APP_DIR.'/system/icons/Back_16x.png'));
113
+            $toBackItem->clickEvent = function() use ($self)
115 114
             {
116
-                $self->sendToBackSelected ();
115
+                $self->sendToBackSelected();
117 116
             };
118 117
 
119
-            $infoItem = new ToolStripMenuItem (text ('Отладочная информация'));
120
-            $infoItem->image = (new Image)->loadFromFile (text (APP_DIR .'/system/icons/Debug_16x.png'));
121
-            $infoItem->clickEvent = function () use ($self)
118
+            $infoItem = new ToolStripMenuItem(text('Отладочная информация'));
119
+            $infoItem->image = (new Image)->loadFromFile(text(APP_DIR.'/system/icons/Debug_16x.png'));
120
+            $infoItem->clickEvent = function() use ($self)
122 121
             {
123
-                $self->getSelectedComponents ()->foreach (function ($value) use ($self)
122
+                $self->getSelectedComponents()->foreach(function($value) use ($self)
124 123
                 {
125
-                    pre ($value instanceof Component ? $value : $value->toString () ."\nSelector: ". $value->selector);
124
+                    pre($value instanceof Component ? $value : $value->toString()."\nSelector: ".$value->selector);
126 125
 
127 126
                     // if ($value->getType ()->toString () == 'System.Windows.Forms.Form')
128 127
                     // if ($value->getType ()->isSubclassOf (VoidEngine::objectType ('System.Windows.Forms.Form', 'System.Windows.Forms')))
129
-                        pre ($self->getSharpCode ($self->form->name));
128
+                        pre($self->getSharpCode($self->form->name));
130 129
                 });
131 130
             };
132 131
 
133 132
             $menu = new ContextMenuStrip;
134
-            $menu->items->addRange ([
133
+            $menu->items->addRange([
135 134
                 $delItem, '-',
136 135
                 $toFrontItem, $toBackItem, '-',
137 136
                 $infoItem
138 137
             ]);
139 138
 
140
-            $menu->show ($self->form, $self->form->pointToClient (VoidEngine::createObject ('System.Drawing.Point', 'System.Drawing', $args->x, $args->y)));
139
+            $menu->show($self->form, $self->form->pointToClient(VoidEngine::createObject('System.Drawing.Point', 'System.Drawing', $args->x, $args->y)));
141 140
         };
142 141
 
143
-        VoidStudioAPI::addObjects ('main', ['Designer__'. $this->form->name .'Designer' => $this]);
142
+        VoidStudioAPI::addObjects('main', ['Designer__'.$this->form->name.'Designer' => $this]);
144 143
     }
145 144
 
146
-    public function focus (): void
145
+    public function focus(): void
147 146
     {
148
-        $this->form->focus ();
147
+        $this->form->focus();
149 148
     }
150 149
 
151
-    public function getSharpCode (string $formName, bool $asObject = false): string
150
+    public function getSharpCode(string $formName, bool $asObject = false): string
152 151
     {
153
-        $code = $this->callMethod (['GetSharpCode', 'object'], $formName);
152
+        $code = $this->callMethod(['GetSharpCode', 'object'], $formName);
154 153
 
155
-        $code = VoidEngine::callMethod ($code, ['Replace', 'object'], 'public class '. $this->form->name .' : '. $this->form->name, 'public class '. $this->form->name .' : System.Windows.Forms.Form');
156
-        $code = VoidEngine::callMethod ($code, ['Replace', 'object'], '    private ', '    public ');
154
+        $code = VoidEngine::callMethod($code, ['Replace', 'object'], 'public class '.$this->form->name.' : '.$this->form->name, 'public class '.$this->form->name.' : System.Windows.Forms.Form');
155
+        $code = VoidEngine::callMethod($code, ['Replace', 'object'], '    private ', '    public ');
157 156
 
158 157
         return $asObject ?
159
-            $code : VoidEngine::callMethod ($code, 'ToString');
158
+            $code : VoidEngine::callMethod($code, 'ToString');
160 159
     }
161 160
 
162
-    public function createComponent (array $component, string $componentName): int
161
+    public function createComponent(array $component, string $componentName): int
163 162
     {
164 163
         $this->objects[$componentName] = $component;
165
-        $selector = VoidEngine::createObject (...$component);
164
+        $selector = VoidEngine::createObject(...$component);
166 165
 
167
-        $this->callMethod ('AddComponent', $selector, $componentName);
166
+        $this->callMethod('AddComponent', $selector, $componentName);
168 167
 
169 168
         return $selector;
170 169
     }
171 170
 
172
-    public function setComponentToHistory (array $component, string $componentName): void
171
+    public function setComponentToHistory(array $component, string $componentName): void
173 172
     {
174 173
         $this->objects[$componentName] = $component;
175 174
     }
176 175
 
177
-    public function addComponent (int $selector, string $componentName): void
176
+    public function addComponent(int $selector, string $componentName): void
178 177
     {
179
-        $this->objects[$componentName] = [VoidEngine::callMethod (VoidEngine::callMethod ($selector, 'GetType'), 'ToString'), 'auto'];
178
+        $this->objects[$componentName] = [VoidEngine::callMethod(VoidEngine::callMethod($selector, 'GetType'), 'ToString'), 'auto'];
180 179
 
181
-        $this->callMethod ('AddComponent', $selector, $componentName);
180
+        $this->callMethod('AddComponent', $selector, $componentName);
182 181
     }
183 182
 
184
-    public function removeComponent (int $component): void
183
+    public function removeComponent(int $component): void
185 184
     {
186
-        unset ($this->objects[$this->getComponentName ($component)]);
185
+        unset ($this->objects[$this->getComponentName($component)]);
187 186
 
188
-        $this->callMethod ('RemoveComponent', $component);
187
+        $this->callMethod('RemoveComponent', $component);
189 188
     }
190 189
 
191
-    public function removeComponentHistoryByName (string $name): void
190
+    public function removeComponentHistoryByName(string $name): void
192 191
     {
193 192
         unset ($this->objects[$name]);
194 193
     }
195 194
 
196
-    public function removeSelected (): void
195
+    public function removeSelected(): void
197 196
     {
198 197
         $toUnset = [];
199 198
 
200
-        foreach ($this->getSelectedComponents ()->list as $object)
199
+        foreach ($this->getSelectedComponents()->list as $object)
201 200
         {
202
-            if ($object->getType ()->toString () != 'System.Windows.Forms.Form')
203
-                $toUnset[] = $this->getComponentName ($object->selector);
201
+            if ($object->getType()->toString() != 'System.Windows.Forms.Form')
202
+                $toUnset[] = $this->getComponentName($object->selector);
204 203
 
205 204
             else
206 205
             {
207 206
                 if ($this->formsList->items->count > 1)
208 207
                 {
209
-                    if (messageBox (text ('Вы действительно хотите удалить форму "'. $this->form->name .'"?'), text ('Подтвердите действие'), enum ('System.Windows.Forms.MessageBoxButtons.YesNo'), enum ('System.Windows.Forms.MessageBoxIcon.Question')) == 6)
208
+                    if (messageBox(text('Вы действительно хотите удалить форму "'.$this->form->name.'"?'), text('Подтвердите действие'), enum('System.Windows.Forms.MessageBoxButtons.YesNo'), enum('System.Windows.Forms.MessageBoxIcon.Question')) == 6)
210 209
                     {
211 210
                         foreach ($this->objects as $name => $obj)
212 211
                             unset ($this->objects[$name]);
213 212
 
214
-                        unset ($this->formsList->items[array_flip ($this->formsList->items->names)[$form = $this->getComponentName ($object->selector)]]);
213
+                        unset ($this->formsList->items[array_flip($this->formsList->items->names)[$form = $this->getComponentName($object->selector)]]);
215 214
 
216 215
                         /*$this->form->dispose ();
217 216
                         VoidEngine::callMethod ($this->control, 'Dispose');*/
218
-                        $this->callMethod ('DeleteSelected');
217
+                        $this->callMethod('DeleteSelected');
219 218
 
220
-                        $designer = VoidStudioAPI::getObjects ('main')['Designer__'. $this->formsList->selectedTab->text .'Designer'];
219
+                        $designer = VoidStudioAPI::getObjects('main')['Designer__'.$this->formsList->selectedTab->text.'Designer'];
221 220
                         
222 221
                         $designer->propertyGrid->selectedObject = $designer->form;
223
-                        $designer->setSelectedComponents ($designer->form);
222
+                        $designer->setSelectedComponents($designer->form);
224 223
 
225
-                        unset (VoidStudioAPI::$objects['main']['Designer__'. $form .'Designer']);
224
+                        unset (VoidStudioAPI::$objects['main']['Designer__'.$form.'Designer']);
226 225
 
227 226
                         return;
228 227
                     }
@@ -230,7 +229,7 @@  discard block
 block discarded – undo
230 229
 
231 230
                 else
232 231
                 {
233
-                    messageBox (text ('Нельзя удалить единственную форму проекта'), text ('Ошибка удаления'), enum ('System.Windows.Forms.MessageBoxButtons.OK'), enum ('System.Windows.Forms.MessageBoxIcon.Error'));
232
+                    messageBox(text('Нельзя удалить единственную форму проекта'), text('Ошибка удаления'), enum('System.Windows.Forms.MessageBoxButtons.OK'), enum('System.Windows.Forms.MessageBoxIcon.Error'));
234 233
 
235 234
                     return;
236 235
                 }
@@ -240,52 +239,52 @@  discard block
 block discarded – undo
240 239
         foreach ($toUnset as $name)
241 240
             unset ($this->objects[$name]);
242 241
 
243
-        $this->callMethod ('DeleteSelected');
242
+        $this->callMethod('DeleteSelected');
244 243
 
245 244
         foreach ($this->objects as $objectName => $object)
246
-            if (!is_int ($this->getComponentByName ($objectName)))
245
+            if (!is_int($this->getComponentByName($objectName)))
247 246
                 unset ($this->objects[$objectName]);
248 247
 
249
-        $this->currentSelectedItem->items->clear ();
250
-        $this->currentSelectedItem->items->addRange (array_keys ($this->objects));
248
+        $this->currentSelectedItem->items->clear();
249
+        $this->currentSelectedItem->items->addRange(array_keys($this->objects));
251 250
         $this->currentSelectedItem->selectedItem = $this->form->name;
252 251
     }
253 252
 
254
-    public function renameComponent (int $component, string $name, string $fromName = null): void
253
+    public function renameComponent(int $component, string $name, string $fromName = null): void
255 254
     {
256 255
         if ($fromName === null)
257
-            $fromName = $this->getComponentName ($component);
256
+            $fromName = $this->getComponentName($component);
258 257
 
259 258
         $info = $this->objects[$fromName];
260 259
         unset ($this->objects[$fromName]);
261 260
         $this->objects[$name] = $info;
262 261
 
263
-        $this->callMethod ('RenameComponent', $component, $name);
262
+        $this->callMethod('RenameComponent', $component, $name);
264 263
     }
265 264
 
266
-    public function getComponentName (int $component): string
265
+    public function getComponentName(int $component): string
267 266
     {
268
-        return $this->callMethod ('GetComponentName', $component);
267
+        return $this->callMethod('GetComponentName', $component);
269 268
     }
270 269
 
271
-    public function getComponentByName (string $name)
270
+    public function getComponentByName(string $name)
272 271
     {
273
-        return $this->callMethod ('GetComponentByName', $name);
272
+        return $this->callMethod('GetComponentByName', $name);
274 273
     }
275 274
 
276
-    public function getComponentClass (string $name)
275
+    public function getComponentClass(string $name)
277 276
     {
278 277
         return isset ($this->objects[$name]) ?
279 278
             $this->objects[$name] : false;
280 279
     }
281 280
 
282
-    public function addProperty (int $selector, string $name, int $value, bool $readOnly, string $category, string $description, bool $visible)
281
+    public function addProperty(int $selector, string $name, int $value, bool $readOnly, string $category, string $description, bool $visible)
283 282
     {
284
-        $this->callMethod ('AddProperty', $selector, $name, $value, $readOnly, $category, $description, $visible);
283
+        $this->callMethod('AddProperty', $selector, $name, $value, $readOnly, $category, $description, $visible);
285 284
     }
286 285
 
287
-    public function removeProperty (int $selector, string $name)
286
+    public function removeProperty(int $selector, string $name)
288 287
     {
289
-        $this->callMethod ('RemoveProperty', $selector, $name);
288
+        $this->callMethod('RemoveProperty', $selector, $name);
290 289
     }
291 290
 }
Please login to merge, or discard this patch.
Braces   +19 added lines, -17 removed lines patch added patch discarded remove patch
@@ -25,8 +25,9 @@  discard block
 block discarded – undo
25 25
         $this->form = $form === null ? new Form :
26 26
             EngineAdditions::coupleSelector ($form);
27 27
 
28
-        if (!is_object ($this->form))
29
-            throw new \Exception ('$form param in "VoidEngine\VoidDesigner" constructor must be instance of "VoidEngine\WFObject" ("VoidEngine\Form") or be object selector');
28
+        if (!is_object ($this->form)) {
29
+                    throw new \Exception ('$form param in "VoidEngine\VoidDesigner" constructor must be instance of "VoidEngine\WFObject" ("VoidEngine\Form") or be object selector');
30
+        }
30 31
 
31 32
         $this->propertyGrid        = $propertyGrid;
32 33
         $this->eventsList          = $eventsList;
@@ -199,17 +200,17 @@  discard block
 block discarded – undo
199 200
 
200 201
         foreach ($this->getSelectedComponents ()->list as $object)
201 202
         {
202
-            if ($object->getType ()->toString () != 'System.Windows.Forms.Form')
203
-                $toUnset[] = $this->getComponentName ($object->selector);
204
-
205
-            else
203
+            if ($object->getType ()->toString () != 'System.Windows.Forms.Form') {
204
+                            $toUnset[] = $this->getComponentName ($object->selector);
205
+            } else
206 206
             {
207 207
                 if ($this->formsList->items->count > 1)
208 208
                 {
209 209
                     if (messageBox (text ('Вы действительно хотите удалить форму "'. $this->form->name .'"?'), text ('Подтвердите действие'), enum ('System.Windows.Forms.MessageBoxButtons.YesNo'), enum ('System.Windows.Forms.MessageBoxIcon.Question')) == 6)
210 210
                     {
211
-                        foreach ($this->objects as $name => $obj)
212
-                            unset ($this->objects[$name]);
211
+                        foreach ($this->objects as $name => $obj) {
212
+                                                    unset ($this->objects[$name]);
213
+                        }
213 214
 
214 215
                         unset ($this->formsList->items[array_flip ($this->formsList->items->names)[$form = $this->getComponentName ($object->selector)]]);
215 216
 
@@ -226,9 +227,7 @@  discard block
 block discarded – undo
226 227
 
227 228
                         return;
228 229
                     }
229
-                }
230
-
231
-                else
230
+                } else
232 231
                 {
233 232
                     messageBox (text ('Нельзя удалить единственную форму проекта'), text ('Ошибка удаления'), enum ('System.Windows.Forms.MessageBoxButtons.OK'), enum ('System.Windows.Forms.MessageBoxIcon.Error'));
234 233
 
@@ -237,14 +236,16 @@  discard block
 block discarded – undo
237 236
             }
238 237
         }
239 238
 
240
-        foreach ($toUnset as $name)
241
-            unset ($this->objects[$name]);
239
+        foreach ($toUnset as $name) {
240
+                    unset ($this->objects[$name]);
241
+        }
242 242
 
243 243
         $this->callMethod ('DeleteSelected');
244 244
 
245
-        foreach ($this->objects as $objectName => $object)
246
-            if (!is_int ($this->getComponentByName ($objectName)))
245
+        foreach ($this->objects as $objectName => $object) {
246
+                    if (!is_int ($this->getComponentByName ($objectName)))
247 247
                 unset ($this->objects[$objectName]);
248
+        }
248 249
 
249 250
         $this->currentSelectedItem->items->clear ();
250 251
         $this->currentSelectedItem->items->addRange (array_keys ($this->objects));
@@ -253,8 +254,9 @@  discard block
 block discarded – undo
253 254
 
254 255
     public function renameComponent (int $component, string $name, string $fromName = null): void
255 256
     {
256
-        if ($fromName === null)
257
-            $fromName = $this->getComponentName ($component);
257
+        if ($fromName === null) {
258
+                    $fromName = $this->getComponentName ($component);
259
+        }
258 260
 
259 261
         $info = $this->objects[$fromName];
260 262
         unset ($this->objects[$fromName]);
Please login to merge, or discard this patch.
engine/components/FastColoredTextBox.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 
7 7
 class FastColoredTextBox extends NoVisual
8 8
 {
9
-	public $class     = 'FastColoredTextBoxNS.FastColoredTextBox';
9
+    public $class     = 'FastColoredTextBoxNS.FastColoredTextBox';
10 10
     public $namespace = 'FastColoredTextBox';
11 11
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,10 +2,10 @@
 block discarded – undo
2 2
 
3 3
 namespace VoidEngine;
4 4
 
5
-EngineAdditions::loadModule ('FastColoredTextBox.dll');
5
+EngineAdditions::loadModule('FastColoredTextBox.dll');
6 6
 
7 7
 class FastColoredTextBox extends NoVisual
8 8
 {
9
-	public $class     = 'FastColoredTextBoxNS.FastColoredTextBox';
9
+	public $class = 'FastColoredTextBoxNS.FastColoredTextBox';
10 10
     public $namespace = 'FastColoredTextBox';
11 11
 }
Please login to merge, or discard this patch.
engine/components/MainMenu.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  discard block
 block discarded – undo
8 8
 
9 9
     protected $items;
10 10
 
11
-    public function __construct ()
11
+    public function __construct()
12 12
     {
13
-        parent::__construct ($this->class);
13
+        parent::__construct($this->class);
14 14
 
15
-        $this->items = new WFObject ($this->getProperty ('MenuItems'));
15
+        $this->items = new WFObject($this->getProperty('MenuItems'));
16 16
     }
17 17
 }
18 18
 
@@ -22,11 +22,11 @@  discard block
 block discarded – undo
22 22
 
23 23
     protected $items;
24 24
 
25
-    public function __construct ()
25
+    public function __construct()
26 26
     {
27
-        parent::__construct ($this->class);
27
+        parent::__construct($this->class);
28 28
 
29
-        $this->items = new WFObject ($this->getProperty ('MenuItems'));
29
+        $this->items = new WFObject($this->getProperty('MenuItems'));
30 30
     }
31 31
 }
32 32
 
@@ -36,11 +36,11 @@  discard block
 block discarded – undo
36 36
 
37 37
     protected $items;
38 38
 
39
-    public function __construct (string $text = '')
39
+    public function __construct(string $text = '')
40 40
     {
41
-        parent::__construct (null, $this->class);
41
+        parent::__construct(null, $this->class);
42 42
 
43 43
         $this->text  = $text;
44
-        $this->items = new WFObject ($this->getProperty ('MenuItems'));
44
+        $this->items = new WFObject($this->getProperty('MenuItems'));
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
engine/components/ColorDialog.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.ColorDialog';
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
 	
14
-    public function get_color ()
14
+    public function get_color()
15 15
     {
16
-        return $this->getProperty (['Color', 'color']);
16
+        return $this->getProperty(['Color', 'color']);
17 17
     }
18 18
 	
19
-    public function set_color (int $color)
19
+    public function set_color(int $color)
20 20
     {
21
-        $this->setProperty ('Color', [$color, 'color']);
21
+        $this->setProperty('Color', [$color, 'color']);
22 22
     }
23 23
 }
Please login to merge, or discard this patch.