Test Failed
Push — master ( 9ff364...742ef2 )
by Sebastian
03:58
created
src/Mailcode/Parser/Statement.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -26,24 +26,24 @@  discard block
 block discarded – undo
26 26
     public const VALIDATION_EMPTY = 48801;
27 27
     public const VALIDATION_UNQUOTED_STRING_LITERALS = 48802;
28 28
     
29
-   /**
30
-    * @var string
31
-    */
29
+    /**
30
+     * @var string
31
+     */
32 32
     protected string $statement;
33 33
     
34
-   /**
35
-    * @var OperationResult
36
-    */
34
+    /**
35
+     * @var OperationResult
36
+     */
37 37
     protected OperationResult $result;
38 38
     
39
-   /**
40
-    * @var Mailcode_Parser_Statement_Tokenizer
41
-    */
39
+    /**
40
+     * @var Mailcode_Parser_Statement_Tokenizer
41
+     */
42 42
     protected Mailcode_Parser_Statement_Tokenizer $tokenizer;
43 43
     
44
-   /**
45
-    * @var Mailcode_Parser_Statement_Info|NULL
46
-    */
44
+    /**
45
+     * @var Mailcode_Parser_Statement_Info|NULL
46
+     */
47 47
     protected ?Mailcode_Parser_Statement_Info $info = null;
48 48
 
49 49
     /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         if($unknown)
139 139
         {
140 140
             $this->result->makeError(
141
-               t('Unquoted string literal found:').' ('.htmlspecialchars($unknown->getMatchedText()).')',
141
+                t('Unquoted string literal found:').' ('.htmlspecialchars($unknown->getMatchedText()).')',
142 142
                 self::VALIDATION_UNQUOTED_STRING_LITERALS
143 143
             );
144 144
         }
Please login to merge, or discard this patch.
src/Mailcode/Parser/Safeguard.php 1 patch
Indentation   +146 added lines, -146 removed lines patch added patch discarded remove patch
@@ -54,40 +54,40 @@  discard block
 block discarded – undo
54 54
     public const ERROR_NO_PLACEHOLDER_FOR_COMMAND = 47805;
55 55
     public const ERROR_NO_FIRST_PLACEHOLDER = 47806;
56 56
 
57
-   /**
58
-    * @var Mailcode_Parser
59
-    */
57
+    /**
58
+     * @var Mailcode_Parser
59
+     */
60 60
     protected Mailcode_Parser $parser;
61 61
     
62
-   /**
63
-    * @var Mailcode_Collection
64
-    */
62
+    /**
63
+     * @var Mailcode_Collection
64
+     */
65 65
     protected Mailcode_Collection $commands;
66 66
     
67
-   /**
68
-    * @var string
69
-    */
67
+    /**
68
+     * @var string
69
+     */
70 70
     protected string $originalString;
71 71
     
72
-   /**
73
-    * @var Mailcode_Collection
74
-    */
72
+    /**
73
+     * @var Mailcode_Collection
74
+     */
75 75
     protected Mailcode_Collection $collection;
76 76
     
77
-   /**
78
-    * Counter for the placeholders, global for all placeholders.
79
-    * @var integer
80
-    */
77
+    /**
78
+     * Counter for the placeholders, global for all placeholders.
79
+     * @var integer
80
+     */
81 81
     private static int $counter = 0;
82 82
     
83
-   /**
84
-    * @var Mailcode_Parser_Safeguard_PlaceholderCollection|NULL
85
-    */
83
+    /**
84
+     * @var Mailcode_Parser_Safeguard_PlaceholderCollection|NULL
85
+     */
86 86
     protected ?Mailcode_Parser_Safeguard_PlaceholderCollection $placeholders = null;
87 87
     
88
-   /**
89
-    * @var string
90
-    */
88
+    /**
89
+     * @var string
90
+     */
91 91
     protected string $delimiter = '999';
92 92
     
93 93
     public function __construct(Mailcode_Parser $parser, string $subject)
@@ -106,28 +106,28 @@  discard block
 block discarded – undo
106 106
         self::$counter = 0;
107 107
     }
108 108
     
109
-   /**
110
-    * Retrieves the string the safeguard was created for.
111
-    * 
112
-    * @return string
113
-    */
109
+    /**
110
+     * Retrieves the string the safeguard was created for.
111
+     * 
112
+     * @return string
113
+     */
114 114
     public function getOriginalString() : string
