@@ -24,14 +24,14 @@ |
||
24 | 24 | */ |
25 | 25 | trait Mailcode_Traits_Commands_Validation_CaseSensitive |
26 | 26 | { |
27 | - /** |
|
28 | - * @var boolean |
|
29 | - */ |
|
27 | + /** |
|
28 | + * @var boolean |
|
29 | + */ |
|
30 | 30 | protected $caseInsensitive = false; |
31 | 31 | |
32 | - /** |
|
33 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
34 | - */ |
|
32 | + /** |
|
33 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
34 | + */ |
|
35 | 35 | protected $caseToken; |
36 | 36 | |
37 | 37 | protected function validateSyntax_case_sensitive() : void |
@@ -20,9 +20,9 @@ |
||
20 | 20 | */ |
21 | 21 | class Mailcode_Commands_Command_Comment extends Mailcode_Commands_Command implements Mailcode_Commands_Command_Type_Standalone |
22 | 22 | { |
23 | - /** |
|
24 | - * @var string |
|
25 | - */ |
|
23 | + /** |
|
24 | + * @var string |
|
25 | + */ |
|
26 | 26 | private $commentString = ''; |
27 | 27 | |
28 | 28 | protected function init() : void |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | return $this->getSign(); |
31 | 31 | } |
32 | 32 | |
33 | - /** |
|
34 | - * Retrieves all known comparison operator signs. |
|
35 | - * @return string[] |
|
36 | - */ |
|
33 | + /** |
|
34 | + * Retrieves all known comparison operator signs. |
|
35 | + * @return string[] |
|
36 | + */ |
|
37 | 37 | public static function getComparisonSigns() : array |
38 | 38 | { |
39 | 39 | return array( |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | ); |
47 | 47 | } |
48 | 48 | |
49 | - /** |
|
50 | - * Retrieves all known arithmetic operator signs. |
|
51 | - * @return string[] |
|
52 | - */ |
|
49 | + /** |
|
50 | + * Retrieves all known arithmetic operator signs. |
|
51 | + * @return string[] |
|
52 | + */ |
|
53 | 53 | public static function getArithmeticSigns() : array |
54 | 54 | { |
55 | 55 | return array( |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | ); |
61 | 61 | } |
62 | 62 | |
63 | - /** |
|
64 | - * Whether the operator is comparison related (equals, not equals, smaller, greater...). |
|
65 | - * |
|
66 | - * @return bool |
|
67 | - */ |
|
63 | + /** |
|
64 | + * Whether the operator is comparison related (equals, not equals, smaller, greater...). |
|
65 | + * |
|
66 | + * @return bool |
|
67 | + */ |
|
68 | 68 | public function isComparator() : bool |
69 | 69 | { |
70 | 70 | return |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | $this->isSmallerOrEquals(); |
77 | 77 | } |
78 | 78 | |
79 | - /** |
|
80 | - * Whether the operator is calculation related (minus, plus, divide, multiply). |
|
81 | - * |
|
82 | - * @return bool |
|
83 | - */ |
|
79 | + /** |
|
80 | + * Whether the operator is calculation related (minus, plus, divide, multiply). |
|
81 | + * |
|
82 | + * @return bool |
|
83 | + */ |
|
84 | 84 | public function isCalculator() : bool |
85 | 85 | { |
86 | 86 | return |
@@ -27,19 +27,19 @@ |
||
27 | 27 | const VALIDATION_WRONG_KEYWORD = 49702; |
28 | 28 | const VALIDATION_VARIABLE_NAME_IS_THE_SAME = 49703; |
29 | 29 | |
30 | - /** |
|
31 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
32 | - */ |
|
30 | + /** |
|
31 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
32 | + */ |
|
33 | 33 | private $loopVar; |
34 | 34 | |
35 | - /** |
|
36 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
37 | - */ |
|
35 | + /** |
|
36 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Variable|NULL |
|
37 | + */ |
|
38 | 38 | private $sourceVar; |
39 | 39 | |
40 | - /** |
|
41 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
42 | - */ |
|
40 | + /** |
|
41 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_Keyword|NULL |
|
42 | + */ |
|
43 | 43 | private $keyword; |
44 | 44 | |
45 | 45 | public function getName() : string |
@@ -35,13 +35,13 @@ |
||
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | - /** |
|
39 | - * Resolves the string with which this location needs to be |
|
40 | - * replaced. |
|
41 | - * |
|
42 | - * @param Mailcode_Parser_Safeguard_Formatter_Location $location |
|
43 | - * @return string |
|
44 | - */ |
|
38 | + /** |
|
39 | + * Resolves the string with which this location needs to be |
|
40 | + * replaced. |
|
41 | + * |
|
42 | + * @param Mailcode_Parser_Safeguard_Formatter_Location $location |
|
43 | + * @return string |
|
44 | + */ |
|
45 | 45 | private function resolveReplacement(Mailcode_Parser_Safeguard_Formatter_Location $location) : string |
46 | 46 | { |
47 | 47 | if($location->requiresAdjustment()) |
@@ -23,14 +23,14 @@ |
||
23 | 23 | */ |
24 | 24 | class Mailcode_Parser_Safeguard_Formatter_Type_SingleLines extends Mailcode_Parser_Safeguard_Formatter_FormatType |
25 | 25 | { |
26 | - /** |
|
27 | - * @var string |
|
28 | - */ |
|
26 | + /** |
|
27 | + * @var string |
|
28 | + */ |
|
29 | 29 | private $eol; |
30 | 30 | |
31 | - /** |
|
32 | - * @var int |
|
33 | - */ |
|
31 | + /** |
|
32 | + * @var int |
|
33 | + */ |
|
34 | 34 | private $eolLength; |
35 | 35 | |
36 | 36 | protected function initFormatting() : void |
@@ -25,14 +25,14 @@ |
||
25 | 25 | */ |
26 | 26 | class Mailcode_Parser_Safeguard_Formatter_Type_SingleLines_Location extends Mailcode_Parser_Safeguard_Formatter_Location |
27 | 27 | { |
28 | - /** |
|
29 | - * @var int |
|
30 | - */ |
|
28 | + /** |
|
29 | + * @var int |
|
30 | + */ |
|
31 | 31 | protected $eolLength; |
32 | 32 | |
33 | - /** |
|
34 | - * @var string |
|
35 | - */ |
|
33 | + /** |
|
34 | + * @var string |
|
35 | + */ |
|
36 | 36 | protected $eol; |
37 | 37 | |
38 | 38 | protected function init() : void |
@@ -25,11 +25,11 @@ |
||
25 | 25 | return PHP_INT_MAX; |
26 | 26 | } |
27 | 27 | |
28 | - /** |
|
29 | - * Formats the specified string according to the formatter. |
|
30 | - * Retrieve the updated string from the string container used |
|
31 | - * to create the formatter, or use `getSubjectString()`. |
|
32 | - */ |
|
28 | + /** |
|
29 | + * Formats the specified string according to the formatter. |
|
30 | + * Retrieve the updated string from the string container used |
|
31 | + * to create the formatter, or use `getSubjectString()`. |
|
32 | + */ |
|
33 | 33 | public function format() : void |
34 | 34 | { |
35 | 35 | $locations = $this->resolveLocations(); |
@@ -26,39 +26,39 @@ discard block |
||
26 | 26 | const ERROR_INVALID_CALLABLE = 65701; |
27 | 27 | const ERROR_UPDATE_CALLED_DURING_UPDATE_OPERATION = 65702; |
28 | 28 | |
29 | - /** |
|
30 | - * @var string |
|
31 | - */ |
|
29 | + /** |
|
30 | + * @var string |
|
31 | + */ |
|
32 | 32 | private $subject; |
33 | 33 | |
34 | - /** |
|
35 | - * @var integer |
|
36 | - */ |
|
34 | + /** |
|
35 | + * @var integer |
|
36 | + */ |
|
37 | 37 | private static $listenerCounter = 0; |
38 | 38 | |
39 | - /** |
|
40 | - * @var callable[] |
|
41 | - */ |
|
39 | + /** |
|
40 | + * @var callable[] |
|
41 | + */ |
|
42 | 42 | private $listeners = array(); |
43 | 43 | |
44 | - /** |
|
45 | - * @var boolean |
|
46 | - */ |
|
44 | + /** |
|
45 | + * @var boolean |
|
46 | + */ |
|
47 | 47 | private $updating = false; |
48 | 48 | |
49 | - /** |
|
50 | - * @var integer |
|
51 | - */ |
|
49 | + /** |
|
50 | + * @var integer |
|
51 | + */ |
|
52 | 52 | private static $idCounter = 0; |
53 | 53 | |
54 | - /** |
|
55 | - * @var integer |
|
56 | - */ |
|
54 | + /** |
|
55 | + * @var integer |
|
56 | + */ |
|
57 | 57 | private $id; |
58 | 58 | |
59 | - /** |
|
60 | - * @var integer |
|
61 | - */ |
|
59 | + /** |
|
60 | + * @var integer |
|
61 | + */ |
|
62 | 62 | private $length; |
63 | 63 | |
64 | 64 | public function __construct(string $subject) |
@@ -75,16 +75,16 @@ discard block |
||
75 | 75 | return $this->id; |
76 | 76 | } |
77 | 77 | |
78 | - /** |
|
79 | - * Updates the string with the specified string. |
|
80 | - * Notifies all listeners of the change. |
|
81 | - * |
|
82 | - * @param string $subject |
|
83 | - * @throws Mailcode_Exception |
|
84 | - * @return bool Whether the string had modifications. |
|
85 | - * |
|
86 | - * @see Mailcode_StringContainer::ERROR_UPDATE_CALLED_DURING_UPDATE_OPERATION |
|
87 | - */ |
|
78 | + /** |
|
79 | + * Updates the string with the specified string. |
|
80 | + * Notifies all listeners of the change. |
|
81 | + * |
|
82 | + * @param string $subject |
|
83 | + * @throws Mailcode_Exception |
|
84 | + * @return bool Whether the string had modifications. |
|
85 | + * |
|
86 | + * @see Mailcode_StringContainer::ERROR_UPDATE_CALLED_DURING_UPDATE_OPERATION |
|
87 | + */ |
|
88 | 88 | public function updateString(string $subject) : bool |
89 | 89 | { |
90 | 90 | // avoid triggering an update if there are no changes in the string |
@@ -117,27 +117,27 @@ discard block |
||
117 | 117 | return true; |
118 | 118 | } |
119 | 119 | |
120 | - /** |
|
121 | - * Retrieves the stored string. |
|
122 | - * |
|
123 | - * @return string |
|
124 | - */ |
|
120 | + /** |
|
121 | + * Retrieves the stored string. |
|
122 | + * |
|
123 | + * @return string |
|
124 | + */ |
|
125 | 125 | public function getString() : string |
126 | 126 | { |
127 | 127 | return $this->subject; |
128 | 128 | } |
129 | 129 | |
130 | - /** |
|
131 | - * Adds a listener that will be informed every time the string is modified. |
|
132 | - * The callback gets the string container instance as parameter. |
|
133 | - * |
|
134 | - * @param callable $callback |
|
135 | - * @throws Mailcode_Exception If it is not a valid callable. |
|
136 | - * @return int The listener number, to be able to remove it using `removeListener()`. |
|
137 | - * |
|
138 | - * @see Mailcode_StringContainer::removeListener() |
|
139 | - * @see Mailcode_StringContainer::ERROR_INVALID_CALLABLE |
|
140 | - */ |
|
130 | + /** |
|
131 | + * Adds a listener that will be informed every time the string is modified. |
|
132 | + * The callback gets the string container instance as parameter. |
|
133 | + * |
|
134 | + * @param callable $callback |
|
135 | + * @throws Mailcode_Exception If it is not a valid callable. |
|
136 | + * @return int The listener number, to be able to remove it using `removeListener()`. |
|
137 | + * |
|
138 | + * @see Mailcode_StringContainer::removeListener() |
|
139 | + * @see Mailcode_StringContainer::ERROR_INVALID_CALLABLE |
|
140 | + */ |
|
141 | 141 | public function addListener($callback) : int |
142 | 142 | { |
143 | 143 | self::$listenerCounter++; |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | return $this->length; |
165 | 165 | } |
166 | 166 | |
167 | - /** |
|
168 | - * Removes an existing listener by its ID. |
|
169 | - * Has no effect if it does not exist, or has already been removed. |
|
170 | - * |
|
171 | - * @param int $listenerID |
|
172 | - */ |
|
167 | + /** |
|
168 | + * Removes an existing listener by its ID. |
|
169 | + * Has no effect if it does not exist, or has already been removed. |
|
170 | + * |
|
171 | + * @param int $listenerID |
|
172 | + */ |
|
173 | 173 | public function removeListener(int $listenerID) : void |
174 | 174 | { |
175 | 175 | if(isset($this->listeners[$listenerID])) |
@@ -178,13 +178,13 @@ discard block |
||
178 | 178 | } |
179 | 179 | } |
180 | 180 | |
181 | - /** |
|
182 | - * Replaces all substrings matching needle with the replacement text. |
|
183 | - * |
|
184 | - * @param string $needle |
|
185 | - * @param string $replacement |
|
186 | - * @return bool |
|
187 | - */ |
|
181 | + /** |
|
182 | + * Replaces all substrings matching needle with the replacement text. |
|
183 | + * |
|
184 | + * @param string $needle |
|
185 | + * @param string $replacement |
|
186 | + * @return bool |
|
187 | + */ |
|
188 | 188 | public function replaceSubstrings(string $needle, string $replacement) : bool |
189 | 189 | { |
190 | 190 | $string = str_replace($needle, $replacement, $this->subject); |
@@ -192,12 +192,12 @@ discard block |
||
192 | 192 | return $this->updateString($string); |
193 | 193 | } |
194 | 194 | |
195 | - /** |
|
196 | - * Get the position of a substring in the string. |
|
197 | - * |
|
198 | - * @param string $needle |
|
199 | - * @return int|bool The zero-based position, or false if not found. |
|
200 | - */ |
|
195 | + /** |
|
196 | + * Get the position of a substring in the string. |
|
197 | + * |
|
198 | + * @param string $needle |
|
199 | + * @return int|bool The zero-based position, or false if not found. |
|
200 | + */ |
|
201 | 201 | public function getSubstrPosition(string $needle) |
202 | 202 | { |
203 | 203 | return mb_strpos($this->subject, $needle); |