@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | private function stripStyleTags() : void |
64 | 64 | { |
65 | - if(!ConvertHelper::isStringHTML($this->subject)) |
|
65 | + if (!ConvertHelper::isStringHTML($this->subject)) |
|
66 | 66 | { |
67 | 67 | return; |
68 | 68 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | private function replaceBrackets(string $subject, string $needle) : string |
78 | 78 | { |
79 | - $replacement = str_replace( |
|
79 | + $replacement = str_replace( |
|
80 | 80 | array('{', '}'), |
81 | 81 | array( |
82 | 82 | self::LITERAL_BRACKET_LEFT_REPLACEMENT, |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param mixed $subject |
47 | 47 | * @param Mailcode_Commands_Command|null $sourceCommand |
48 | 48 | */ |
49 | - public function __construct(string $tokenID, string $matchedText, $subject=null, ?Mailcode_Commands_Command $sourceCommand=null) |
|
49 | + public function __construct(string $tokenID, string $matchedText, $subject = null, ?Mailcode_Commands_Command $sourceCommand = null) |
|
50 | 50 | { |
51 | 51 | $this->tokenID = $tokenID; |
52 | 52 | $this->matchedText = $matchedText; |
@@ -86,11 +86,11 @@ discard block |
||
86 | 86 | return $this->matchedText; |
87 | 87 | } |
88 | 88 | |
89 | - protected function restoreQuotes(string $subject, bool $escaped=true) : string |
|
89 | + protected function restoreQuotes(string $subject, bool $escaped = true) : string |
|
90 | 90 | { |
91 | 91 | $replace = '\"'; |
92 | 92 | |
93 | - if(!$escaped) |
|
93 | + if (!$escaped) |
|
94 | 94 | { |
95 | 95 | $replace = '"'; |
96 | 96 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $total = count($matches[0]); |
79 | 79 | $collection = new Mailcode_Collection(); |
80 | 80 | |
81 | - for($i=0; $i < $total; $i++) |
|
81 | + for ($i = 0; $i < $total; $i++) |
|
82 | 82 | { |
83 | 83 | $match = $this->parseMatch($matches, $i); |
84 | 84 | |
@@ -143,17 +143,17 @@ discard block |
||
143 | 143 | private function handleNesting(Mailcode_Commands_Command $cmd) : void |
144 | 144 | { |
145 | 145 | // Set the command's parent from the stack, if any is present. |
146 | - if(!empty($this->stack)) |
|
146 | + if (!empty($this->stack)) |
|
147 | 147 | { |
148 | 148 | $cmd->setParent($this->getStackLast()); |
149 | 149 | } |
150 | 150 | |
151 | 151 | // Handle opening and closing commands, adding and removing from the stack. |
152 | - if($cmd instanceof Mailcode_Commands_Command_Type_Opening) |
|
152 | + if ($cmd instanceof Mailcode_Commands_Command_Type_Opening) |
|
153 | 153 | { |
154 | 154 | $this->stack[] = $cmd; |
155 | 155 | } |
156 | - else if($cmd instanceof Mailcode_Commands_Command_Type_Closing) |
|
156 | + else if ($cmd instanceof Mailcode_Commands_Command_Type_Closing) |
|
157 | 157 | { |
158 | 158 | array_pop($this->stack); |
159 | 159 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | { |
168 | 168 | $cmd = $this->stack[array_key_last($this->stack)]; |
169 | 169 | |
170 | - if($cmd instanceof Mailcode_Commands_Command) |
|
170 | + if ($cmd instanceof Mailcode_Commands_Command) |
|
171 | 171 | { |
172 | 172 | return $cmd; |
173 | 173 | } |
@@ -196,16 +196,16 @@ discard block |
||
196 | 196 | // 5 = parameter type command, type |
197 | 197 | // 6 = parameter type command, params |
198 | 198 | |
199 | - if(!empty($matches[1][$index])) |
|
199 | + if (!empty($matches[1][$index])) |
|
200 | 200 | { |
201 | 201 | $name = $matches[1][$index]; |
202 | 202 | } |
203 | - else if(!empty($matches[2][$index])) |
|
203 | + else if (!empty($matches[2][$index])) |
|
204 | 204 | { |
205 | 205 | $name = $matches[2][$index]; |
206 | 206 | $params = $matches[3][$index]; |
207 | 207 | } |
208 | - else if(!empty($matches[4][$index])) |
|
208 | + else if (!empty($matches[4][$index])) |
|
209 | 209 | { |
210 | 210 | $name = $matches[4][$index]; |
211 | 211 | $type = $matches[5][$index]; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | * @param Mailcode_Commands_Command|null $sourceCommand |
243 | 243 | * @return Mailcode_Parser_Statement |
244 | 244 | */ |
245 | - public function createStatement(string $statement, bool $freeform=false, ?Mailcode_Commands_Command $sourceCommand=null) : Mailcode_Parser_Statement |
|
245 | + public function createStatement(string $statement, bool $freeform = false, ?Mailcode_Commands_Command $sourceCommand = null) : Mailcode_Parser_Statement |
|
246 | 246 | { |
247 | 247 | return new Mailcode_Parser_Statement($statement, $freeform, $sourceCommand); |
248 | 248 | } |