115 115
     {
116 116
         return $this->originalString;
117 117
     }
118 118
     
119
-   /**
120
-    * Sets the delimiter character sequence used to prepend
121
-    * and append to the placeholders.
122
-    * 
123
-    * The delimiter's default is "999".
124
-    *
125
-    * Minimum characters: 2
126
-    * Invalid characters: Any characters that get URL encoded
127
-    *
128
-    * @param string $delimiter
129
-    * @return Mailcode_Parser_Safeguard
130
-    */
119
+    /**
120
+     * Sets the delimiter character sequence used to prepend
121
+     * and append to the placeholders.
122
+     * 
123
+     * The delimiter's default is "999".
124
+     *
125
+     * Minimum characters: 2
126
+     * Invalid characters: Any characters that get URL encoded
127
+     *
128
+     * @param string $delimiter
129
+     * @return Mailcode_Parser_Safeguard
130
+     */
131 131
     public function setDelimiter(string $delimiter) : Mailcode_Parser_Safeguard
132 132
     {
133 133
         $validator = new Mailcode_Parser_Safeguard_DelimiterValidator($delimiter);
@@ -143,15 +143,15 @@  discard block
 block discarded – undo
143 143
         return $this->delimiter;
144 144
     }
145 145
     
146
-   /**
147
-    * Retrieves the safe string in which all commands have been replaced
148
-    * by placeholder strings.
149
-    *
150
-    * @return string
151
-    * @throws Mailcode_Exception 
152
-    *
153
-    * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
154
-    */
146
+    /**
147
+     * Retrieves the safe string in which all commands have been replaced
148
+     * by placeholder strings.
149
+     *
150
+     * @return string
151
+     * @throws Mailcode_Exception 
152
+     *
153
+     * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
154
+     */
155 155
     public function makeSafe() : string
156 156
     {
157 157
         $this->requireValidCollection();
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
         return $this->makeSafePartial();
160 160
     }
161 161
     
162
-   /**
163
-    * Like makeSafe(), but allows partial (invalid) commands: use this
164
-    * if the subject string may contain only part of the whole set of
165
-    * commands. 
166
-    * 
167
-    * Example: parsing a text with an opening if statement, without the 
168
-    * matching end statement.
169
-    * 
170
-    * @return string
171
-    */
162
+    /**
163
+     * Like makeSafe(), but allows partial (invalid) commands: use this
164
+     * if the subject string may contain only part of the whole set of
165
+     * commands. 
166
+     * 
167
+     * Example: parsing a text with an opening if statement, without the 
168
+     * matching end statement.
169
+     * 
170
+     * @return string
171
+     */
172 172
     public function makeSafePartial() : string
173 173
     {
174 174
         $placeholders = $this->getPlaceholdersCollection()->getAll();
@@ -218,13 +218,13 @@  discard block
 block discarded – undo
218 218
         $analyzer->analyze();
219 219
     }
220 220
     
221
-   /**
222
-    * Creates a formatting handler, which can be used to specify
223
-    * which formatting to use for the commands in the subject string.
224
-    * 
225
-    * @param Mailcode_StringContainer|string $subject
226
-    * @return Mailcode_Parser_Safeguard_Formatting
227
-    */
221
+    /**
222
+     * Creates a formatting handler, which can be used to specify
223
+     * which formatting to use for the commands in the subject string.
224
+     * 
225
+     * @param Mailcode_StringContainer|string $subject
226
+     * @return Mailcode_Parser_Safeguard_Formatting
227
+     */
228 228
     public function createFormatting($subject) : Mailcode_Parser_Safeguard_Formatting
229 229
     {
230 230
         if(is_string($subject))
@@ -249,11 +249,11 @@  discard block
 block discarded – undo
249 249
     }
250 250
 
251 251
     /**
252
-    * Retrieves all placeholders that have to be added to
253
-    * the subject text.
254
-    * 
255
-    * @return Mailcode_Parser_Safeguard_PlaceholderCollection
256
-    */
252
+     * Retrieves all placeholders that have to be added to
253
+     * the subject text.
254
+     * 
255
+     * @return Mailcode_Parser_Safeguard_PlaceholderCollection
256
+     */
257 257
     public function getPlaceholdersCollection() : Mailcode_Parser_Safeguard_PlaceholderCollection
