Completed
Push — master ( f56d39...db9aad )
by Sergey
02:16
created
src/LTDBeget/sphinx/configurator/deserializers/ArrayDeserializer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
                 $name            = $section["name"];
90 90
                 $inheritanceName = !empty($section["inheritance"]) ? $section["inheritance"] : null;
91
-                $section      = $this->objectConfiguration->addSource($name, $inheritanceName);
91
+                $section = $this->objectConfiguration->addSource($name, $inheritanceName);
92 92
                 break;
93 93
             case eSection::INDEX():
94 94
                 $name = $section["name"];
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                 }
99 99
 
100 100
                 $inheritanceName = !empty($section["inheritance"]) ? $section["inheritance"] : null;
101
-                $section      = $this->objectConfiguration->addIndex($name, $inheritanceName);
101
+                $section = $this->objectConfiguration->addIndex($name, $inheritanceName);
102 102
                 break;
103 103
             case eSection::INDEXER():
104 104
                 $section = $this->objectConfiguration->getIndexer();
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      */
156 156
     private function getOptionName(Section $section, string $name) : eOption
157 157
     {
158
-        switch($section->getType()) {
158
+        switch ($section->getType()) {
159 159
             case eSection::SOURCE():
160 160
                 $option = eSourceOption::get($name);
161 161
                 break;
Please login to merge, or discard this patch.
src/LTDBeget/sphinx/configurator/configurationEntities/base/Section.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     final public function getType() : eSection
60 60
     {
61
-        if(is_null($this->type)) {
61
+        if (is_null($this->type)) {
62 62
             $this->initType();
63 63
         }
64 64
 
@@ -86,9 +86,9 @@  discard block
 block discarded – undo
86 86
      */
87 87
     final public function iterateOptions()
88 88
     {
89
-        foreach($this->options as $option) {
90
-            if(is_array($option)) {
91
-                foreach($option as $multiOption) {
89
+        foreach ($this->options as $option) {
90
+            if (is_array($option)) {
91
+                foreach ($option as $multiOption) {
92 92
                     yield $multiOption;
93 93
                 }
94 94
             } else {
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     final protected function addOptionInternal(eOption $name, string $value) : Option
108 108
     {
109 109
         $informer = $this->getInformer();
110
-        if(! $informer->isKnownOption($this->getType(), $name)) {
110
+        if (!$informer->isKnownOption($this->getType(), $name)) {
111 111
             $version = $this->getConfiguration()->getVersion();
112 112
             throw new WrongContextException(
113 113
                 "For sphinx v. {$version} option {$name}  in {$this->getType()} isn't available"
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 
118 118
         $option = new Option($this, $name, $value, $isMultiValue);
119 119
 
120
-        if($option->isMultiValue()) {
121
-            if(!array_key_exists( (string) $option->getName(), $this->options)) {
120
+        if ($option->isMultiValue()) {
121
+            if (!array_key_exists((string) $option->getName(), $this->options)) {
122 122
                 $this->options[(string) $option->getName()] = [];
123 123
             }
124 124
             $this->options[(string) $option->getName()][] = $option;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     private function initType()
152 152
     {
153 153
         $section_name = strtolower($this->shortClassName());
154
-        switch($section_name) {
154
+        switch ($section_name) {
155 155
             case eSection::INDEX:
156 156
                 $this->type = eSection::INDEX();
157 157
                 break;
Please login to merge, or discard this patch.
src/LTDBeget/sphinx/configurator/configurationEntities/base/Definition.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
         string $inheritance = null
36 36
     )
37 37
     {
38
-        if(empty($name)) {
38
+        if (empty($name)) {
39 39
             throw new LogicException("Name of section {$this->getType()} can't be empty.");
40 40
         }
41 41
 
42
-        if(! is_null($inheritance) && empty($name)) {
42
+        if (!is_null($inheritance) && empty($name)) {
43 43
             throw new LogicException("Inheritance of section {$this->getType()} can't be empty.");
44 44
         }
45 45
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public function __toString() : string
58 58
     {
59 59
         $string = "{$this->getType()} {$this->getName()}";
60
-        if($this->isHasInheritance()) {
60
+        if ($this->isHasInheritance()) {
61 61
             // TODO if object parent get name
62 62
             $string .= " : {$this->getInheritance()}";
63 63
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public function isHasInheritance() : bool
71 71
     {
72
-        return ! is_null($this->inheritance);
72
+        return !is_null($this->inheritance);
73 73
     }
74 74
 
75 75
     /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
      */
80 80
     public function getInheritance() : string
81 81
     {
82
-        if(! $this->isHasInheritance()) {
82
+        if (!$this->isHasInheritance()) {
83 83
             throw new LogicException("Trying to get inheritance for {$this->getType()} which doesn't' have it.");
84 84
         }
85 85
 
Please login to merge, or discard this patch.
src/LTDBeget/sphinx/configurator/parser/SphinxConfigurationParser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $this->extractSection();
67 67
             $this->saveCurrentSection();
68 68
 
69
-        } while (! $this->stream->isEnd());
69
+        } while (!$this->stream->isEnd());
70 70
 
71 71
         return $this;
72 72
     }
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
 
157 157
         $char = $this->stream->currentAscii();
158 158
 
159
-        if($char->isVerticalSpace() || $char->is(AsciiChar::OPENING_BRACE())) {
159
+        if ($char->isVerticalSpace() || $char->is(AsciiChar::OPENING_BRACE())) {
160 160
             return;
161 161
         }
162 162
 
163
-        if($char->is(AsciiChar::COLON())) {
163
+        if ($char->is(AsciiChar::COLON())) {
164 164
             $this->stream->next();
165 165
             $this->extractInheritanceName();
166 166
         } else {
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             goto start;
185 185
         } elseif ($char->isWhiteSpace()) {
186 186
             return;
187
-        }  else {
187
+        } else {
188 188
             throw new SyntaxErrorException($this->stream);
189 189
         }
190 190
     }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         $char = $this->stream->currentAscii();
258 258
         $this->stream->next();
259 259
 
260
-        if (! $char->is(AsciiChar::EQUALS())) {
260
+        if (!$char->is(AsciiChar::EQUALS())) {
261 261
             throw new SyntaxErrorException($this->stream);
262 262
         }
263 263
 
Please login to merge, or discard this patch.