Passed
Push — master ( 13736a...b75b16 )
by Sebastian
02:19
created
src/Mailcode/Parser.php 1 patch
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
         '{\s*([a-z]+)\s+([a-z]+)\s*:([^}]*)}'
29 29
     );
30 30
     
31
-   /**
32
-    * @var Mailcode
33
-    */
31
+    /**
32
+     * @var Mailcode
33
+     */
34 34
     protected $mailcode;
35 35
     
36
-   /**
37
-    * @var Mailcode_Commands
38
-    */
36
+    /**
37
+     * @var Mailcode_Commands
38
+     */
39 39
     protected $commands;
40 40
     
41 41
     public function __construct(Mailcode $mailcode)
@@ -44,24 +44,24 @@  discard block
 block discarded – undo
44 44
         $this->commands = $this->mailcode->getCommands();
45 45
     }
46 46
     
47
-   /**
48
-    * Gets the regex format string used to detect commands.
49
-    * 
50
-    * @return string
51
-    */
47
+    /**
48
+     * Gets the regex format string used to detect commands.
49
+     * 
50
+     * @return string
51
+     */
52 52
     protected static function getRegex() : string
53 53
     {
54 54
         return '/'.implode('|', self::COMMAND_REGEX_PARTS).'/sixU';
55 55
     }
56 56
     
57
-   /**
58
-    * Parses a string to detect all commands within. Returns a
59
-    * collection instance that contains information on all the 
60
-    * commands.
61
-    * 
62
-    * @param string $string
63
-    * @return Mailcode_Collection A collection with all unique commands found.
64
-    */
57
+    /**
58
+     * Parses a string to detect all commands within. Returns a
59
+     * collection instance that contains information on all the 
60
+     * commands.
61
+     * 
62
+     * @param string $string
63
+     * @return Mailcode_Collection A collection with all unique commands found.
64
+     */
65 65
     public function parseString(string $string) : Mailcode_Collection
66 66
     {
67 67
         $collection = new Mailcode_Collection();
@@ -94,14 +94,14 @@  discard block
 block discarded – undo
94 94
         return preg_replace('%<style\b[^>]*>(.*?)</style>%six', '', $subject);
95 95
     }
96 96
     
97
-   /**
98
-    * Processes a single match found in the string: creates the command,
99
-    * and adds it to the collection if it's a valid command, or to the list
100
-    * of invalid commands otherwise.
101
-    * 
102
-    * @param Mailcode_Parser_Match $match
103
-    * @param Mailcode_Collection $collection
104
-    */
97
+    /**
98
+     * Processes a single match found in the string: creates the command,
99
+     * and adds it to the collection if it's a valid command, or to the list
100
+     * of invalid commands otherwise.
101
+     * 
102
+     * @param Mailcode_Parser_Match $match
103
+     * @param Mailcode_Collection $collection
104
+     */
105 105
     protected function processMatch(Mailcode_Parser_Match $match, Mailcode_Collection $collection) : void
106 106
     {
107 107
         $name = $match->getName();
@@ -132,14 +132,14 @@  discard block
 block discarded – undo
132 132
         $collection->addInvalidCommand($cmd);
133 133
     }
134 134
     
135
-   /**
136
-    * Parses a single regex match: determines which named group
137
-    * matches, and retrieves the according information.
138
-    * 
139
-    * @param array[] $matches The regex results array.
140
-    * @param int $index The matched index.
141
-    * @return Mailcode_Parser_Match
142
-    */
135
+    /**
136
+     * Parses a single regex match: determines which named group
137
+     * matches, and retrieves the according information.
138
+     * 
139
+     * @param array[] $matches The regex results array.
140
+     * @param int $index The matched index.
141
+     * @return Mailcode_Parser_Match
142
+     */
143 143
     protected function parseMatch(array $matches, int $index) : Mailcode_Parser_Match
144 144
     {
145 145
         $name = ''; // the command name, e.g. "showvar"
@@ -177,26 +177,26 @@  discard block
 block discarded – undo
177 177
         );
178 178
     }
179 179
     
180
-   /**
181
-    * Creates an instance of the safeguard tool, which
182
-    * is used to safeguard commands in a string with placeholders.
183
-    * 
184
-    * @param string $subject The string to use to safeguard commands in.
185
-    * @return Mailcode_Parser_Safeguard
186
-    * @see Mailcode_Parser_Safeguard
187
-    */
180
+    /**
181
+     * Creates an instance of the safeguard tool, which
182
+     * is used to safeguard commands in a string with placeholders.
183
+     * 
184
+     * @param string $subject The string to use to safeguard commands in.
185
+     * @return Mailcode_Parser_Safeguard
186
+     * @see Mailcode_Parser_Safeguard
187
+     */
188 188
     public function createSafeguard(string $subject) : Mailcode_Parser_Safeguard
189 189
     {
190 190
         return new Mailcode_Parser_Safeguard($this, $subject);
191 191
     }
192 192
     
193
-   /**
194
-    * Creates a statement parser, which is used to validate arbitrary
195
-    * command statements.
196
-    * 
197
-    * @param string $statement
198
-    * @return Mailcode_Parser_Statement
199
-    */
193
+    /**
194
+     * Creates a statement parser, which is used to validate arbitrary
195
+     * command statements.
196
+     * 
197
+     * @param string $statement
198
+     * @return Mailcode_Parser_Statement
199
+     */
200 200
     public function createStatement(string $statement) : Mailcode_Parser_Statement
201 201
     {
202 202
         return new Mailcode_Parser_Statement($statement);
Please login to merge, or discard this patch.