258 258
     {
259 259
         if(isset($this->placeholders))
@@ -313,16 +313,16 @@  discard block
 block discarded – undo
313 313
         return $formatting->toString();
314 314
     }
315 315
 
316
-   /**
317
-    * Makes the string whole again after transforming or filtering it,
318
-    * by replacing the command placeholders with the original commands.
319
-    *
320
-    * @param string $string
321
-    * @return string
322
-    * @throws Mailcode_Exception
323
-    *
324
-    * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
325
-    */
316
+    /**
317
+     * Makes the string whole again after transforming or filtering it,
318
+     * by replacing the command placeholders with the original commands.
319
+     *
320
+     * @param string $string
321
+     * @return string
322
+     * @throws Mailcode_Exception
323
+     *
324
+     * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
325
+     */
326 326
     public function makeWhole(string $string) : string
327 327
     {
328 328
         return $this->restore(
@@ -332,15 +332,15 @@  discard block
 block discarded – undo
332 332
         );
333 333
     }
334 334
     
335
-   /**
336
-    * Like `makeWhole()`, but ignores missing command placeholders.
337
-    *
338
-    * @param string $string
339
-    * @return string
340
-    * @throws Mailcode_Exception
341
-    *
342
-    * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
343
-    */
335
+    /**
336
+     * Like `makeWhole()`, but ignores missing command placeholders.
337
+     *
338
+     * @param string $string
339
+     * @return string
340
+     * @throws Mailcode_Exception
341
+     *
342
+     * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
343
+     */
344 344
     public function makeWholePartial(string $string) : string
345 345
     {
346 346
         return $this->restore(
@@ -350,19 +350,19 @@  discard block
 block discarded – undo
350 350
         );
351 351
     }
352 352
 
353
-   /**
354
-    * Like `makeWhole()`, but replaces the commands with a syntax
355
-    * highlighted version, meant for human readable texts only.
356
-    * 
357
-    * Note: the commands lose their functionality (They cannot be 
358
-    * parsed from that string again).
359
-    *
360
-    * @param string $string
361
-    * @return string
362
-    * @throws Mailcode_Exception
363
-    *
364
-    * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
365
-    */
353
+    /**
354
+     * Like `makeWhole()`, but replaces the commands with a syntax
355
+     * highlighted version, meant for human readable texts only.
356
+     * 
357
+     * Note: the commands lose their functionality (They cannot be 
358
+     * parsed from that string again).
359
+     *
360
+     * @param string $string
361
+     * @return string
362
+     * @throws Mailcode_Exception
363
+     *
364
+     * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
365
+     */
366 366
     public function makeHighlighted(string $string) : string
367 367
     {
368 368
         return $this->restore(
@@ -372,15 +372,15 @@  discard block
 block discarded – undo
372 372
         );
373 373
     }
374 374
     
375
-   /**
376
-    * Like `makeHighlighted()`, but ignores missing command placeholders.
377
-    * 
378
-    * @param string $string
379
-    * @return string
380
-    * @throws Mailcode_Exception
381
-    *
382
-    * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
383
-    */
375
+    /**
376
+     * Like `makeHighlighted()`, but ignores missing command placeholders.
377
+     * 
378
+     * @param string $string
379
+     * @return string
380
+     * @throws Mailcode_Exception
381
+     *
382
+     * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
383
+     */
384 384
     public function makeHighlightedPartial(string $string) : string
385 385
     {
386 386
         return $this->restore(
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
         );
391 391
     }
392 392
     
393
-   /**
394
-    * Retrieves the command collection contained in the string.
395
-    * 
396
-    * @return Mailcode_Collection
397
-    */
393
+    /**
394
+     * Retrieves the command collection contained in the string.
395
+     * 
396
+     * @return Mailcode_Collection
397
+     */
398 398
     public function getCollection() : Mailcode_Collection
399 399
     {
400 400
         if(isset($this->collection))
@@ -418,11 +418,11 @@  discard block
 block discarded – undo
418 418
         return $this->getCollection()->isValid();
419 419
     }
420 420
     
421
-   /**
422
-    * @throws Mailcode_Exception
423
-    * 
424
-    * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
425
-    */
421
+    /**
422
+     * @throws Mailcode_Exception
423
+     * 
424
+     * @see Mailcode_Parser_Safeguard::ERROR_INVALID_COMMANDS
425
+     */
426 426
     protected function requireValidCollection() : void
