@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $id = $token->getID(); |
| 48 | 48 | |
| 49 | - if(!in_array($id, $this->exclude)) |
|
| 49 | + if (!in_array($id, $this->exclude)) |
|
| 50 | 50 | { |
| 51 | 51 | $this->exclude[] = $id; |
| 52 | 52 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function limitByClassName(string $className) : Mailcode_Parser_Statement_Info_Pruner |
| 68 | 68 | { |
| 69 | - if(!in_array($className, $this->classNames)) |
|
| 69 | + if (!in_array($className, $this->classNames)) |
|
| 70 | 70 | { |
| 71 | 71 | $this->classNames[] = $className; |
| 72 | 72 | } |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | $tokens = $this->info->getTokens(); |
| 86 | 86 | $keep = array(); |
| 87 | 87 | |
| 88 | - foreach($tokens as $token) |
|
| 88 | + foreach ($tokens as $token) |
|
| 89 | 89 | { |
| 90 | - if(in_array($token->getID(), $this->exclude)) |
|
| 90 | + if (in_array($token->getID(), $this->exclude)) |
|
| 91 | 91 | { |
| 92 | 92 | continue; |
| 93 | 93 | } |
@@ -48,15 +48,15 @@ |
||
| 48 | 48 | ->limitToStringLiterals() |
| 49 | 49 | ->getTokens(); |
| 50 | 50 | |
| 51 | - foreach($tokens as $token) |
|
| 51 | + foreach ($tokens as $token) |
|
| 52 | 52 | { |
| 53 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
| 53 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
| 54 | 54 | { |
| 55 | 55 | $this->searchTerms[] = $token; |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if(empty($this->searchTerms)) |
|
| 59 | + if (empty($this->searchTerms)) |
|
| 60 | 60 | { |
| 61 | 61 | $this->validationResult->makeError( |
| 62 | 62 | t('No search terms found:').' '. |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $this->caseInsensitive = $val->isValid(); |
| 42 | 42 | |
| 43 | - if($val->isValid()) |
|
| 43 | + if ($val->isValid()) |
|
| 44 | 44 | { |
| 45 | 45 | $this->caseToken = $val->getToken(); |
| 46 | 46 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | public function getCaseToken() : ?Mailcode_Parser_Statement_Tokenizer_Token_Keyword |
| 55 | 55 | { |
| 56 | - if($this->caseToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 56 | + if ($this->caseToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 57 | 57 | { |
| 58 | 58 | return $this->caseToken; |
| 59 | 59 | } |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | |
| 81 | 81 | protected function validateSyntax_comment() : void |
| 82 | 82 | { |
| 83 | - if(empty($this->commentString)) |
|
| 83 | + if (empty($this->commentString)) |
|
| 84 | 84 | { |
| 85 | 85 | $this->validationResult->makeError( |
| 86 | 86 | t('The comment text ist empty.'), |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | // All other special characters have to be escaped |
| 63 | 63 | // with two backslashes. |
| 64 | - foreach($this->regexSpecialChars as $char) |
|
| 64 | + foreach ($this->regexSpecialChars as $char) |
|
| 65 | 65 | { |
| 66 | 66 | $string = str_replace($char, '\\\\'.$char, $string); |
| 67 | 67 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $val = $this->validator->createVariable()->setIndex(0); |
| 75 | 75 | |
| 76 | - if($val->isValid()) |
|
| 76 | + if ($val->isValid()) |
|
| 77 | 77 | { |
| 78 | 78 | $this->variableToken = $val->getToken(); |
| 79 | 79 | } |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | $tokens = $this->params->getInfo()->createPruner()->limitToOperands()->getTokens(); |
| 92 | 92 | |
| 93 | - foreach($tokens as $token) |
|
| 93 | + foreach ($tokens as $token) |
|
| 94 | 94 | { |
| 95 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 95 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 96 | 96 | { |
| 97 | 97 | $this->validateOperand($token); |
| 98 | 98 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | // ensure that the operand we have in the command is one of the |
| 110 | 110 | // allowed ones. |
| 111 | - if(!in_array($sign, $allowed)) |
|
| 111 | + if (!in_array($sign, $allowed)) |
|
| 112 | 112 | { |
| 113 | 113 | $this->validationResult->makeError( |
| 114 | 114 | t('The %1$s sign is not allowed in this command.', '<code>'.$sign.'</code>'), |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $tokens = $this->getAssignmentTokens(); |
| 123 | 123 | |
| 124 | - if(empty($tokens)) |
|
| 124 | + if (empty($tokens)) |
|
| 125 | 125 | { |
| 126 | 126 | $this->validationResult->makeError( |
| 127 | 127 | t('No value assigned to the variable.'), |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | public function getVariable() : Mailcode_Variables_Variable |
| 134 | 134 | { |
| 135 | - if($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) |
|
| 135 | + if ($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) |
|
| 136 | 136 | { |
| 137 | 137 | return $this->variableToken->getVariable(); |
| 138 | 138 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $eq = array_shift($params); // equals sign |
| 157 | 157 | |
| 158 | 158 | // in case the equals sign was omitted. |
| 159 | - if(!$eq instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 159 | + if (!$eq instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 160 | 160 | { |
| 161 | 161 | array_unshift($params, $eq); |
| 162 | 162 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | $items = array(); |
| 172 | 172 | |
| 173 | - foreach($tokens as $token) |
|
| 173 | + foreach ($tokens as $token) |
|
| 174 | 174 | { |
| 175 | 175 | $items[] = $token->getNormalized(); |
| 176 | 176 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $this->instantiator->checkCommand($cmd); |
| 36 | 36 | |
| 37 | - if($cmd instanceof Mailcode_Commands_Command_Comment) |
|
| 37 | + if ($cmd instanceof Mailcode_Commands_Command_Comment) |
|
| 38 | 38 | { |
| 39 | 39 | return $cmd; |
| 40 | 40 | } |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | throw $this->instantiator->exceptionUnexpectedType('Comment', $cmd); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function for(string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For |
|
| 45 | + public function for (string $sourceVariable, string $loopVariable) : Mailcode_Commands_Command_For |
|
| 46 | 46 | { |
| 47 | 47 | $sourceVariable = '$'.ltrim($sourceVariable, '$'); |
| 48 | 48 | $loopVariable = '$'.ltrim($loopVariable, '$'); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $this->instantiator->checkCommand($cmd); |
| 66 | 66 | |
| 67 | - if($cmd instanceof Mailcode_Commands_Command_For) |
|
| 67 | + if ($cmd instanceof Mailcode_Commands_Command_For) |
|
| 68 | 68 | { |
| 69 | 69 | return $cmd; |
| 70 | 70 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | public function getSourceVariable() : Mailcode_Variables_Variable |
| 90 | 90 | { |
| 91 | - if(isset($this->sourceVar)) |
|
| 91 | + if (isset($this->sourceVar)) |
|
| 92 | 92 | { |
| 93 | 93 | return $this->sourceVar->getVariable(); |
| 94 | 94 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | public function getLoopVariable() : Mailcode_Variables_Variable |
| 104 | 104 | { |
| 105 | - if(isset($this->loopVar)) |
|
| 105 | + if (isset($this->loopVar)) |
|
| 106 | 106 | { |
| 107 | 107 | return $this->loopVar->getVariable(); |
| 108 | 108 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $this->keyword = $info->getKeywordByIndex(1); |
| 123 | 123 | $this->sourceVar = $info->getVariableByIndex(2); |
| 124 | 124 | |
| 125 | - if(!$this->loopVar || !$this->keyword || !$this->sourceVar) |
|
| 125 | + if (!$this->loopVar || !$this->keyword || !$this->sourceVar) |
|
| 126 | 126 | { |
| 127 | 127 | $this->validationResult->makeError( |
| 128 | 128 | t('Not a valid for loop.').' '.t('Is the %1$s keyword missing?', 'in:'), |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | protected function validateSyntax_keyword() : void |
| 137 | 137 | { |
| 138 | - if($this->keyword->isForIn()) |
|
| 138 | + if ($this->keyword->isForIn()) |
|
| 139 | 139 | { |
| 140 | 140 | return; |
| 141 | 141 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | protected function validateSyntax_variable_names() : void |
| 150 | 150 | { |
| 151 | - if($this->sourceVar->getVariable()->getFullName() !== $this->loopVar->getVariable()->getFullName()) |
|
| 151 | + if ($this->sourceVar->getVariable()->getFullName() !== $this->loopVar->getVariable()->getFullName()) |
|
| 152 | 152 | { |
| 153 | 153 | return; |
| 154 | 154 | } |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | public function requiresAdjustment(): bool |
| 34 | 34 | { |
| 35 | - if(!parent::requiresAdjustment()) |
|
| 35 | + if (!parent::requiresAdjustment()) |
|
| 36 | 36 | { |
| 37 | 37 | return false; |
| 38 | 38 | } |