Passed
Push — master ( 5f50d8...f6241d )
by Luca
02:40
created
src/EntityDecoder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
        */
32 32
     public function __construct(string $style = 'HTML')
33 33
     {
34
-        if(in_array($style, ["HTML", "MarkdownV2", "Markdown"]))
34
+        if (in_array($style, ["HTML", "MarkdownV2", "Markdown"]))
35 35
         {
36 36
             $this->style = $style;
37 37
         }
Please login to merge, or discard this patch.
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@  discard block
 block discarded – undo
34 34
         if(in_array($style, ["HTML", "MarkdownV2", "Markdown"]))
35 35
         {
36 36
             $this->style = $style;
37
-        }
38
-        else
37
+        } else
39 38
         {
40 39
             throw new \InvalidArgumentException("Wrong style name");
41 40
         }
@@ -157,24 +156,21 @@  discard block
 block discarded – undo
157 156
             {
158 157
                 //Manage the modifiers
159 158
                 $new_string_split[count($new_string_split) - 1] .= $str_split_unicode[$i]; //Apppend the modifier to the previous char
160
-            }
161
-            else
159
+            } else
162 160
             {
163 161
                 if ($codepoint == "200d")
164 162
                 {
165 163
                     //Manage the Zero Width Joiner
166 164
                     $new_string_split[count($new_string_split) - 1] .= $str_split_unicode[$i]; //Apppend the ZWJ to the previous char
167 165
                     $joiner = true;
168
-                }
169
-                else
166
+                } else
170 167
                 {
171 168
                     if ($joiner)
172 169
                     {
173 170
                         //If previous one was a ZWJ
174 171
                         $new_string_split[count($new_string_split) - 1] .= $str_split_unicode[$i]; //Apppend to the previous char
175 172
                         $joiner = false;
176
-                    }
177
-                    else
173
+                    } else
178 174
                     {
179 175
                         $new_string_split[] = $str_split_unicode[$i]; //New char
180 176
                     }
@@ -203,38 +199,31 @@  discard block
 block discarded – undo
203 199
                     if ($char == $this->getEntityStartString($entity))
204 200
                     {
205 201
                         return $char."\\".$char.$char;
206
-                    }
207
-                    else
202
+                    } else
208 203
                     {
209 204
                         return $char;
210 205
                     }
211
-                }
212
-                else
206
+                } else
213 207
                 {
214 208
                     return $char;
215 209
                 }
216
-            }
217
-            else
210
+            } else
218 211
             {
219 212
                 if ($char == '*' || $char == '_' || $char == '[' || $char == '`')
220 213
                 {
221 214
                     return "\\".$char;
222
-                }
223
-                else
215
+                } else
224 216
                 {
225 217
                     return $char;
226 218
                 }
227 219
             }
228
-        }
229
-        else if ($this->style == 'HTML')
220
+        } else if ($this->style == 'HTML')
230 221
         {
231 222
             return ($char == '<' ? '&lt;' : ($char == '>' ? '&gt;' : ($char == '&' ? '&amp;' : $char)));
232
-        }
233
-        else if ($this->style == 'MarkdownV2')
223
+        } else if ($this->style == 'MarkdownV2')
234 224
         {
235 225
             return (in_array($char, array('_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!', '\\')) ? '\\'.$char : $char);
236
-        }
237
-        else
226
+        } else
238 227
         {
239 228
             return $char;
240 229
         }
@@ -281,8 +270,7 @@  discard block
 block discarded – undo
281 270
                     break;
282 271
                 }
283 272
             }
284
-        }
285
-        else if ($this->style == 'HTML')
273
+        } else if ($this->style == 'HTML')
286 274
         {
287 275
             switch ($entity->type)
288 276
             {
@@ -336,8 +324,7 @@  discard block
 block discarded – undo
336 324
                     break;
337 325
                 }
338 326
             }
339
-        }
340
-        else if ($this->style == 'MarkdownV2')
327
+        } else if ($this->style == 'MarkdownV2')
341 328
         {
342 329
             switch ($entity->type)
343 330
             {
@@ -455,8 +442,7 @@  discard block
 block discarded – undo
455 442
                     break;
456 443
                 }
457 444
             }
458
-        }
459
-        else if ($this->style == 'HTML')
445
+        } else if ($this->style == 'HTML')
460 446
         {
461 447
             switch ($entity->type)
462 448
             {
@@ -506,8 +492,7 @@  discard block
 block discarded – undo
506 492
                     break;
507 493
                 }
508 494
             }
509
-        }
510
-        else if ($this->style == 'MarkdownV2')
495
+        } else if ($this->style == 'MarkdownV2')
511 496
         {
512 497
             switch ($entity->type)
513 498
             {
Please login to merge, or discard this patch.