427 427
     {
428 428
         if($this->getCollection()->isValid())
@@ -445,13 +445,13 @@  discard block
 block discarded – undo
445 445
         throw $exception;
446 446
     }
447 447
     
448
-   /**
449
-    * Retrieves a list of all placeholder IDs used in the text.
450
-    * 
451
-    * @return string[]
452
-    *
453
-    * @deprecated Use the placeholder collection instead {@see Mailcode_Parser_Safeguard::getPlaceholdersCollection()}.
454
-    */
448
+    /**
449
+     * Retrieves a list of all placeholder IDs used in the text.
450
+     * 
451
+     * @return string[]
452
+     *
453
+     * @deprecated Use the placeholder collection instead {@see Mailcode_Parser_Safeguard::getPlaceholdersCollection()}.
454
+     */
455 455
     public function getPlaceholderStrings() : array
456 456
     {
457 457
         return $this->getPlaceholdersCollection()->getStrings();
@@ -462,29 +462,29 @@  discard block
 block discarded – undo
462 462
         return $this->getPlaceholdersCollection()->isStringPlaceholder($subject);
463 463
     }
464 464
     
465
-   /**
466
-    * Retrieves a placeholder instance by its ID.
467
-    * 
468
-    * @param int $id
469
-    * @throws Mailcode_Exception If the placeholder was not found.
470
-    * @return Mailcode_Parser_Safeguard_Placeholder
471
-    *
472
-    * @deprecated Use the placeholder collection instead {@see Mailcode_Parser_Safeguard::getPlaceholdersCollection()}.
473
-    */
465
+    /**
466
+     * Retrieves a placeholder instance by its ID.
467
+     * 
468
+     * @param int $id
469
+     * @throws Mailcode_Exception If the placeholder was not found.
470
+     * @return Mailcode_Parser_Safeguard_Placeholder
471
+     *
472
+     * @deprecated Use the placeholder collection instead {@see Mailcode_Parser_Safeguard::getPlaceholdersCollection()}.
473
+     */
474 474
     public function getPlaceholderByID(int $id) : Mailcode_Parser_Safeguard_Placeholder
475 475
     {
476 476
         return $this->getPlaceholdersCollection()->getByID($id);
477 477
     }
478 478
     
479
-   /**
480
-    * Retrieves a placeholder instance by its replacement text.
481
-    * 
482
-    * @param string $string
483
-    * @throws Mailcode_Exception
484
-    * @return Mailcode_Parser_Safeguard_Placeholder
485
-    *
486
-    * @deprecated Use the placeholder collection instead {@see Mailcode_Parser_Safeguard::getPlaceholdersCollection()}.
487
-    */
479
+    /**
480
+     * Retrieves a placeholder instance by its replacement text.
481
+     * 
482
+     * @param string $string
483
+     * @throws Mailcode_Exception
484
+     * @return Mailcode_Parser_Safeguard_Placeholder
485
+     *
486
+     * @deprecated Use the placeholder collection instead {@see Mailcode_Parser_Safeguard::getPlaceholdersCollection()}.
487
+     */
488 488
     public function getPlaceholderByString(string $string) : Mailcode_Parser_Safeguard_Placeholder
