@@ -97,13 +97,13 @@ |
||
| 97 | 97 | /** |
| 98 | 98 | * @var Option $multiOption |
| 99 | 99 | */ |
| 100 | - if(! $multiOption->isDeleted()) { |
|
| 100 | + if (!$multiOption->isDeleted()) { |
|
| 101 | 101 | yield $multiOption; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | } |
| 105 | 105 | } else { |
| 106 | - if(! $option->isDeleted()) { |
|
| 106 | + if (!$option->isDeleted()) { |
|
| 107 | 107 | yield $option; |
| 108 | 108 | } |
| 109 | 109 | } |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | */ |
| 103 | 103 | private function serializeSection(Section $section) |
| 104 | 104 | { |
| 105 | - if($section->isDeleted()) { |
|
| 105 | + if ($section->isDeleted()) { |
|
| 106 | 106 | return; |
| 107 | 107 | } |
| 108 | 108 | |
@@ -47,11 +47,11 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function getOptionInfo(eSection $section, eOption $optionName) : OptionInfo |
| 49 | 49 | { |
| 50 | - if (! $this->isSectionExist($section)) { |
|
| 50 | + if (!$this->isSectionExist($section)) { |
|
| 51 | 51 | throw new InformerRuntimeException("Sphinx of version {$this->version} does't have section {$section}"); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - if (! $this->isKnownOption($section, $optionName)) { |
|
| 54 | + if (!$this->isKnownOption($section, $optionName)) { |
|
| 55 | 55 | throw new InformerRuntimeException("For sphinx v. {$this->version} option {$optionName} in {$section} isn't available"); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function iterateOptionInfo(eSection $section) |
| 96 | 96 | { |
| 97 | - if (! $this->isSectionExist($section)) { |
|
| 97 | + if (!$this->isSectionExist($section)) { |
|
| 98 | 98 | throw new InformerRuntimeException("Sphinx of version {$this->version} does't have section {$section}"); |
| 99 | 99 | } |
| 100 | 100 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | private function getOptionName(eSection $section, string $optionName) : eOption |
| 116 | 116 | { |
| 117 | - $enumClassName = "LTDBeget\\sphinx\\enums\\options\\e".ucfirst( (string) $section). 'Option'; |
|
| 117 | + $enumClassName = "LTDBeget\\sphinx\\enums\\options\\e" . ucfirst((string) $section) . 'Option'; |
|
| 118 | 118 | /** |
| 119 | 119 | * @var eOption $enumClassName |
| 120 | 120 | */ |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $this->defineName($name); |
| 51 | 51 | |
| 52 | - if (! empty($inheritance)) { |
|
| 52 | + if (!empty($inheritance)) { |
|
| 53 | 53 | $this->defineInheritance($inheritance); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | public function delete() |
| 111 | 111 | { |
| 112 | 112 | foreach ($this->getSelfTypeIterator() as $definition) { |
| 113 | - if($definition->isHasInheritance() && $definition->getInheritance() === $this) { |
|
| 113 | + if ($definition->isHasInheritance() && $definition->getInheritance() === $this) { |
|
| 114 | 114 | $definition->delete(); |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -132,12 +132,12 @@ discard block |
||
| 132 | 132 | throw new SectionException("Name of section {$this->getType()} can't be empty."); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - if(! $this->isValidName($name)) { |
|
| 135 | + if (!$this->isValidName($name)) { |
|
| 136 | 136 | throw new SectionException('Name of definition must contains only A-Za-z and _ symbols'); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | foreach ($this->getSelfTypeIterator() as $definition) { |
| 140 | - if($definition->getName() === $name) { |
|
| 140 | + if ($definition->getName() === $name) { |
|
| 141 | 141 | throw new SectionException("Duplicate name {$name} found in {$this->getType()} section"); |
| 142 | 142 | } |
| 143 | 143 | } |
@@ -155,17 +155,17 @@ discard block |
||
| 155 | 155 | { |
| 156 | 156 | $inheritance = trim($inheritance); |
| 157 | 157 | |
| 158 | - if(! $this->isValidName($inheritance)) { |
|
| 158 | + if (!$this->isValidName($inheritance)) { |
|
| 159 | 159 | throw new SectionException('Inheritance of definition must contains only A-Za-z and _ symbols'); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | foreach ($this->getSelfTypeIterator() as $definition) { |
| 163 | - if($definition->getName() === $inheritance) { |
|
| 163 | + if ($definition->getName() === $inheritance) { |
|
| 164 | 164 | $this->inheritance = $definition; |
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - if (! $this->isHasInheritance()) { |
|
| 168 | + if (!$this->isHasInheritance()) { |
|
| 169 | 169 | throw new SectionException("Inheritance with name {$inheritance} of section {$this->getType()} doesn't exists in configuration"); |
| 170 | 170 | } |
| 171 | 171 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | private function serializeIndexer() |
| 99 | 99 | { |
| 100 | - if ($this->objectConfiguration->isHasIndexer() && ! $this->objectConfiguration->getIndexer()->isDeleted()) { |
|
| 100 | + if ($this->objectConfiguration->isHasIndexer() && !$this->objectConfiguration->getIndexer()->isDeleted()) { |
|
| 101 | 101 | $this->serializeSettings($this->objectConfiguration->getIndexer()); |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | private function serializeSearchhd() |
| 111 | 111 | { |
| 112 | - if ($this->objectConfiguration->isHasSearchd() && ! $this->objectConfiguration->getSearchd()->isDeleted()) { |
|
| 112 | + if ($this->objectConfiguration->isHasSearchd() && !$this->objectConfiguration->getSearchd()->isDeleted()) { |
|
| 113 | 113 | $this->serializeSettings($this->objectConfiguration->getSearchd()); |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | private function serializeCommon() |
| 124 | 124 | { |
| 125 | - if ($this->objectConfiguration->isHasCommon() && ! $this->objectConfiguration->getCommon()->isDeleted()) { |
|
| 125 | + if ($this->objectConfiguration->isHasCommon() && !$this->objectConfiguration->getCommon()->isDeleted()) { |
|
| 126 | 126 | $this->serializeSettings($this->objectConfiguration->getCommon()); |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | public function iterateSource() |
| 175 | 175 | { |
| 176 | 176 | foreach ($this->sources as $source) { |
| 177 | - if (! $source->isDeleted()) { |
|
| 177 | + if (!$source->isDeleted()) { |
|
| 178 | 178 | yield $source; |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | public function iterateIndex() |
| 204 | 204 | { |
| 205 | 205 | foreach ($this->indexes as $index) { |
| 206 | - if (! $index->isDeleted()) { |
|
| 206 | + if (!$index->isDeleted()) { |
|
| 207 | 207 | yield $index; |
| 208 | 208 | } |
| 209 | 209 | } |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | public function getCommon() : Common |
| 250 | 250 | { |
| 251 | 251 | $section = eSection::COMMON(); |
| 252 | - if(! $this->isAllowedSection($section)) { |
|
| 252 | + if (!$this->isAllowedSection($section)) { |
|
| 253 | 253 | throw new ConfigurationException("Sphinx of version {$this->version} does't have section {$section}"); |
| 254 | 254 | } |
| 255 | 255 | |
@@ -160,9 +160,9 @@ |
||
| 160 | 160 | $informer = $section->getConfiguration()->getInformer(); |
| 161 | 161 | $optionName = $this->getOptionName($section, $optionName); |
| 162 | 162 | |
| 163 | - if($informer->isKnownOption($sectionType, $optionName)) { |
|
| 163 | + if ($informer->isKnownOption($sectionType, $optionName)) { |
|
| 164 | 164 | $section->addOption($optionName, $optionValue); |
| 165 | - } elseif($informer->isRemovedOption($sectionType, $optionName)) { |
|
| 165 | + } elseif ($informer->isRemovedOption($sectionType, $optionName)) { |
|
| 166 | 166 | return; |
| 167 | 167 | } else { |
| 168 | 168 | throw new DeserializeException("Unknown option name {$optionName} in section {$section->getType()}"); |