Passed
Push — master ( caf38d...9bab94 )
by Sebastian
02:11
created
src/Mailcode/Parser/Safeguard.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     */
109 109
     public function setDelimiter(string $delimiter) : Mailcode_Parser_Safeguard
110 110
     {
111
-        if(empty($delimiter))
111
+        if (empty($delimiter))
112 112
         {
113 113
             throw new Mailcode_Exception(
114 114
                 'Empty delimiter',
@@ -145,17 +145,17 @@  discard block
 block discarded – undo
145 145
         return str_replace(array_values($replaces), array_keys($replaces), $this->originalString);
146 146
     }
147 147
     
148
-    protected function getReplaces(bool $highlighted=false) : array
148
+    protected function getReplaces(bool $highlighted = false) : array
149 149
     {
150 150
         $placeholders = $this->getPlaceholders();
151 151
         
152 152
         $replaces = array();
153 153
         
154
-        foreach($placeholders as $placeholder)
154
+        foreach ($placeholders as $placeholder)
155 155
         {
156 156
             $replace = '';
157 157
             
158
-            if($highlighted)
158
+            if ($highlighted)
159 159
             {
160 160
                 $replace = $placeholder->getHighlightedText();
161 161
             }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     */
180 180
     public function getPlaceholders()
181 181
     {
182
-        if(isset($this->placeholders))
182
+        if (isset($this->placeholders))
183 183
         {
184 184
             return $this->placeholders;
185 185
         }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         
189 189
         $cmds = $this->getCollection()->getCommands();
190 190
         
191
-        foreach($cmds as $command)
191
+        foreach ($cmds as $command)
192 192
         {
193 193
             self::$counter++;
194 194
             
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         return $this->placeholders;
203 203
     }
204 204
     
205
-    protected function restore(string $string, bool $highlighted=false) : string
205
+    protected function restore(string $string, bool $highlighted = false) : string
206 206
     {
207 207
         $this->requireValidCollection();
208 208
         
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
         
211 211
         $placeholderStrings = array_keys($replaces);
212 212
         
213
-        foreach($placeholderStrings as $search)
213
+        foreach ($placeholderStrings as $search)
214 214
         {
215
-            if(!strstr($string, $search))
215
+            if (!strstr($string, $search))
216 216
             {
217 217
                 throw new Mailcode_Exception(
218 218
                     'Command placeholder not found',
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     */
271 271
     public function getCollection() : Mailcode_Collection
272 272
     {
273
-        if(isset($this->collection))
273
+        if (isset($this->collection))
274 274
         {
275 275
             return $this->collection;
276 276
         }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
     */
293 293
     protected function requireValidCollection() : void
294 294
     {
295
-        if($this->getCollection()->isValid())
295
+        if ($this->getCollection()->isValid())
296 296
         {
297 297
             return;
298 298
         }
Please login to merge, or discard this patch.