489 489
     {
490 490
         return $this->getPlaceholdersCollection()->getByString($string);
Please login to merge, or discard this patch.
src/Mailcode/Parser/Safeguard/Formatter/Location.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -24,34 +24,34 @@  discard block
 block discarded – undo
24 24
 {
25 25
     public const ERROR_PLACEHOLDER_NOT_FOUND = 66001;
26 26
     
27
-   /**
28
-    * @var Mailcode_Parser_Safeguard_Formatter
29
-    */
27
+    /**
28
+     * @var Mailcode_Parser_Safeguard_Formatter
29
+     */
30 30
     protected $formatter;
31 31
     
32
-   /**
33
-    * @var string
34
-    */
32
+    /**
33
+     * @var string
34
+     */
35 35
     protected $append = '';
36 36
 
37
-   /**
38
-    * @var string
39
-    */
37
+    /**
38
+     * @var string
39
+     */
40 40
     protected $prepend = '';
41 41
     
42
-   /**
43
-    * @var Mailcode_Parser_Safeguard_Placeholder
44
-    */
42
+    /**
43
+     * @var Mailcode_Parser_Safeguard_Placeholder
44
+     */
45 45
     protected $placeholder;
46 46
     
47
-   /**
48
-    * @var Mailcode_StringContainer
49
-    */
47
+    /**
48
+     * @var Mailcode_StringContainer
49
+     */
50 50
     protected $subject;
51 51
     
52
-   /**
53
-    * @var string[]
54
-    */
52
+    /**
53
+     * @var string[]
54
+     */
55 55
     protected $log = array();
56 56
     
57 57
     public function __construct(Mailcode_Parser_Safeguard_Formatter $formatter, Mailcode_Parser_Safeguard_Placeholder $placeholder)
@@ -67,22 +67,22 @@  discard block
 block discarded – undo
67 67
     
68 68
     abstract public function requiresAdjustment() : bool;
69 69
     
70
-   /**
71
-    * @return int|boolean
72
-    */
70
+    /**
71
+     * @return int|boolean
72
+     */
73 73
     public function getStartPosition()
74 74
     {
75 75
         return $this->subject->getSubstrPosition($this->placeholder->getReplacementText());
76 76
     }
77 77
     
78
-   /**
79
-    * Checks whether the specified position within the string
80
-    * is within another command's placeholder (excluding this
81
-    * location's placeholder).
82
-    * 
83
-    * @param int $position
84
-    * @return bool
85
-    */
78
+    /**
79
+     * Checks whether the specified position within the string
80
+     * is within another command's placeholder (excluding this
81
+     * location's placeholder).
82
+     * 
83
+     * @param int $position
84
+     * @return bool
85
+     */
86 86
     public function isWithinCommand(int $position) : bool
87 87
     {
88 88
         $placeholders = $this->formatter->getSafeguard()->getPlaceholdersCollection()->getAll();
@@ -114,9 +114,9 @@  discard block
 block discarded – undo
114 114
         return false;
115 115
     }
116 116
     
117
-   /**
118
-    * @return int|boolean
119
-    */
117
+    /**
118
+     * @return int|boolean
119
+     */
120 120
     public function getEndPosition()
121 121
     {
122 122
         $start = $this->getStartPosition();
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
         return $this->placeholder;
140 140
     }
141 141
     
142
-   /**
143
-    * Replaces the placeholder with the specified replacement text.
144
-    * 
145
-    * @param string $replacementText
146
-    * @throws Mailcode_Exception
147
-    * 
148
-    * @see Mailcode_Parser_Safeguard_Formatter_Location::ERROR_PLACEHOLDER_NOT_FOUND
149
-    */
142
+    /**
143
+     * Replaces the placeholder with the specified replacement text.
144
+     * 
145
+     * @param string $replacementText
146
+     * @throws Mailcode_Exception
147
+     * 
148
+     * @see Mailcode_Parser_Safeguard_Formatter_Location::ERROR_PLACEHOLDER_NOT_FOUND
149
+     */
150 150
     public function replaceWith(string $replacementText) : void
151 151
     {
152 152
         $needle = $this->placeholder->getReplacementText();
@@ -196,10 +196,10 @@  discard block
 block discarded – undo
196 196
         );
197 197
     }
198 198
     
199
-   /**
200
-    * Retrieves the location's log messages, if any.
201
-    * @return string[]
202
-    */
199
+    /**
200
+     * Retrieves the location's log messages, if any.
201
+     * @return string[]
202
+     */
203 203
     public function getLog() : array
204 204
     {
205 205
         return $this->log;
Please login to merge, or discard this patch.
src/Mailcode/Parser/Safeguard/Formatter.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -27,19 +27,19 @@  discard block
 block discarded – undo
27 27
 {
28 28
     public const ERROR_INVALID_LOCATION_INSTANCE = 65601;
29 29
     
30
-   /**
31
-    * @var Mailcode_Parser_Safeguard_Formatting
32
-    */
30
+    /**
31
+     * @var Mailcode_Parser_Safeguard_Formatting
32
+     */
33 33
     protected $formatting;
34 34
     
35
-   /**
36
-    * @var Mailcode_StringContainer
37
-    */
35
+    /**
36
+     * @var Mailcode_StringContainer
37
+     */
38 38
     protected $subject;
39 39
     
40
-   /**
41
-    * @var string[]
42
-    */
40
+    /**
41
+     * @var string[]
42
+     */
43 43
     protected $log = array();
44 44
     
45 45
     public function __construct(Mailcode_Parser_Safeguard_Formatting $formatting)
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
         );
99 99
     }
100 100
     
101
-   /**
102
-    * Retrieves all formatter-specific placeholder locations 
103
-    * in the subject string.
104
-    * 
105
-    * @return Mailcode_Parser_Safeguard_Formatter_Location[]
106
-    */
101
+    /**
102
+     * Retrieves all formatter-specific placeholder locations 
103
+     * in the subject string.
104
+     * 
105
+     * @return Mailcode_Parser_Safeguard_Formatter_Location[]
106
+     */
107 107
     protected function resolveLocations() : array
108 108
     {
109 109
         $placeholders = $this->formatting->getSafeguard()->getPlaceholdersCollection()->getAll();
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
         return $result;
119 119
     }
120 120
     
121
-   /**
122
-    * Resolves the newline character used in the string.
123
-    * 
124
-    * @param string $subject
125
-    * @return string
126
-    */
121
+    /**
122
+     * Resolves the newline character used in the string.
123
+     * 
124
+     * @param string $subject
125
+     * @return string
126
+     */
127 127
     protected function resolveNewlineChar(string $subject) : string
128 128
     {
129 129
         $eol = ConvertHelper::detectEOLCharacter($subject);
@@ -155,9 +155,9 @@  discard block
 block discarded – undo
155 155
         );
156 156
     }
