@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | '{\s*([a-z]+)\s+([a-z-]+)\s*:([^}]*)}' |
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @var Mailcode |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * @var Mailcode |
|
| 35 | + */ |
|
| 36 | 36 | protected $mailcode; |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @var Mailcode_Commands |
|
| 40 | - */ |
|
| 38 | + /** |
|
| 39 | + * @var Mailcode_Commands |
|
| 40 | + */ |
|
| 41 | 41 | protected $commands; |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -51,24 +51,24 @@ discard block |
||
| 51 | 51 | $this->commands = $this->mailcode->getCommands(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Gets the regex format string used to detect commands. |
|
| 56 | - * |
|
| 57 | - * @return string |
|
| 58 | - */ |
|
| 54 | + /** |
|
| 55 | + * Gets the regex format string used to detect commands. |
|
| 56 | + * |
|
| 57 | + * @return string |
|
| 58 | + */ |
|
| 59 | 59 | protected static function getRegex() : string |
| 60 | 60 | { |
| 61 | 61 | return '/'.implode('|', self::COMMAND_REGEX_PARTS).'/sixU'; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Parses a string to detect all commands within. Returns a |
|
| 66 | - * collection instance that contains information on all the |
|
| 67 | - * commands. |
|
| 68 | - * |
|
| 69 | - * @param string $string |
|
| 70 | - * @return Mailcode_Collection A collection with all unique commands found. |
|
| 71 | - */ |
|
| 64 | + /** |
|
| 65 | + * Parses a string to detect all commands within. Returns a |
|
| 66 | + * collection instance that contains information on all the |
|
| 67 | + * commands. |
|
| 68 | + * |
|
| 69 | + * @param string $string |
|
| 70 | + * @return Mailcode_Collection A collection with all unique commands found. |
|
| 71 | + */ |
|
| 72 | 72 | public function parseString(string $string) : Mailcode_Collection |
| 73 | 73 | { |
| 74 | 74 | $collection = new Mailcode_Collection(); |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | return str_replace($needle, $replacement, $subject); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | - /** |
|
| 139 | - * Processes a single match found in the string: creates the command, |
|
| 140 | - * and adds it to the collection if it's a valid command, or to the list |
|
| 141 | - * of invalid commands otherwise. |
|
| 142 | - * |
|
| 143 | - * @param Mailcode_Parser_Match $match |
|
| 144 | - * @param Mailcode_Collection $collection |
|
| 145 | - */ |
|
| 138 | + /** |
|
| 139 | + * Processes a single match found in the string: creates the command, |
|
| 140 | + * and adds it to the collection if it's a valid command, or to the list |
|
| 141 | + * of invalid commands otherwise. |
|
| 142 | + * |
|
| 143 | + * @param Mailcode_Parser_Match $match |
|
| 144 | + * @param Mailcode_Collection $collection |
|
| 145 | + */ |
|
| 146 | 146 | protected function processMatch(Mailcode_Parser_Match $match, Mailcode_Collection $collection) : void |
| 147 | 147 | { |
| 148 | 148 | $name = $match->getName(); |
@@ -205,14 +205,14 @@ discard block |
||
| 205 | 205 | throw new Mailcode_Exception('Not a command', '', self::ERROR_NOT_A_COMMAND); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - /** |
|
| 209 | - * Parses a single regex match: determines which named group |
|
| 210 | - * matches, and retrieves the according information. |
|
| 211 | - * |
|
| 212 | - * @param array[] $matches The regex results array. |
|
| 213 | - * @param int $index The matched index. |
|
| 214 | - * @return Mailcode_Parser_Match |
|
| 215 | - */ |
|
| 208 | + /** |
|
| 209 | + * Parses a single regex match: determines which named group |
|
| 210 | + * matches, and retrieves the according information. |
|
| 211 | + * |
|
| 212 | + * @param array[] $matches The regex results array. |
|
| 213 | + * @param int $index The matched index. |
|
| 214 | + * @return Mailcode_Parser_Match |
|
| 215 | + */ |
|
| 216 | 216 | protected function parseMatch(array $matches, int $index) : Mailcode_Parser_Match |
| 217 | 217 | { |
| 218 | 218 | $name = ''; // the command name, e.g. "showvar" |
@@ -250,14 +250,14 @@ discard block |
||
| 250 | 250 | ); |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | - /** |
|
| 254 | - * Creates an instance of the safeguard tool, which |
|
| 255 | - * is used to safeguard commands in a string with placeholders. |
|
| 256 | - * |
|
| 257 | - * @param string $subject The string to use to safeguard commands in. |
|
| 258 | - * @return Mailcode_Parser_Safeguard |
|
| 259 | - * @see Mailcode_Parser_Safeguard |
|
| 260 | - */ |
|
| 253 | + /** |
|
| 254 | + * Creates an instance of the safeguard tool, which |
|
| 255 | + * is used to safeguard commands in a string with placeholders. |
|
| 256 | + * |
|
| 257 | + * @param string $subject The string to use to safeguard commands in. |
|
| 258 | + * @return Mailcode_Parser_Safeguard |
|
| 259 | + * @see Mailcode_Parser_Safeguard |
|
| 260 | + */ |
|
| 261 | 261 | public function createSafeguard(string $subject) : Mailcode_Parser_Safeguard |
| 262 | 262 | { |
| 263 | 263 | return new Mailcode_Parser_Safeguard($this, $subject); |