@@ -20,19 +20,19 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class Mailcode_Parser_Statement_Tokenizer_Token implements Mailcode_Parser_Statement_Tokenizer_TypeInterface |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | 26 | protected $tokenID; |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @var string |
|
| 30 | - */ |
|
| 28 | + /** |
|
| 29 | + * @var string |
|
| 30 | + */ |
|
| 31 | 31 | protected $matchedText; |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @var mixed |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * @var mixed |
|
| 35 | + */ |
|
| 36 | 36 | protected $subject; |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -62,20 +62,20 @@ discard block |
||
| 62 | 62 | return $this->sourceCommand; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - /** |
|
| 66 | - * The ID of the type. i.e. the class name ("Keyword", "StringLiteral"). |
|
| 67 | - * @return string |
|
| 68 | - */ |
|
| 65 | + /** |
|
| 66 | + * The ID of the type. i.e. the class name ("Keyword", "StringLiteral"). |
|
| 67 | + * @return string |
|
| 68 | + */ |
|
| 69 | 69 | public function getTypeID() : string |
| 70 | 70 | { |
| 71 | 71 | $parts = explode('_', get_class($this)); |
| 72 | 72 | return array_pop($parts); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Retrieves a unique ID of the token. |
|
| 77 | - * @return string |
|
| 78 | - */ |
|
| 75 | + /** |
|
| 76 | + * Retrieves a unique ID of the token. |
|
| 77 | + * @return string |
|
| 78 | + */ |
|
| 79 | 79 | public function getID() : string |
| 80 | 80 | { |
| 81 | 81 | return $this->tokenID; |
@@ -24,9 +24,9 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | trait Mailcode_Traits_Commands_Validation_Variable |
| 26 | 26 | { |
| 27 | - /** |
|
| 28 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
| 29 | - */ |
|
| 27 | + /** |
|
| 28 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
| 29 | + */ |
|
| 30 | 30 | protected $variableToken; |
| 31 | 31 | |
| 32 | 32 | protected function validateSyntax_variable() : void |
@@ -23,25 +23,25 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | trait Mailcode_Traits_Formatting_HTMLHighlighting |
| 25 | 25 | { |
| 26 | - /** |
|
| 27 | - * Stored this way so we can use isset() instead |
|
| 28 | - * of using in_array, which is some magnitudes slower. |
|
| 29 | - * The boolean value is not used otherwise. |
|
| 30 | - * |
|
| 31 | - * @var array<string,bool> |
|
| 32 | - */ |
|
| 26 | + /** |
|
| 27 | + * Stored this way so we can use isset() instead |
|
| 28 | + * of using in_array, which is some magnitudes slower. |
|
| 29 | + * The boolean value is not used otherwise. |
|
| 30 | + * |
|
| 31 | + * @var array<string,bool> |
|
| 32 | + */ |
|
| 33 | 33 | private $excludeTags = array( |
| 34 | 34 | 'style' => true, // NOTE: style tags are excluded natively on the parser level. |
| 35 | 35 | 'script' => true |
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * Adds an HTML tag name to the list of tags within which |
|
| 40 | - * commands may not be highlighted. |
|
| 41 | - * |
|
| 42 | - * @param string $tagName Case insensitive. |
|
| 43 | - * @return $this |
|
| 44 | - */ |
|
| 38 | + /** |
|
| 39 | + * Adds an HTML tag name to the list of tags within which |
|
| 40 | + * commands may not be highlighted. |
|
| 41 | + * |
|
| 42 | + * @param string $tagName Case insensitive. |
|
| 43 | + * @return $this |
|
| 44 | + */ |
|
| 45 | 45 | public function excludeTag(string $tagName) |
| 46 | 46 | { |
| 47 | 47 | $tagName = strtolower($tagName); |
@@ -51,12 +51,12 @@ discard block |
||
| 51 | 51 | return $this; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * Adds several exluded tag names at once. |
|
| 56 | - * |
|
| 57 | - * @param string[] $tagNames |
|
| 58 | - * @return $this |
|
| 59 | - */ |
|
| 54 | + /** |
|
| 55 | + * Adds several exluded tag names at once. |
|
| 56 | + * |
|
| 57 | + * @param string[] $tagNames |
|
| 58 | + * @return $this |
|
| 59 | + */ |
|
| 60 | 60 | public function excludeTags(array $tagNames) |
| 61 | 61 | { |
| 62 | 62 | foreach($tagNames as $tagName) |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | return $this; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - /** |
|
| 71 | - * Whether the specified tag name is in the exlusion list. |
|
| 72 | - * |
|
| 73 | - * @param string $tagName |
|
| 74 | - * @return bool |
|
| 75 | - */ |
|
| 70 | + /** |
|
| 71 | + * Whether the specified tag name is in the exlusion list. |
|
| 72 | + * |
|
| 73 | + * @param string $tagName |
|
| 74 | + * @return bool |
|
| 75 | + */ |
|
| 76 | 76 | public function isTagExcluded(string $tagName) : bool |
| 77 | 77 | { |
| 78 | 78 | $tagName = strtolower($tagName); |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | trait Mailcode_Traits_Commands_Validation_CaseSensitive |
| 28 | 28 | { |
| 29 | - /** |
|
| 30 | - * @var boolean |
|
| 31 | - */ |
|
| 29 | + /** |
|
| 30 | + * @var boolean |
|
| 31 | + */ |
|
| 32 | 32 | protected $caseInsensitive = false; |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
| 36 | - */ |
|
| 34 | + /** |
|
| 35 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
| 36 | + */ |
|
| 37 | 37 | protected $regexToken; |
| 38 | 38 | |
| 39 | 39 | protected function validateSyntax_case_sensitive() : void |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | */ |
| 29 | 29 | class Mailcode_Parser_Statement_Validator |
| 30 | 30 | { |
| 31 | - /** |
|
| 32 | - * @var Mailcode_Parser_Statement |
|
| 33 | - */ |
|
| 31 | + /** |
|
| 32 | + * @var Mailcode_Parser_Statement |
|
| 33 | + */ |
|
| 34 | 34 | private $statement; |
| 35 | 35 | |
| 36 | 36 | public function __construct(Mailcode_Parser_Statement $statement) |
@@ -38,24 +38,24 @@ discard block |
||
| 38 | 38 | $this->statement = $statement; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Creates a variable validator: checks whether a single |
|
| 43 | - * variable token is present in the parameters. |
|
| 44 | - * |
|
| 45 | - * @return Mailcode_Parser_Statement_Validator_Type_Variable |
|
| 46 | - */ |
|
| 41 | + /** |
|
| 42 | + * Creates a variable validator: checks whether a single |
|
| 43 | + * variable token is present in the parameters. |
|
| 44 | + * |
|
| 45 | + * @return Mailcode_Parser_Statement_Validator_Type_Variable |
|
| 46 | + */ |
|
| 47 | 47 | public function createVariable() : Mailcode_Parser_Statement_Validator_Type_Variable |
| 48 | 48 | { |
| 49 | 49 | return new Mailcode_Parser_Statement_Validator_Type_Variable($this->statement); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - /** |
|
| 53 | - * Creates a keyword validator: checks whether a single |
|
| 54 | - * keyword token is present in the parameters. |
|
| 55 | - * |
|
| 56 | - * @param string $keywordName |
|
| 57 | - * @return Mailcode_Parser_Statement_Validator_Type_Keyword |
|
| 58 | - */ |
|
| 52 | + /** |
|
| 53 | + * Creates a keyword validator: checks whether a single |
|
| 54 | + * keyword token is present in the parameters. |
|
| 55 | + * |
|
| 56 | + * @param string $keywordName |
|
| 57 | + * @return Mailcode_Parser_Statement_Validator_Type_Keyword |
|
| 58 | + */ |
|
| 59 | 59 | public function createKeyword(string $keywordName) : Mailcode_Parser_Statement_Validator_Type_Keyword |
| 60 | 60 | { |
| 61 | 61 | return new Mailcode_Parser_Statement_Validator_Type_Keyword( |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | trait Mailcode_Traits_Commands_Validation_Multiline |
| 28 | 28 | { |
| 29 | - /** |
|
| 30 | - * @var boolean |
|
| 31 | - */ |
|
| 29 | + /** |
|
| 30 | + * @var boolean |
|
| 31 | + */ |
|
| 32 | 32 | protected $multiline = false; |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
| 36 | - */ |
|
| 34 | + /** |
|
| 35 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
| 36 | + */ |
|
| 37 | 37 | protected $multilineToken; |
| 38 | 38 | |
| 39 | 39 | protected function validateSyntax_multiline() : void |
@@ -20,9 +20,9 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class Mailcode_Factory_CommandSets_Set |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @var Mailcode_Factory_Instantiator |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * @var Mailcode_Factory_Instantiator |
|
| 25 | + */ |
|
| 26 | 26 | protected $instantiator; |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -20,15 +20,15 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | class Mailcode_Commands_Command_ShowDate extends Mailcode_Commands_ShowBase |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * The date format string. |
|
| 25 | - * @var string |
|
| 26 | - */ |
|
| 23 | + /** |
|
| 24 | + * The date format string. |
|
| 25 | + * @var string |
|
| 26 | + */ |
|
| 27 | 27 | private $formatString; |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * @var Mailcode_Date_FormatInfo |
|
| 31 | - */ |
|
| 29 | + /** |
|
| 30 | + * @var Mailcode_Date_FormatInfo |
|
| 31 | + */ |
|
| 32 | 32 | private $formatInfo; |
| 33 | 33 | |
| 34 | 34 | public function getName() : string |
@@ -88,11 +88,11 @@ discard block |
||
| 88 | 88 | ); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - /** |
|
| 92 | - * Retrieves the format string used to format the date. |
|
| 93 | - * |
|
| 94 | - * @return string A PHP compatible date format string. |
|
| 95 | - */ |
|
| 91 | + /** |
|
| 92 | + * Retrieves the format string used to format the date. |
|
| 93 | + * |
|
| 94 | + * @return string A PHP compatible date format string. |
|
| 95 | + */ |
|
| 96 | 96 | public function getFormatString() : string |
| 97 | 97 | { |
| 98 | 98 | return $this->formatString; |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | abstract class Mailcode_Translator_Syntax_ApacheVelocity extends Mailcode_Translator_Command |
| 22 | 22 | { |
| 23 | 23 | /** |
| 24 | - * @var string[] |
|
| 25 | - */ |
|
| 24 | + * @var string[] |
|
| 25 | + */ |
|
| 26 | 26 | private $regexSpecialChars = array( |
| 27 | 27 | '?', |
| 28 | 28 | '.', |
@@ -47,15 +47,15 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | - * Filters the string for use in an Apache Velocity (Java) |
|
| 51 | - * regex string: escapes all special characters. |
|
| 52 | - * |
|
| 53 | - * Velocity does its own escaping, so no need to escape special |
|
| 54 | - * characters as if they were a javascript string. |
|
| 55 | - * |
|
| 56 | - * @param string $string |
|
| 57 | - * @return string |
|
| 58 | - */ |
|
| 50 | + * Filters the string for use in an Apache Velocity (Java) |
|
| 51 | + * regex string: escapes all special characters. |
|
| 52 | + * |
|
| 53 | + * Velocity does its own escaping, so no need to escape special |
|
| 54 | + * characters as if they were a javascript string. |
|
| 55 | + * |
|
| 56 | + * @param string $string |
|
| 57 | + * @return string |
|
| 58 | + */ |
|
| 59 | 59 | public function filterRegexString(string $string) : string |
| 60 | 60 | { |
| 61 | 61 | // Special case: previously escaped quotes. |