157 157
  
158
-   /**
159
-    * @return string[]
160
-    */
158
+    /**
159
+     * @return string[]
160
+     */
161 161
     public function getLog() : array
162 162
     {
163 163
         return $this->log;
Please login to merge, or discard this patch.
src/Mailcode/Factory/CommandSets.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@
 block discarded – undo
35 35
      */
36 36
     private ?Mailcode_Factory_CommandSets_Set_Misc $misc = null;
37 37
     
38
-   /**
39
-    * @var Mailcode_Factory_CommandSets_Set_Set|NULL
40
-    */
38
+    /**
39
+     * @var Mailcode_Factory_CommandSets_Set_Set|NULL
40
+     */
41 41
     private ?Mailcode_Factory_CommandSets_Set_Set $set = null;
42 42
     
43
-   /**
44
-    * @var Mailcode_Factory_CommandSets_Set_ElseIf|NULL
45
-    */
43
+    /**
44
+     * @var Mailcode_Factory_CommandSets_Set_ElseIf|NULL
45
+     */
46 46
     private ?Mailcode_Factory_CommandSets_Set_ElseIf $elseIf = null;
47 47
     
48 48
     public function if() : Mailcode_Factory_CommandSets_Set_If
Please login to merge, or discard this patch.
src/Mailcode/Parser.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
         $this->commands = $this->mailcode->getCommands();
43 43
     }
44 44
     
45
-   /**
46
-    * Gets the regex format string used to detect commands.
47
-    * 
48
-    * @return string
49
-    */
45
+    /**
46
+     * Gets the regex format string used to detect commands.
47
+     * 
48
+     * @return string
49
+     */
50 50
     protected static function getRegex() : string
51 51
     {
52 52
         return '/'.implode('|', self::COMMAND_REGEX_PARTS).'/sixU';
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
         throw new Mailcode_Exception('Not a command', '', self::ERROR_NOT_A_COMMAND);
184 184
     }
185 185
     
186
-   /**
187
-    * Parses a single regex match: determines which named group
188
-    * matches, and retrieves the according information.
189
-    * 
190
-    * @param array<int,array<int,string>>$matches The regex results array.
191
-    * @param int $index The matched index.
192
-    * @return Mailcode_Parser_Match
193
-    */
186
+    /**
187
+     * Parses a single regex match: determines which named group
188
+     * matches, and retrieves the according information.
189
+     * 
190
+     * @param array<int,array<int,string>>$matches The regex results array.
191
+     * @param int $index The matched index.
192
+     * @return Mailcode_Parser_Match
193
+     */
194 194
     protected function parseMatch(array $matches, int $index) : Mailcode_Parser_Match
195 195
     {
196 196
         $name = ''; // the command name, e.g. "showvar"
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
         );
229 229
     }
230 230
     
