@@ -50,7 +50,7 @@ |
||
| 50 | 50 | |
| 51 | 51 | public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_Keyword |
| 52 | 52 | { |
| 53 | - if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 53 | + if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Keyword) |
|
| 54 | 54 | { |
| 55 | 55 | return $this->token; |
| 56 | 56 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function getToken() : Mailcode_Parser_Statement_Tokenizer_ValueInterface |
| 36 | 36 | { |
| 37 | - if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface) |
|
| 37 | + if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface) |
|
| 38 | 38 | { |
| 39 | 39 | return $this->token; |
| 40 | 40 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral |
| 36 | 36 | { |
| 37 | - if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
| 37 | + if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
| 38 | 38 | { |
| 39 | 39 | return $this->token; |
| 40 | 40 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | protected function _isMatch(Mailcode_Parser_Statement_Tokenizer_Token $token) : bool |
| 43 | 43 | { |
| 44 | - if(!empty($this->sign) && $token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 44 | + if (!empty($this->sign) && $token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 45 | 45 | { |
| 46 | 46 | return $token->getSign() === $this->sign; |
| 47 | 47 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_Operand |
| 53 | 53 | { |
| 54 | - if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 54 | + if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 55 | 55 | { |
| 56 | 56 | return $this->token; |
| 57 | 57 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function getToken() : Mailcode_Parser_Statement_Tokenizer_Token_Variable |
| 36 | 36 | { |
| 37 | - if($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) |
|
| 37 | + if ($this->token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) |
|
| 38 | 38 | { |
| 39 | 39 | return $this->token; |
| 40 | 40 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | private $validated = false; |
| 100 | 100 | |
| 101 | - public function __construct(string $type='', string $paramsString='', string $matchedText='') |
|
| 101 | + public function __construct(string $type = '', string $paramsString = '', string $matchedText = '') |
|
| 102 | 102 | { |
| 103 | 103 | $this->type = $type; |
| 104 | 104 | $this->paramsString = html_entity_decode($paramsString); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | { |
| 173 | 173 | $this->requireNonDummy(); |
| 174 | 174 | |
| 175 | - if($this->hash === '') { |
|
| 175 | + if ($this->hash === '') { |
|
| 176 | 176 | $this->hash = md5($this->matchedText); |
| 177 | 177 | } |
| 178 | 178 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | |
| 182 | 182 | protected function requireNonDummy() : void |
| 183 | 183 | { |
| 184 | - if(!$this->isDummy()) |
|
| 184 | + if (!$this->isDummy()) |
|
| 185 | 185 | { |
| 186 | 186 | return; |
| 187 | 187 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | |
| 201 | 201 | protected function validate() : \AppUtils\OperationResult |
| 202 | 202 | { |
| 203 | - if(!$this->validated) |
|
| 203 | + if (!$this->validated) |
|
| 204 | 204 | { |
| 205 | 205 | $this->requireNonDummy(); |
| 206 | 206 | $this->validateSyntax(); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | public function getValidationResult() : \AppUtils\OperationResult |
| 215 | 215 | { |
| 216 | - if(isset($this->validationResult)) |
|
| 216 | + if (isset($this->validationResult)) |
|
| 217 | 217 | { |
| 218 | 218 | return $this->validationResult; |
| 219 | 219 | } |
@@ -229,10 +229,10 @@ discard block |
||
| 229 | 229 | { |
| 230 | 230 | $validations = array_merge($this->validations, $this->getValidations()); |
| 231 | 231 | |
| 232 | - foreach($validations as $validation) |
|
| 232 | + foreach ($validations as $validation) |
|
| 233 | 233 | { |
| 234 | 234 | // break off at the first validation issue |
| 235 | - if(!$this->validateSyntaxMethod($validation)) |
|
| 235 | + if (!$this->validateSyntaxMethod($validation)) |
|
| 236 | 236 | { |
| 237 | 237 | return; |
| 238 | 238 | } |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | { |
| 244 | 244 | $method = 'validateSyntax_'.$validation; |
| 245 | 245 | |
| 246 | - if(!method_exists($this, $method)) |
|
| 246 | + if (!method_exists($this, $method)) |
|
| 247 | 247 | { |
| 248 | 248 | throw new Mailcode_Exception( |
| 249 | 249 | 'Missing validation method ['.$validation.']', |
@@ -268,12 +268,12 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | protected function validateSyntax_params_empty() : void |
| 270 | 270 | { |
| 271 | - if(!$this->requiresParameters()) |
|
| 271 | + if (!$this->requiresParameters()) |
|
| 272 | 272 | { |
| 273 | 273 | return; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - if(empty($this->paramsString)) |
|
| 276 | + if (empty($this->paramsString)) |
|
| 277 | 277 | { |
| 278 | 278 | $this->validationResult->makeError( |
| 279 | 279 | t('Parameters have to be specified.'), |
@@ -285,14 +285,14 @@ discard block |
||
| 285 | 285 | |
| 286 | 286 | protected function validateSyntax_params_keywords() : void |
| 287 | 287 | { |
| 288 | - if(!$this->supportsLogicKeywords()) |
|
| 288 | + if (!$this->supportsLogicKeywords()) |
|
| 289 | 289 | { |
| 290 | 290 | return; |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | $this->logicKeywords = new Mailcode_Commands_LogicKeywords($this, $this->paramsString); |
| 294 | 294 | |
| 295 | - if(!$this->logicKeywords->isValid()) |
|
| 295 | + if (!$this->logicKeywords->isValid()) |
|
| 296 | 296 | { |
| 297 | 297 | $this->validationResult->makeError( |
| 298 | 298 | t('Invalid parameters:').' '.$this->logicKeywords->getErrorMessage(), |
@@ -307,14 +307,14 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | protected function validateSyntax_params_parse() : void |
| 309 | 309 | { |
| 310 | - if(!$this->requiresParameters()) |
|
| 310 | + if (!$this->requiresParameters()) |
|
| 311 | 311 | { |
| 312 | 312 | return; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | $this->params = $this->mailcode->getParser()->createStatement($this->paramsString); |
| 316 | 316 | |
| 317 | - if(!$this->params->isValid()) |
|
| 317 | + if (!$this->params->isValid()) |
|
| 318 | 318 | { |
| 319 | 319 | $error = $this->params->getValidationResult(); |
| 320 | 320 | |
@@ -331,14 +331,14 @@ discard block |
||
| 331 | 331 | |
| 332 | 332 | protected function validateSyntax_type_supported() : void |
| 333 | 333 | { |
| 334 | - if(!$this->supportsType() || empty($this->type)) |
|
| 334 | + if (!$this->supportsType() || empty($this->type)) |
|
| 335 | 335 | { |
| 336 | 336 | return; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | $types = $this->getSupportedTypes(); |
| 340 | 340 | |
| 341 | - if(!in_array($this->type, $types)) |
|
| 341 | + if (!in_array($this->type, $types)) |
|
| 342 | 342 | { |
| 343 | 343 | $this->validationResult->makeError( |
| 344 | 344 | t('The command addon %1$s is not supported.', $this->type).' '. |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | protected function validateSyntax_type_unsupported() : void |
| 354 | 354 | { |
| 355 | - if($this->supportsType() || empty($this->type)) |
|
| 355 | + if ($this->supportsType() || empty($this->type)) |
|
| 356 | 356 | { |
| 357 | 357 | return; |
| 358 | 358 | } |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | |
| 371 | 371 | public function getType() : string |
| 372 | 372 | { |
| 373 | - if($this->supportsType()) |
|
| 373 | + if ($this->supportsType()) |
|
| 374 | 374 | { |
| 375 | 375 | return $this->type; |
| 376 | 376 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | |
| 391 | 391 | public function getHighlighted() : string |
| 392 | 392 | { |
| 393 | - if(!$this->isValid()) |
|
| 393 | + if (!$this->isValid()) |
|
| 394 | 394 | { |
| 395 | 395 | return ''; |
| 396 | 396 | } |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | |
| 402 | 402 | public function getParamsString() : string |
| 403 | 403 | { |
| 404 | - if($this->requiresParameters()) |
|
| 404 | + if ($this->requiresParameters()) |
|
| 405 | 405 | { |
| 406 | 406 | return $this->paramsString; |
| 407 | 407 | } |
@@ -436,22 +436,22 @@ discard block |
||
| 436 | 436 | |
| 437 | 437 | public final function getCommandType() : string |
| 438 | 438 | { |
| 439 | - if($this instanceof Mailcode_Commands_Command_Type_Closing) |
|
| 439 | + if ($this instanceof Mailcode_Commands_Command_Type_Closing) |
|
| 440 | 440 | { |
| 441 | 441 | return 'Closing'; |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - if($this instanceof Mailcode_Commands_Command_Type_Opening) |
|
| 444 | + if ($this instanceof Mailcode_Commands_Command_Type_Opening) |
|
| 445 | 445 | { |
| 446 | 446 | return 'Opening'; |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | - if($this instanceof Mailcode_Commands_Command_Type_Sibling) |
|
| 449 | + if ($this instanceof Mailcode_Commands_Command_Type_Sibling) |
|
| 450 | 450 | { |
| 451 | 451 | return 'Sibling'; |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | - if($this instanceof Mailcode_Commands_Command_Type_Standalone) |
|
| 454 | + if ($this instanceof Mailcode_Commands_Command_Type_Standalone) |
|
| 455 | 455 | { |
| 456 | 456 | return 'Standalone'; |
| 457 | 457 | } |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | |
| 502 | 502 | public function getLogicKeywords() : Mailcode_Commands_LogicKeywords |
| 503 | 503 | { |
| 504 | - if($this->supportsLogicKeywords() && isset($this->logicKeywords)) |
|
| 504 | + if ($this->supportsLogicKeywords() && isset($this->logicKeywords)) |
|
| 505 | 505 | { |
| 506 | 506 | return $this->logicKeywords; |
| 507 | 507 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $val = $this->validator->createStringLiteral(); |
| 35 | 35 | |
| 36 | - if($val->isValid()) |
|
| 36 | + if ($val->isValid()) |
|
| 37 | 37 | { |
| 38 | 38 | $this->searchTerm = $val->getToken(); |
| 39 | 39 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function getSearchTerm() : string |
| 50 | 50 | { |
| 51 | - if($this->searchTerm instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
| 51 | + if ($this->searchTerm instanceof Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral) |
|
| 52 | 52 | { |
| 53 | 53 | return $this->searchTerm->getNormalized(); |
| 54 | 54 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $var = $this->validator->createValue(); |
| 35 | 35 | |
| 36 | - if($var->isValid()) |
|
| 36 | + if ($var->isValid()) |
|
| 37 | 37 | { |
| 38 | 38 | $this->valueToken = $var->getToken(); |
| 39 | 39 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function getValue() : string |
| 55 | 55 | { |
| 56 | - if($this->valueToken instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface) |
|
| 56 | + if ($this->valueToken instanceof Mailcode_Parser_Statement_Tokenizer_ValueInterface) |
|
| 57 | 57 | { |
| 58 | 58 | return $this->valueToken->getValue(); |
| 59 | 59 | } |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $var = $this->validator->createOperand(); |
| 41 | 41 | |
| 42 | - if($var->isValid()) |
|
| 42 | + if ($var->isValid()) |
|
| 43 | 43 | { |
| 44 | - if(in_array($var->getSign(), $this->getAllowedOperands())) |
|
| 44 | + if (in_array($var->getSign(), $this->getAllowedOperands())) |
|
| 45 | 45 | { |
| 46 | 46 | $this->operandToken = $var->getToken(); |
| 47 | 47 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function getOperand() : Mailcode_Parser_Statement_Tokenizer_Token_Operand |
| 68 | 68 | { |
| 69 | - if($this->operandToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 69 | + if ($this->operandToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Operand) |
|
| 70 | 70 | { |
| 71 | 71 | return $this->operandToken; |
| 72 | 72 | } |