@@ -30,7 +30,7 @@ |
||
| 30 | 30 | return $this->variables->createVariableByName($fullName); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - public function pathName(string $path, ?string $name=null) : Mailcode_Variables_Variable |
|
| 33 | + public function pathName(string $path, ?string $name = null) : Mailcode_Variables_Variable |
|
| 34 | 34 | { |
| 35 | 35 | return $this->variables->createVariable($path, $name); |
| 36 | 36 | } |
@@ -27,9 +27,9 @@ discard block |
||
| 27 | 27 | private ?Mailcode_Factory_CommandSets_Set_ElseIf $elseIf = null; |
| 28 | 28 | private ?Mailcode_Factory_CommandSets_Set_Variables $variables = null; |
| 29 | 29 | |
| 30 | - public function if() : Mailcode_Factory_CommandSets_Set_If |
|
| 30 | + public function if () : Mailcode_Factory_CommandSets_Set_If |
|
| 31 | 31 | { |
| 32 | - if(!isset($this->if)) |
|
| 32 | + if (!isset($this->if)) |
|
| 33 | 33 | { |
| 34 | 34 | $this->if = new Mailcode_Factory_CommandSets_Set_If(); |
| 35 | 35 | } |
@@ -37,9 +37,9 @@ discard block |
||
| 37 | 37 | return $this->if; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - public function elseIf() : Mailcode_Factory_CommandSets_Set_ElseIf |
|
| 40 | + public function elseIf () : Mailcode_Factory_CommandSets_Set_ElseIf |
|
| 41 | 41 | { |
| 42 | - if(!isset($this->elseIf)) |
|
| 42 | + if (!isset($this->elseIf)) |
|
| 43 | 43 | { |
| 44 | 44 | $this->elseIf = new Mailcode_Factory_CommandSets_Set_ElseIf(); |
| 45 | 45 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | public function show() : Mailcode_Factory_CommandSets_Set_Show |
| 51 | 51 | { |
| 52 | - if(!isset($this->show)) |
|
| 52 | + if (!isset($this->show)) |
|
| 53 | 53 | { |
| 54 | 54 | $this->show = new Mailcode_Factory_CommandSets_Set_Show(); |
| 55 | 55 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function misc() : Mailcode_Factory_CommandSets_Set_Misc |
| 61 | 61 | { |
| 62 | - if(!isset($this->misc)) |
|
| 62 | + if (!isset($this->misc)) |
|
| 63 | 63 | { |
| 64 | 64 | $this->misc = new Mailcode_Factory_CommandSets_Set_Misc(); |
| 65 | 65 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public function set() : Mailcode_Factory_CommandSets_Set_Set |
| 71 | 71 | { |
| 72 | - if(!isset($this->set)) |
|
| 72 | + if (!isset($this->set)) |
|
| 73 | 73 | { |
| 74 | 74 | $this->set = new Mailcode_Factory_CommandSets_Set_Set(); |
| 75 | 75 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | public function var() : Mailcode_Factory_CommandSets_Set_Variables |
| 81 | 81 | { |
| 82 | - if(!isset($this->variables)) |
|
| 82 | + if (!isset($this->variables)) |
|
| 83 | 83 | { |
| 84 | 84 | $this->variables = new Mailcode_Factory_CommandSets_Set_Variables(); |
| 85 | 85 | } |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | $result = array(); |
| 130 | 130 | |
| 131 | - foreach($this->tokensOrdered as $token) |
|
| 131 | + foreach ($this->tokensOrdered as $token) |
|
| 132 | 132 | { |
| 133 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Unknown) |
|
| 133 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Unknown) |
|
| 134 | 134 | { |
| 135 | 135 | $result[] = $token; |
| 136 | 136 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | $unknown = $this->getUnknown(); |
| 145 | 145 | |
| 146 | - if(!empty($unknown)) |
|
| 146 | + if (!empty($unknown)) |
|
| 147 | 147 | { |
| 148 | 148 | return array_shift($unknown); |
| 149 | 149 | } |
@@ -155,16 +155,16 @@ discard block |
||
| 155 | 155 | { |
| 156 | 156 | $parts = array(); |
| 157 | 157 | |
| 158 | - foreach($this->tokensOrdered as $token) |
|
| 158 | + foreach ($this->tokensOrdered as $token) |
|
| 159 | 159 | { |
| 160 | 160 | $string = $token->getNormalized(); |
| 161 | 161 | |
| 162 | - if($string === '') { |
|
| 162 | + if ($string === '') { |
|
| 163 | 163 | continue; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | // Only add spaces between tokens if they require spacing |
| 167 | - if($token->hasSpacing()) { |
|
| 167 | + if ($token->hasSpacing()) { |
|
| 168 | 168 | $string .= ' '; |
| 169 | 169 | } |
| 170 | 170 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $statement = trim($statement); |
| 191 | 191 | $tokens = array(); |
| 192 | 192 | |
| 193 | - foreach($this->tokenClasses as $tokenClass) |
|
| 193 | + foreach ($this->tokenClasses as $tokenClass) |
|
| 194 | 194 | { |
| 195 | 195 | $processor = $this->createProcessor($tokenClass, $statement, $tokens); |
| 196 | 196 | $processor->process(); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | { |
| 215 | 215 | $instance = new $className($this, $statement, $tokens); |
| 216 | 216 | |
| 217 | - if($instance instanceof Mailcode_Parser_Statement_Tokenizer_Process) |
|
| 217 | + if ($instance instanceof Mailcode_Parser_Statement_Tokenizer_Process) |
|
| 218 | 218 | { |
| 219 | 219 | return $instance; |
| 220 | 220 | } |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * @param mixed $subject |
| 236 | 236 | * @return Mailcode_Parser_Statement_Tokenizer_Token |
| 237 | 237 | */ |
| 238 | - public function createToken(string $type, string $matchedText, $subject=null) : Mailcode_Parser_Statement_Tokenizer_Token |
|
| 238 | + public function createToken(string $type, string $matchedText, $subject = null) : Mailcode_Parser_Statement_Tokenizer_Token |
|
| 239 | 239 | { |
| 240 | 240 | $tokenID = $this->generateID(); |
| 241 | 241 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | $token = new $class($tokenID, $matchedText, $subject, $this->getSourceCommand()); |
| 245 | 245 | |
| 246 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token) |
|
| 246 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token) |
|
| 247 | 247 | { |
| 248 | 248 | return $token; |
| 249 | 249 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | |
| 273 | 273 | $token = $this->createToken('Keyword', $name); |
| 274 | 274 | |
| 275 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 275 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 276 | 276 | { |
| 277 | 277 | return $token; |
| 278 | 278 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | { |
| 298 | 298 | $token = $this->createToken('StringLiteral', SpecialChars::encodeAll($text)); |
| 299 | 299 | |
| 300 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
| 300 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
| 301 | 301 | { |
| 302 | 302 | return $token; |
| 303 | 303 | } |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | { |
| 314 | 314 | $token = $this->createToken('Number', $number); |
| 315 | 315 | |
| 316 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number) |
|
| 316 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number) |
|
| 317 | 317 | { |
| 318 | 318 | return $token; |
| 319 | 319 | } |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | public function removeToken(Mailcode_Parser_Statement_Tokenizer_Token $token) : Mailcode_Parser_Statement_Tokenizer |
| 356 | 356 | { |
| 357 | 357 | $name = $this->findNameToken($token); |
| 358 | - if($name !== null) { |
|
| 358 | + if ($name !== null) { |
|
| 359 | 359 | $this->removeToken($name); |
| 360 | 360 | } |
| 361 | 361 | |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | |
| 366 | 366 | foreach ($this->tokensOrdered as $checkToken) |
| 367 | 367 | { |
| 368 | - if($checkToken->getID() === $tokenID) |
|
| 368 | + if ($checkToken->getID() === $tokenID) |
|
| 369 | 369 | { |
| 370 | 370 | $removed = true; |
| 371 | 371 | continue; |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | |
| 377 | 377 | $this->tokensOrdered = $keep; |
| 378 | 378 | |
| 379 | - if($removed) |
|
| 379 | + if ($removed) |
|
| 380 | 380 | { |
| 381 | 381 | $this->eventHandler->handleTokenRemoved($token); |
| 382 | 382 | } |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | { |
| 422 | 422 | static $alphas; |
| 423 | 423 | |
| 424 | - if(!isset($alphas)) |
|
| 424 | + if (!isset($alphas)) |
|
| 425 | 425 | { |
| 426 | 426 | $alphas = range('A', 'Z'); |
| 427 | 427 | } |
@@ -430,12 +430,12 @@ discard block |
||
| 430 | 430 | |
| 431 | 431 | $result = ''; |
| 432 | 432 | |
| 433 | - for($i=0; $i < $amount; $i++) |
|
| 433 | + for ($i = 0; $i < $amount; $i++) |
|
| 434 | 434 | { |
| 435 | 435 | $result .= $alphas[array_rand($alphas)]; |
| 436 | 436 | } |
| 437 | 437 | |
| 438 | - if(!in_array($result, self::$ids)) |
|
| 438 | + if (!in_array($result, self::$ids)) |
|
| 439 | 439 | { |
| 440 | 440 | self::$ids[] = $result; |
| 441 | 441 | return $result; |
@@ -471,12 +471,12 @@ discard block |
||
| 471 | 471 | { |
| 472 | 472 | $targetID = $targetToken->getID(); |
| 473 | 473 | |
| 474 | - foreach($this->tokensOrdered as $idx => $token) |
|
| 474 | + foreach ($this->tokensOrdered as $idx => $token) |
|
| 475 | 475 | { |
| 476 | - if($token->getID() === $targetID) |
|
| 476 | + if ($token->getID() === $targetID) |
|
| 477 | 477 | { |
| 478 | - $prev = $this->tokensOrdered[$idx-1] ?? null; |
|
| 479 | - if($prev instanceof Mailcode_Parser_Statement_Tokenizer_Token_ParamName) |
|
| 478 | + $prev = $this->tokensOrdered[$idx - 1] ?? null; |
|
| 479 | + if ($prev instanceof Mailcode_Parser_Statement_Tokenizer_Token_ParamName) |
|
| 480 | 480 | { |
| 481 | 481 | return $prev; |
| 482 | 482 | } |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | public function injectParamName(Mailcode_Parser_Statement_Tokenizer_Token $targetToken, string $name) : Mailcode_Parser_Statement_Tokenizer_Token_ParamName |
| 501 | 501 | { |
| 502 | 502 | $existing = $this->findNameToken($targetToken); |
| 503 | - if($existing) { |
|
| 503 | + if ($existing) { |
|
| 504 | 504 | $this->removeToken($existing); |
| 505 | 505 | } |
| 506 | 506 | |
@@ -521,9 +521,9 @@ discard block |
||
| 521 | 521 | $tokens = array(); |
| 522 | 522 | $found = false; |
| 523 | 523 | |
| 524 | - foreach($this->tokensOrdered as $token) |
|
| 524 | + foreach ($this->tokensOrdered as $token) |
|
| 525 | 525 | { |
| 526 | - if($token->getID() === $targetID) |
|
| 526 | + if ($token->getID() === $targetID) |
|
| 527 | 527 | { |
| 528 | 528 | $tokens[] = $newToken; |
| 529 | 529 | $found = true; |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | $tokens[] = $token; |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | - if($found) { |
|
| 535 | + if ($found) { |
|
| 536 | 536 | $this->tokensOrdered = $tokens; |
| 537 | 537 | |
| 538 | 538 | return $this; |
@@ -555,7 +555,7 @@ discard block |
||
| 555 | 555 | echo 'Statement: ['.$this->getNormalized().']'.PHP_EOL; |
| 556 | 556 | echo 'Tokens:'.PHP_EOL; |
| 557 | 557 | |
| 558 | - foreach($this->tokensOrdered as $idx => $token) |
|
| 558 | + foreach ($this->tokensOrdered as $idx => $token) |
|
| 559 | 559 | { |
| 560 | 560 | echo '- #'.$idx.' '.$token->getID().''.PHP_EOL; |
| 561 | 561 | echo ' Type: '.$token->getTypeID().PHP_EOL; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * @param mixed $subject |
| 37 | 37 | * @param Mailcode_Commands_Command|null $sourceCommand |
| 38 | 38 | */ |
| 39 | - public function __construct(string $tokenID, string $matchedText, $subject=null, ?Mailcode_Commands_Command $sourceCommand=null) |
|
| 39 | + public function __construct(string $tokenID, string $matchedText, $subject = null, ?Mailcode_Commands_Command $sourceCommand = null) |
|
| 40 | 40 | { |
| 41 | 41 | $this->tokenID = $tokenID; |
| 42 | 42 | $this->matchedText = $matchedText; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function getName() : string |
| 65 | 65 | { |
| 66 | - if(isset($this->nameToken)) { |
|
| 66 | + if (isset($this->nameToken)) { |
|
| 67 | 67 | return $this->nameToken->getParamName(); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | { |
| 13 | 13 | $next = $this->tokensTemporary[$i + 1] ?? null; |
| 14 | 14 | |
| 15 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_ParamName && $next) { |
|
| 15 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_ParamName && $next) { |
|
| 16 | 16 | $next->registerNameToken($token); |
| 17 | 17 | } |
| 18 | 18 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | $matches = array(); |
| 12 | 12 | preg_match_all('/([a-z][a-z0-9-]+)\s*=/iU', $this->tokenized, $matches, PREG_PATTERN_ORDER); |
| 13 | 13 | |
| 14 | - foreach($matches[0] as $match) |
|
| 14 | + foreach ($matches[0] as $match) |
|
| 15 | 15 | { |
| 16 | 16 | $this->registerToken('ParamName', $match); |
| 17 | 17 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | ->getInfo() |
| 45 | 45 | ->getTokenByParamName(CountInterface::PARAMETER_NAME); |
| 46 | 46 | |
| 47 | - if($token === null) |
|
| 47 | + if ($token === null) |
|
| 48 | 48 | { |
| 49 | 49 | $this->countEnabled = false; |
| 50 | 50 | return; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $this->validationResult->makeError( |
| 60 | - t('Invalid count subject:') . ' ' . t('Expected a variable.'), |
|
| 60 | + t('Invalid count subject:').' '.t('Expected a variable.'), |
|
| 61 | 61 | CountInterface::VALIDATION_COUNT_CODE_WRONG_TYPE |
| 62 | 62 | ); |
| 63 | 63 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public function getCountVariable(): ?Mailcode_Variables_Variable |
| 71 | 71 | { |
| 72 | - if($this->countToken !== null) |
|
| 72 | + if ($this->countToken !== null) |
|
| 73 | 73 | { |
| 74 | 74 | return $this->countToken->getVariable(); |
| 75 | 75 | } |
@@ -88,15 +88,15 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $info = $this->requireParams()->getInfo(); |
| 90 | 90 | |
| 91 | - if(isset($this->countToken)) { |
|
| 91 | + if (isset($this->countToken)) { |
|
| 92 | 92 | $info->removeToken($this->countToken); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - if(is_string($variable)) { |
|
| 95 | + if (is_string($variable)) { |
|
| 96 | 96 | $variable = Mailcode_Factory::var()->fullName($variable); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if($variable !== null) { |
|
| 99 | + if ($variable !== null) { |
|
| 100 | 100 | $this->countEnabled = true; |
| 101 | 101 | $this->countToken = $info->addVariable($variable); |
| 102 | 102 | $info->setParamName($this->countToken, CountInterface::PARAMETER_NAME); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | ->getInfo() |
| 48 | 48 | ->getTokenByParamName(BreakAtInterface::PARAMETER_NAME); |
| 49 | 49 | |
| 50 | - if($this->breakAtToken === null) { |
|
| 50 | + if ($this->breakAtToken === null) { |
|
| 51 | 51 | $this->breakAtEnabled = false; |
| 52 | 52 | return; |
| 53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | if (!$this->breakAtToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number && |
| 56 | 56 | !$this->breakAtToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
| 57 | 57 | $this->validationResult->makeError( |
| 58 | - t('Invalid break-at value:') . ' ' . t('Expected a number or variable.'), |
|
| 58 | + t('Invalid break-at value:').' '.t('Expected a number or variable.'), |
|
| 59 | 59 | BreakAtInterface::VALIDATION_BREAK_AT_CODE_WRONG_TYPE |
| 60 | 60 | ); |
| 61 | 61 | return; |
@@ -80,19 +80,19 @@ discard block |
||
| 80 | 80 | public function getBreakAt() |
| 81 | 81 | { |
| 82 | 82 | $token = $this->getBreakAtToken(); |
| 83 | - if($token === null) { |
|
| 83 | + if ($token === null) { |
|
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
|
| 87 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
|
| 88 | 88 | return $token->getVariable(); |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number) { |
|
| 91 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number) { |
|
| 92 | 92 | return (int)$token->getValue(); |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) { |
|
| 95 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) { |
|
| 96 | 96 | return (int)$token->getText(); |
| 97 | 97 | } |
| 98 | 98 | |
@@ -109,29 +109,29 @@ discard block |
||
| 109 | 109 | { |
| 110 | 110 | $info = $this->requireParams()->getInfo(); |
| 111 | 111 | |
| 112 | - if(isset($this->breakAtToken)) { |
|
| 112 | + if (isset($this->breakAtToken)) { |
|
| 113 | 113 | $info->removeToken($this->breakAtToken); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $this->breakAtEnabled = false; |
| 117 | 117 | $this->breakAtToken = null; |
| 118 | 118 | |
| 119 | - if($breakAt === null) { |
|
| 119 | + if ($breakAt === null) { |
|
| 120 | 120 | return $this; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | $token = null; |
| 124 | 124 | |
| 125 | - if(is_numeric($breakAt)) |
|
| 125 | + if (is_numeric($breakAt)) |
|
| 126 | 126 | { |
| 127 | 127 | $token = $info->addNumber((string)(int)$breakAt); |
| 128 | 128 | } |
| 129 | - else if($breakAt instanceof Mailcode_Variables_Variable) |
|
| 129 | + else if ($breakAt instanceof Mailcode_Variables_Variable) |
|
| 130 | 130 | { |
| 131 | 131 | $token = $info->addVariable($breakAt); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if($token !== null) |
|
| 134 | + if ($token !== null) |
|
| 135 | 135 | { |
| 136 | 136 | $info->setParamName($token, BreakAtInterface::PARAMETER_NAME); |
| 137 | 137 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | if (!$this->timezoneToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral && |
| 48 | 48 | !$this->timezoneToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) { |
| 49 | 49 | $this->validationResult->makeError( |
| 50 | - t('Invalid timezone:') . ' ' . t('Expected a string or variable.'), |
|
| 50 | + t('Invalid timezone:').' '.t('Expected a string or variable.'), |
|
| 51 | 51 | TimezoneInterface::VALIDATION_TIMEZONE_CODE_WRONG_TYPE |
| 52 | 52 | ); |
| 53 | 53 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function getTimezoneToken(): Mailcode_Parser_Statement_Tokenizer_Token |
| 64 | 64 | { |
| 65 | - if(!isset($this->timezoneToken)) { |
|
| 65 | + if (!isset($this->timezoneToken)) { |
|
| 66 | 66 | $this->timezoneToken = $this->createTimeZoneToken(); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $default = Mailcode_Commands_Command_ShowDate::getDefaultTimezone(); |
| 80 | 80 | $info = $this->requireParams()->getInfo(); |
| 81 | 81 | |
| 82 | - if($default instanceof Mailcode_Variables_Variable) { |
|
| 82 | + if ($default instanceof Mailcode_Variables_Variable) { |
|
| 83 | 83 | $token = $info->addVariable($default); |
| 84 | 84 | } else { |
| 85 | 85 | $token = $info->addStringLiteral($default); |
@@ -100,17 +100,17 @@ discard block |
||
| 100 | 100 | $token = null; |
| 101 | 101 | |
| 102 | 102 | $existing = $info->getTokenByParamName(TimezoneInterface::PARAMETER_NAME); |
| 103 | - if($existing) { |
|
| 103 | + if ($existing) { |
|
| 104 | 104 | $info->removeToken($existing); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if($timezone instanceof Mailcode_Variables_Variable) { |
|
| 107 | + if ($timezone instanceof Mailcode_Variables_Variable) { |
|
| 108 | 108 | $token = $info->addVariable($timezone); |
| 109 | - } else if(is_string($timezone)) { |
|
| 109 | + } else if (is_string($timezone)) { |
|
| 110 | 110 | $token = $info->addStringLiteral($timezone); |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | - if($token !== null) { |
|
| 113 | + if ($token !== null) { |
|
| 114 | 114 | $info->setParamName($token, TimezoneInterface::PARAMETER_NAME); |
| 115 | 115 | } |
| 116 | 116 | |