231
-   /**
232
-    * Creates an instance of the safeguard tool, which
233
-    * is used to safeguard commands in a string with placeholders.
234
-    * 
235
-    * @param string $subject The string to use to safeguard commands in.
236
-    * @return Mailcode_Parser_Safeguard
237
-    * @see Mailcode_Parser_Safeguard
238
-    */
231
+    /**
232
+     * Creates an instance of the safeguard tool, which
233
+     * is used to safeguard commands in a string with placeholders.
234
+     * 
235
+     * @param string $subject The string to use to safeguard commands in.
236
+     * @return Mailcode_Parser_Safeguard
237
+     * @see Mailcode_Parser_Safeguard
238
+     */
239 239
     public function createSafeguard(string $subject) : Mailcode_Parser_Safeguard
240 240
     {
241 241
         return new Mailcode_Parser_Safeguard($this, $subject);
Please login to merge, or discard this patch.
src/Mailcode/Translator/Syntax.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
     public const ERROR_UNKNOWN_COMMAND_TYPE = 50401;
25 25
     public const ERROR_INVALID_COMMAND_INSTANCE = 50402;
26 26
     
27
-   /**
28
-    * @var string
29
-    */
27
+    /**
28
+     * @var string
29
+     */
30 30
     protected string $typeID;
31 31
     
32 32
     public function __construct(string $typeID)
@@ -34,22 +34,22 @@  discard block
 block discarded – undo
34 34
         $this->typeID = $typeID;
35 35
     }
36 36
     
37
-   /**
38
-    * Retrieves the syntax' type ID, e.g. "ApacheVelocity".
39
-    * @return string
40
-    */
37
+    /**
38
+     * Retrieves the syntax' type ID, e.g. "ApacheVelocity".
39
+     * @return string
40
+     */
41 41
     public function getTypeID() : string
42 42
     {
43 43
         return $this->typeID;
44 44
     }
45 45
     
46
-   /**
47
-    * Translates a single command to the target syntax.
48
-    * 
49
-    * @param Mailcode_Commands_Command $command
50
-    * @throws Mailcode_Translator_Exception
51
-    * @return string
52
-    */
46
+    /**
47
+     * Translates a single command to the target syntax.
48
+     * 
49
+     * @param Mailcode_Commands_Command $command
50
+     * @throws Mailcode_Translator_Exception
51
+     * @return string
52
+     */
53 53
     public function translateCommand(Mailcode_Commands_Command $command) : string
54 54
     {
55 55
         return $this->createTranslator($command)->translate($command);
Please login to merge, or discard this patch.
src/Mailcode/Factory.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
     public const URL_ENCODING_DECODE = 'decode';
29 29
 
30 30
     /**
31
-    * @var Mailcode_Factory_CommandSets|NULL
32
-    */
31
+     * @var Mailcode_Factory_CommandSets|NULL
32
+     */
33 33
     private static ?Mailcode_Factory_CommandSets $commandSets = null;
34 34
 
35 35
     /**
@@ -83,33 +83,33 @@  discard block
 block discarded – undo
83 83
     }
84 84
 
85 85
     /**
86
-    * Creates a renderer instance, which can be used to easily
87
-    * create and convert commands to strings.
88
-    * 
89
-    * @return Mailcode_Renderer
90
-    */
86
+     * Creates a renderer instance, which can be used to easily
87
+     * create and convert commands to strings.
88
+     * 
89
+     * @return Mailcode_Renderer
90
+     */
91 91
     public static function createRenderer() : Mailcode_Renderer
92 92
     {
93 93
         return new Mailcode_Renderer();
94 94
     }
95 95
     
96
-   /**
97
-    * Creates a printer instance, which works like the renderer,
98
-    * but outputs the generated strings to standard output.
99
-    * 
100
-    * @return Mailcode_Printer
101
-    */
96
+    /**
97
+     * Creates a printer instance, which works like the renderer,
98
+     * but outputs the generated strings to standard output.
99
+     * 
100
+     * @return Mailcode_Printer
101
+     */
102 102
     public static function createPrinter() : Mailcode_Printer
103 103
     {
104 104
         return new Mailcode_Printer();
105 105
     }
106 106
     
107
-   /**
108
-    * Gets/creates the global instance of the date format info
109
-    * class, used to handle date formatting aspects.
110
-    * 
111
-    * @return Mailcode_Date_FormatInfo
112
-    */
107
+    /**
108
+     * Gets/creates the global instance of the date format info
109
+     * class, used to handle date formatting aspects.
110
+     * 
111
+     * @return Mailcode_Date_FormatInfo
112
+     */
113 113
     public static function createDateInfo() : Mailcode_Date_FormatInfo
114 114
     {
115 115
         return Mailcode_Date_FormatInfo::getInstance();
Please login to merge, or discard this patch.
src/Mailcode/Date/FormatInfo.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -31,24 +31,24 @@  discard block
 block discarded – undo
31 31
     public const CHARTYPE_TIME = 'time';
32 32
     public const CHARTYPE_PUNCTUATION = 'punctuation';
33 33
     
34
-   /**
35
-    * @var string
36
-    */
34
+    /**
35
+     * @var string
36
+     */
37 37
     private $defaultFormat = "Y/m/d";
38 38
     
39
-   /**
40
-    * @var Mailcode_Date_FormatInfo_Character[]
41
-    */
39
+    /**
40
+     * @var Mailcode_Date_FormatInfo_Character[]
41
+     */
42 42
     private $formatChars = array();
43 43
     
44
-   /**
45
-    * @var string[]
46
-    */
44
+    /**
45
+     * @var string[]
46
+     */
47 47
     private $allowedChars = array();
48 48
     
49
-   /**
50
-    * @var Mailcode_Date_FormatInfo|NULL
51
-    */
49
+    /**
50
+     * @var Mailcode_Date_FormatInfo|NULL
51
+     */
52 52
     private static $instance;
53 53
     
54 54
     private function __construct()
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
         return self::$instance;
67 67
     }
68 68
 
69
-   /**
70
-    * Initialized the list of allowed date formatting
71
-    * characters. This is done only once per request
72
-    * by storing them statically for performance reasons.
73
-    */
69
+    /**
70
+     * Initialized the list of allowed date formatting
71
+     * characters. This is done only once per request
72
+     * by storing them statically for performance reasons.
73
+     */
74 74
     private function initCharacters() : void
75 75
     {
76 76
         $chars = array(
@@ -115,16 +115,16 @@  discard block
 block discarded – undo
115 115
         $this->defaultFormat = $formatString;
116 116
     }
117 117
     
118
-   /**
119
-    * Validates the date format string, by ensuring that
120
-    * all the characters it is composed of are known.
121
-    *
122
-    * @param string $formatString
123
-    * @return OperationResult
124
-    * 
125
-    * @see Mailcode_Commands_Command_ShowDate::VALIDATION_EMPTY_FORMAT_STRING
126
-    * @see Mailcode_Commands_Command_ShowDate::VALIDATION_INVALID_FORMAT_CHARACTER
127
-    */
118
+    /**
119
+     * Validates the date format string, by ensuring that
120
+     * all the characters it is composed of are known.
121
+     *
122
+     * @param string $formatString
123
+     * @return OperationResult
124
+     * 
125
+     * @see Mailcode_Commands_Command_ShowDate::VALIDATION_EMPTY_FORMAT_STRING
126
+     * @see Mailcode_Commands_Command_ShowDate::VALIDATION_INVALID_FORMAT_CHARACTER
127
+     */
128 128
     public function validateFormat(string $formatString) : OperationResult
129 129
     {
130 130
         $result = new OperationResult($this);
@@ -163,23 +163,23 @@  discard block
 block discarded – undo
163 163
         return $result;
164 164
     }
165 165
     
166
-   /**
167
-    * Retrieves all characters that are allowed to
168
-    * be used in a date format string, with information
169
-    * on each.
170
-    *
171
-    * @return Mailcode_Date_FormatInfo_Character[]
172
-    */
166
+    /**
167
+     * Retrieves all characters that are allowed to
168
+     * be used in a date format string, with information
169
+     * on each.
170
+     *
171
+     * @return Mailcode_Date_FormatInfo_Character[]
172
+     */
173 173
     public function getCharactersList() : array
174 174
     {
175 175
         return $this->formatChars;
176 176
     }
177 177
     
178
-   /**
179
-    * Retrieves the characters list, grouped by type label.
180
-    * 
181
-    * @return array<string,array<int,Mailcode_Date_FormatInfo_Character>>
182
-    */
178
+    /**
179
+     * Retrieves the characters list, grouped by type label.
180
+     * 
181
+     * @return array<string,array<int,Mailcode_Date_FormatInfo_Character>>
182
+     */
183 183
     public function getCharactersGrouped() : array
184 184
     {
185 185
         $grouped = array();
Please login to merge, or discard this patch.