@@ -22,19 +22,19 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | class Mailcode_Parser_Statement_Info_Pruner |
| 24 | 24 | { |
| 25 | - /** |
|
| 26 | - * @var Mailcode_Parser_Statement_Info |
|
| 27 | - */ |
|
| 25 | + /** |
|
| 26 | + * @var Mailcode_Parser_Statement_Info |
|
| 27 | + */ |
|
| 28 | 28 | private $info; |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * @var string[] |
|
| 32 | - */ |
|
| 30 | + /** |
|
| 31 | + * @var string[] |
|
| 32 | + */ |
|
| 33 | 33 | private $exclude = array(); |
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @var string[] |
|
| 37 | - */ |
|
| 35 | + /** |
|
| 36 | + * @var string[] |
|
| 37 | + */ |
|
| 38 | 38 | private $classNames = array(); |
| 39 | 39 | |
| 40 | 40 | public function __construct(Mailcode_Parser_Statement_Info $info) |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | return $this; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * Retrieves all tokens in the statement matching the |
|
| 79 | - * current criteria. |
|
| 80 | - * |
|
| 81 | - * @return Mailcode_Parser_Statement_Tokenizer_Token[] |
|
| 82 | - */ |
|
| 77 | + /** |
|
| 78 | + * Retrieves all tokens in the statement matching the |
|
| 79 | + * current criteria. |
|
| 80 | + * |
|
| 81 | + * @return Mailcode_Parser_Statement_Tokenizer_Token[] |
|
| 82 | + */ |
|
| 83 | 83 | public function getTokens() : array |
| 84 | 84 | { |
| 85 | 85 | $tokens = $this->info->getTokens(); |
@@ -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 | } |
@@ -135,9 +135,9 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $result = array(); |
| 137 | 137 | |
| 138 | - foreach($this->tokensOrdered as $token) |
|
| 138 | + foreach ($this->tokensOrdered as $token) |
|
| 139 | 139 | { |
| 140 | - if($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Unknown) |
|
| 140 | + if ($token instanceof Mailcode_Parser_Statement_Tokenizer_Token_Unknown) |
|
| 141 | 141 | { |
| 142 | 142 | $result[] = $token; |
| 143 | 143 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $unknown = $this->getUnknown(); |
| 152 | 152 | |
| 153 | - if(!empty($unknown)) |
|
| 153 | + if (!empty($unknown)) |
|
| 154 | 154 | { |
| 155 | 155 | return array_shift($unknown); |
| 156 | 156 | } |
@@ -162,11 +162,11 @@ discard block |
||
| 162 | 162 | { |
| 163 | 163 | $parts = array(); |
| 164 | 164 | |
| 165 | - foreach($this->tokensOrdered as $token) |
|
| 165 | + foreach ($this->tokensOrdered as $token) |
|
| 166 | 166 | { |
| 167 | 167 | $string = $token->getNormalized(); |
| 168 | 168 | |
| 169 | - if($string != '') |
|
| 169 | + if ($string != '') |
|
| 170 | 170 | { |
| 171 | 171 | $parts[] = $string; |
| 172 | 172 | } |
@@ -179,11 +179,11 @@ discard block |
||
| 179 | 179 | { |
| 180 | 180 | $this->tokenized = trim($statement); |
| 181 | 181 | |
| 182 | - foreach($this->tokenCategories as $token) |
|
| 182 | + foreach ($this->tokenCategories as $token) |
|
| 183 | 183 | { |
| 184 | 184 | $method = 'tokenize_'.$token; |
| 185 | 185 | |
| 186 | - if(!method_exists($this, $method)) |
|
| 186 | + if (!method_exists($this, $method)) |
|
| 187 | 187 | { |
| 188 | 188 | throw new Mailcode_Exception( |
| 189 | 189 | 'Unknown statement token.', |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @param string $matchedText |
| 208 | 208 | * @param mixed $subject |
| 209 | 209 | */ |
| 210 | - protected function registerToken(string $type, string $matchedText, $subject=null) : void |
|
| 210 | + protected function registerToken(string $type, string $matchedText, $subject = null) : void |
|
| 211 | 211 | { |
| 212 | 212 | $tokenID = $this->generateID(); |
| 213 | 213 | |
@@ -224,9 +224,9 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | protected function getTokenByID(string $tokenID) : ?Mailcode_Parser_Statement_Tokenizer_Token |
| 226 | 226 | { |
| 227 | - foreach($this->tokensTemporary as $token) |
|
| 227 | + foreach ($this->tokensTemporary as $token) |
|
| 228 | 228 | { |
| 229 | - if($token->getID() === $tokenID) |
|
| 229 | + if ($token->getID() === $tokenID) |
|
| 230 | 230 | { |
| 231 | 231 | return $token; |
| 232 | 232 | } |
@@ -242,9 +242,9 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | protected function tokenize_keywords() : void |
| 244 | 244 | { |
| 245 | - foreach($this->keywords as $keyword) |
|
| 245 | + foreach ($this->keywords as $keyword) |
|
| 246 | 246 | { |
| 247 | - if(strstr($this->tokenized, $keyword)) |
|
| 247 | + if (strstr($this->tokenized, $keyword)) |
|
| 248 | 248 | { |
| 249 | 249 | $this->registerToken('Keyword', $keyword); |
| 250 | 250 | } |
@@ -258,12 +258,12 @@ discard block |
||
| 258 | 258 | // over that could not be tokenized. |
| 259 | 259 | $parts = \AppUtils\ConvertHelper::explodeTrim($this->delimiter, $this->tokenized); |
| 260 | 260 | |
| 261 | - foreach($parts as $part) |
|
| 261 | + foreach ($parts as $part) |
|
| 262 | 262 | { |
| 263 | 263 | $token = $this->getTokenByID($part); |
| 264 | 264 | |
| 265 | 265 | // if the entry is a token, simply add it. |
| 266 | - if($token) |
|
| 266 | + if ($token) |
|
| 267 | 267 | { |
| 268 | 268 | $this->tokensOrdered[] = $token; |
| 269 | 269 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | { |
| 280 | 280 | $vars = Mailcode::create()->findVariables($this->tokenized)->getGroupedByHash(); |
| 281 | 281 | |
| 282 | - foreach($vars as $var) |
|
| 282 | + foreach ($vars as $var) |
|
| 283 | 283 | { |
| 284 | 284 | $this->registerToken('Variable', $var->getMatchedText(), $var); |
| 285 | 285 | } |
@@ -287,9 +287,9 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | protected function tokenize_operands() : void |
| 289 | 289 | { |
| 290 | - foreach($this->operands as $operand) |
|
| 290 | + foreach ($this->operands as $operand) |
|
| 291 | 291 | { |
| 292 | - if(strstr($this->tokenized, $operand)) |
|
| 292 | + if (strstr($this->tokenized, $operand)) |
|
| 293 | 293 | { |
| 294 | 294 | $this->registerToken('Operand', $operand); |
| 295 | 295 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | $matches = array(); |
| 302 | 302 | preg_match_all('/"(.*)"/sxU', $this->tokenized, $matches, PREG_PATTERN_ORDER); |
| 303 | 303 | |
| 304 | - foreach($matches[0] as $match) |
|
| 304 | + foreach ($matches[0] as $match) |
|
| 305 | 305 | { |
| 306 | 306 | $this->registerToken('StringLiteral', $match); |
| 307 | 307 | } |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $matches = array(); |
| 313 | 313 | preg_match_all('/-*[0-9]+\s*[.,]\s*[0-9]+|-*[0-9]+/sx', $this->tokenized, $matches, PREG_PATTERN_ORDER); |
| 314 | 314 | |
| 315 | - foreach($matches[0] as $match) |
|
| 315 | + foreach ($matches[0] as $match) |
|
| 316 | 316 | { |
| 317 | 317 | $this->registerToken('Number', $match); |
| 318 | 318 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | { |
| 330 | 330 | static $alphas; |
| 331 | 331 | |
| 332 | - if(!isset($alphas)) |
|
| 332 | + if (!isset($alphas)) |
|
| 333 | 333 | { |
| 334 | 334 | $alphas = range('A', 'Z'); |
| 335 | 335 | } |
@@ -338,12 +338,12 @@ discard block |
||
| 338 | 338 | |
| 339 | 339 | $result = ''; |
| 340 | 340 | |
| 341 | - for($i=0; $i < $amount; $i++) |
|
| 341 | + for ($i = 0; $i < $amount; $i++) |
|
| 342 | 342 | { |
| 343 | 343 | $result .= $alphas[array_rand($alphas)]; |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - if(!in_array($result, self::$ids)) |
|
| 346 | + if (!in_array($result, self::$ids)) |
|
| 347 | 347 | { |
| 348 | 348 | self::$ids[] = $result; |
| 349 | 349 | return $result; |
@@ -20,26 +20,26 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class Mailcode_Parser_Statement_Tokenizer_Token implements Mailcode_Parser_Statement_Tokenizer_TypeInterface |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | 26 | protected $tokenID; |
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @var string |
|
| 30 | - */ |
|
| 28 | + /** |
|
| 29 | + * @var string |
|
| 30 | + */ |
|
| 31 | 31 | protected $matchedText; |
| 32 | 32 | |
| 33 | - /** |
|
| 34 | - * @var mixed |
|
| 35 | - */ |
|
| 33 | + /** |
|
| 34 | + * @var mixed |
|
| 35 | + */ |
|
| 36 | 36 | protected $subject; |
| 37 | 37 | |
| 38 | - /** |
|
| 39 | - * @param string $tokenID |
|
| 40 | - * @param string $matchedText |
|
| 41 | - * @param mixed $subject |
|
| 42 | - */ |
|
| 38 | + /** |
|
| 39 | + * @param string $tokenID |
|
| 40 | + * @param string $matchedText |
|
| 41 | + * @param mixed $subject |
|
| 42 | + */ |
|
| 43 | 43 | public function __construct(string $tokenID, string $matchedText, $subject=null) |
| 44 | 44 | { |
| 45 | 45 | $this->tokenID = $tokenID; |
@@ -47,20 +47,20 @@ discard block |
||
| 47 | 47 | $this->subject = $subject; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * The ID of the type. i.e. the class name ("Keyword", "StringLiteral"). |
|
| 52 | - * @return string |
|
| 53 | - */ |
|
| 50 | + /** |
|
| 51 | + * The ID of the type. i.e. the class name ("Keyword", "StringLiteral"). |
|
| 52 | + * @return string |
|
| 53 | + */ |
|
| 54 | 54 | public function getTypeID() : string |
| 55 | 55 | { |
| 56 | 56 | $parts = explode('_', get_class($this)); |
| 57 | 57 | return array_pop($parts); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - /** |
|
| 61 | - * Retrieves a unique ID of the token. |
|
| 62 | - * @return string |
|
| 63 | - */ |
|
| 60 | + /** |
|
| 61 | + * Retrieves a unique ID of the token. |
|
| 62 | + * @return string |
|
| 63 | + */ |
|
| 64 | 64 | public function getID() : string |
| 65 | 65 | { |
| 66 | 66 | return $this->tokenID; |
@@ -28,9 +28,9 @@ discard block |
||
| 28 | 28 | use Mailcode_Traits_Commands_Validation_Variable; |
| 29 | 29 | use Mailcode_Traits_Commands_Validation_CaseSensitive; |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
| 33 | - */ |
|
| 31 | + /** |
|
| 32 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
| 33 | + */ |
|
| 34 | 34 | protected $searchTerms = array(); |
| 35 | 35 | |
| 36 | 36 | protected function getValidations() : array |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - /** |
|
| 70 | - * Retrieves all search terms. |
|
| 71 | - * @return Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
| 72 | - */ |
|
| 69 | + /** |
|
| 70 | + * Retrieves all search terms. |
|
| 71 | + * @return Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
| 72 | + */ |
|
| 73 | 73 | public function getSearchTerms() : array |
| 74 | 74 | { |
| 75 | 75 | return $this->searchTerms; |
@@ -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:').' '. |
@@ -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 |
@@ -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 | } |
@@ -23,17 +23,17 @@ discard block |
||
| 23 | 23 | const ERROR_INVALID_COMMAND_CREATED = 50001; |
| 24 | 24 | const ERROR_UNEXPECTED_COMMAND_TYPE = 50002; |
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * @var Mailcode_Factory_CommandSets |
|
| 28 | - */ |
|
| 26 | + /** |
|
| 27 | + * @var Mailcode_Factory_CommandSets |
|
| 28 | + */ |
|
| 29 | 29 | private static $commandSets; |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Creates a ShowVariable command. |
|
| 33 | - * |
|
| 34 | - * @param string $variableName A variable name, with or without the $ sign prepended. |
|
| 35 | - * @return Mailcode_Commands_Command_ShowVariable |
|
| 36 | - */ |
|
| 31 | + /** |
|
| 32 | + * Creates a ShowVariable command. |
|
| 33 | + * |
|
| 34 | + * @param string $variableName A variable name, with or without the $ sign prepended. |
|
| 35 | + * @return Mailcode_Commands_Command_ShowVariable |
|
| 36 | + */ |
|
| 37 | 37 | public static function showVar(string $variableName) : Mailcode_Commands_Command_ShowVariable |
| 38 | 38 | { |
| 39 | 39 | return self::$commandSets->show()->showVar($variableName); |
@@ -52,41 +52,41 @@ discard block |
||
| 52 | 52 | return self::$commandSets->show()->showDate($variableName, $formatString); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Creates a ShowSnippet command. |
|
| 57 | - * |
|
| 58 | - * @param string $snippetName A snippet name, with or without the $ sign prepended. |
|
| 59 | - * @return Mailcode_Commands_Command_ShowSnippet |
|
| 60 | - */ |
|
| 55 | + /** |
|
| 56 | + * Creates a ShowSnippet command. |
|
| 57 | + * |
|
| 58 | + * @param string $snippetName A snippet name, with or without the $ sign prepended. |
|
| 59 | + * @return Mailcode_Commands_Command_ShowSnippet |
|
| 60 | + */ |
|
| 61 | 61 | public static function showSnippet(string $snippetName) : Mailcode_Commands_Command_ShowSnippet |
| 62 | 62 | { |
| 63 | 63 | return self::$commandSets->show()->showSnippet($snippetName); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Creates a SetVariable command. |
|
| 68 | - * |
|
| 69 | - * @param string $variableName A variable name, with or without the $ sign prepended. |
|
| 70 | - * @param string $value |
|
| 71 | - * @param bool $quoteValue Whether to treat the value as a string literal, and add quotes to it. |
|
| 72 | - * @return Mailcode_Commands_Command_SetVariable |
|
| 73 | - * @throws Mailcode_Factory_Exception |
|
| 74 | - * |
|
| 75 | - * @see Mailcode_Factory::ERROR_INVALID_COMMAND_CREATED |
|
| 76 | - */ |
|
| 66 | + /** |
|
| 67 | + * Creates a SetVariable command. |
|
| 68 | + * |
|
| 69 | + * @param string $variableName A variable name, with or without the $ sign prepended. |
|
| 70 | + * @param string $value |
|
| 71 | + * @param bool $quoteValue Whether to treat the value as a string literal, and add quotes to it. |
|
| 72 | + * @return Mailcode_Commands_Command_SetVariable |
|
| 73 | + * @throws Mailcode_Factory_Exception |
|
| 74 | + * |
|
| 75 | + * @see Mailcode_Factory::ERROR_INVALID_COMMAND_CREATED |
|
| 76 | + */ |
|
| 77 | 77 | public static function setVar(string $variableName, string $value, bool $quoteValue=true) : Mailcode_Commands_Command_SetVariable |
| 78 | 78 | { |
| 79 | 79 | return self::$commandSets->set()->setVar($variableName, $value, $quoteValue); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - /** |
|
| 83 | - * Like setVar(), but treats the value as a string literal |
|
| 84 | - * and automatically adds quotes to it. |
|
| 85 | - * |
|
| 86 | - * @param string $variableName |
|
| 87 | - * @param string $value |
|
| 88 | - * @return Mailcode_Commands_Command_SetVariable |
|
| 89 | - */ |
|
| 82 | + /** |
|
| 83 | + * Like setVar(), but treats the value as a string literal |
|
| 84 | + * and automatically adds quotes to it. |
|
| 85 | + * |
|
| 86 | + * @param string $variableName |
|
| 87 | + * @param string $value |
|
| 88 | + * @return Mailcode_Commands_Command_SetVariable |
|
| 89 | + */ |
|
| 90 | 90 | public static function setVarString(string $variableName, string $value) : Mailcode_Commands_Command_SetVariable |
| 91 | 91 | { |
| 92 | 92 | return self::$commandSets->set()->setVar($variableName, $value, true); |
@@ -212,14 +212,14 @@ discard block |
||
| 212 | 212 | return self::$commandSets->if()->ifContains($variable, array($search), $caseInsensitive); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - /** |
|
| 216 | - * Creates if contains command, with several search terms. |
|
| 217 | - * |
|
| 218 | - * @param string $variable |
|
| 219 | - * @param string[] $searchTerms List of search terms. Do not add surrounding quotes. |
|
| 220 | - * @param bool $caseInsensitive |
|
| 221 | - * @return Mailcode_Commands_Command_If_Contains |
|
| 222 | - */ |
|
| 215 | + /** |
|
| 216 | + * Creates if contains command, with several search terms. |
|
| 217 | + * |
|
| 218 | + * @param string $variable |
|
| 219 | + * @param string[] $searchTerms List of search terms. Do not add surrounding quotes. |
|
| 220 | + * @param bool $caseInsensitive |
|
| 221 | + * @return Mailcode_Commands_Command_If_Contains |
|
| 222 | + */ |
|
| 223 | 223 | public static function ifContainsAny(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
| 224 | 224 | { |
| 225 | 225 | return self::$commandSets->if()->ifContains($variable, $searchTerms, $caseInsensitive); |
@@ -230,14 +230,14 @@ discard block |
||
| 230 | 230 | return self::$commandSets->elseIf()->elseIfContains($variable, array($search), $caseInsensitive); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - /** |
|
| 234 | - * Creates else if contains command, with several search terms. |
|
| 235 | - * |
|
| 236 | - * @param string $variable |
|
| 237 | - * @param string[] $searchTerms List of search terms. Do not add surrounding quotes. |
|
| 238 | - * @param bool $caseInsensitive |
|
| 239 | - * @return Mailcode_Commands_Command_ElseIf_Contains |
|
| 240 | - */ |
|
| 233 | + /** |
|
| 234 | + * Creates else if contains command, with several search terms. |
|
| 235 | + * |
|
| 236 | + * @param string $variable |
|
| 237 | + * @param string[] $searchTerms List of search terms. Do not add surrounding quotes. |
|
| 238 | + * @param bool $caseInsensitive |
|
| 239 | + * @return Mailcode_Commands_Command_ElseIf_Contains |
|
| 240 | + */ |
|
| 241 | 241 | public static function elseIfContainsAny(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
| 242 | 242 | { |
| 243 | 243 | return self::$commandSets->elseIf()->elseIfContains($variable, $searchTerms, $caseInsensitive); |
@@ -253,34 +253,34 @@ discard block |
||
| 253 | 253 | return self::$commandSets->if()->ifNotEmpty($variable); |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - /** |
|
| 257 | - * Creates a renderer instance, which can be used to easily |
|
| 258 | - * create and convert commands to strings. |
|
| 259 | - * |
|
| 260 | - * @return Mailcode_Renderer |
|
| 261 | - */ |
|
| 256 | + /** |
|
| 257 | + * Creates a renderer instance, which can be used to easily |
|
| 258 | + * create and convert commands to strings. |
|
| 259 | + * |
|
| 260 | + * @return Mailcode_Renderer |
|
| 261 | + */ |
|
| 262 | 262 | public static function createRenderer() : Mailcode_Renderer |
| 263 | 263 | { |
| 264 | 264 | return new Mailcode_Renderer(); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - /** |
|
| 268 | - * Creates a printer instance, which works like the renderer, |
|
| 269 | - * but outputs the generated strings to standard output. |
|
| 270 | - * |
|
| 271 | - * @return Mailcode_Printer |
|
| 272 | - */ |
|
| 267 | + /** |
|
| 268 | + * Creates a printer instance, which works like the renderer, |
|
| 269 | + * but outputs the generated strings to standard output. |
|
| 270 | + * |
|
| 271 | + * @return Mailcode_Printer |
|
| 272 | + */ |
|
| 273 | 273 | public static function createPrinter() : Mailcode_Printer |
| 274 | 274 | { |
| 275 | 275 | return new Mailcode_Printer(); |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - /** |
|
| 279 | - * Gets/creates the global instance of the date format info |
|
| 280 | - * class, used to handle date formatting aspects. |
|
| 281 | - * |
|
| 282 | - * @return Mailcode_Date_FormatInfo |
|
| 283 | - */ |
|
| 278 | + /** |
|
| 279 | + * Gets/creates the global instance of the date format info |
|
| 280 | + * class, used to handle date formatting aspects. |
|
| 281 | + * |
|
| 282 | + * @return Mailcode_Date_FormatInfo |
|
| 283 | + */ |
|
| 284 | 284 | public static function createDateInfo() : Mailcode_Date_FormatInfo |
| 285 | 285 | { |
| 286 | 286 | return Mailcode_Date_FormatInfo::getInstance(); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | * @param string $formatString A date format string, or empty string for default. |
| 48 | 48 | * @return Mailcode_Commands_Command_ShowDate |
| 49 | 49 | */ |
| 50 | - public static function showDate(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowDate |
|
| 50 | + public static function showDate(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowDate |
|
| 51 | 51 | { |
| 52 | 52 | return self::$commandSets->show()->showDate($variableName, $formatString); |
| 53 | 53 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @see Mailcode_Factory::ERROR_INVALID_COMMAND_CREATED |
| 76 | 76 | */ |
| 77 | - public static function setVar(string $variableName, string $value, bool $quoteValue=true) : Mailcode_Commands_Command_SetVariable |
|
| 77 | + public static function setVar(string $variableName, string $value, bool $quoteValue = true) : Mailcode_Commands_Command_SetVariable |
|
| 78 | 78 | { |
| 79 | 79 | return self::$commandSets->set()->setVar($variableName, $value, $quoteValue); |
| 80 | 80 | } |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | return self::$commandSets->if()->end(); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - public static function if(string $condition, string $type='') : Mailcode_Commands_Command_If |
|
| 110 | + public static function if (string $condition, string $type = '') : Mailcode_Commands_Command_If |
|
| 111 | 111 | { |
| 112 | 112 | return self::$commandSets->if()->if($condition, $type); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - public static function ifVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
| 115 | + public static function ifVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
| 116 | 116 | { |
| 117 | 117 | return self::$commandSets->if()->ifVar($variable, $operand, $value, $quoteValue); |
| 118 | 118 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | return self::$commandSets->if()->ifVarString($variable, $operand, $value); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - public static function ifVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
| 125 | + public static function ifVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
| 126 | 126 | { |
| 127 | 127 | return self::$commandSets->if()->ifVarEquals($variable, $value, $quoteValue); |
| 128 | 128 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return self::$commandSets->if()->ifVarEqualsString($variable, $value); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - public static function ifVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
| 135 | + public static function ifVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
| 136 | 136 | { |
| 137 | 137 | return self::$commandSets->if()->ifVarNotEquals($variable, $value, $quoteValue); |
| 138 | 138 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | return self::$commandSets->if()->ifVarNotEqualsString($variable, $value); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - public static function elseIf(string $condition, string $type='') : Mailcode_Commands_Command_ElseIf |
|
| 145 | + public static function elseIf (string $condition, string $type = '') : Mailcode_Commands_Command_ElseIf |
|
| 146 | 146 | { |
| 147 | 147 | return self::$commandSets->elseIf()->elseIf($condition, $type); |
| 148 | 148 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | return self::$commandSets->elseIf()->elseIfNotEmpty($variable); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - public static function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 160 | + public static function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 161 | 161 | { |
| 162 | 162 | return self::$commandSets->elseIf()->elseIfVar($variable, $operand, $value, $quoteValue); |
| 163 | 163 | } |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | return self::$commandSets->elseIf()->elseIfVarString($variable, $operand, $value); |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | - public static function elseIfVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 170 | + public static function elseIfVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 171 | 171 | { |
| 172 | 172 | return self::$commandSets->elseIf()->elseIfVarEquals($variable, $value, $quoteValue); |
| 173 | 173 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | return self::$commandSets->elseIf()->elseIfVarEqualsString($variable, $value); |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - public static function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 180 | + public static function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 181 | 181 | { |
| 182 | 182 | return self::$commandSets->elseIf()->elseIfVarNotEquals($variable, $value, $quoteValue); |
| 183 | 183 | } |
@@ -187,27 +187,27 @@ discard block |
||
| 187 | 187 | return self::$commandSets->elseIf()->elseIfVarNotEqualsString($variable, $value); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - public static function ifBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_BeginsWith |
|
| 190 | + public static function ifBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_BeginsWith |
|
| 191 | 191 | { |
| 192 | 192 | return self::$commandSets->if()->ifBeginsWith($variable, $search, $caseInsensitive); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - public static function ifEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_EndsWith |
|
| 195 | + public static function ifEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_EndsWith |
|
| 196 | 196 | { |
| 197 | 197 | return self::$commandSets->if()->ifEndsWith($variable, $search, $caseInsensitive); |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - public static function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_BeginsWith |
|
| 200 | + public static function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_BeginsWith |
|
| 201 | 201 | { |
| 202 | 202 | return self::$commandSets->elseIf()->elseIfBeginsWith($variable, $search, $caseInsensitive); |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - public static function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_EndsWith |
|
| 205 | + public static function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_EndsWith |
|
| 206 | 206 | { |
| 207 | 207 | return self::$commandSets->elseIf()->elseIfEndsWith($variable, $search, $caseInsensitive); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - public static function ifContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
|
| 210 | + public static function ifContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains |
|
| 211 | 211 | { |
| 212 | 212 | return self::$commandSets->if()->ifContains($variable, array($search), $caseInsensitive); |
| 213 | 213 | } |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | * @param bool $caseInsensitive |
| 221 | 221 | * @return Mailcode_Commands_Command_If_Contains |
| 222 | 222 | */ |
| 223 | - public static function ifContainsAny(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
|
| 223 | + public static function ifContainsAny(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains |
|
| 224 | 224 | { |
| 225 | 225 | return self::$commandSets->if()->ifContains($variable, $searchTerms, $caseInsensitive); |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - public static function elseIfContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
|
| 228 | + public static function elseIfContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains |
|
| 229 | 229 | { |
| 230 | 230 | return self::$commandSets->elseIf()->elseIfContains($variable, array($search), $caseInsensitive); |
| 231 | 231 | } |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * @param bool $caseInsensitive |
| 239 | 239 | * @return Mailcode_Commands_Command_ElseIf_Contains |
| 240 | 240 | */ |
| 241 | - public static function elseIfContainsAny(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
|
| 241 | + public static function elseIfContainsAny(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains |
|
| 242 | 242 | { |
| 243 | 243 | return self::$commandSets->elseIf()->elseIfContains($variable, $searchTerms, $caseInsensitive); |
| 244 | 244 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | |
| 289 | 289 | public static function init() : void |
| 290 | 290 | { |
| 291 | - if(!isset(self::$commandSets)) |
|
| 291 | + if (!isset(self::$commandSets)) |
|
| 292 | 292 | { |
| 293 | 293 | self::$commandSets = new Mailcode_Factory_CommandSets(); |
| 294 | 294 | } |
@@ -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 |
@@ -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.'), |
@@ -78,13 +78,13 @@ |
||
| 78 | 78 | return $this->buildIf($ifType, $this->filterVariableName($variable), 'not-empty'); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * @param string $ifType |
|
| 83 | - * @param string $variable |
|
| 84 | - * @param string[] $searchTerms |
|
| 85 | - * @param bool $caseInsensitive |
|
| 86 | - * @return Mailcode_Commands_IfBase |
|
| 87 | - */ |
|
| 81 | + /** |
|
| 82 | + * @param string $ifType |
|
| 83 | + * @param string $variable |
|
| 84 | + * @param string[] $searchTerms |
|
| 85 | + * @param bool $caseInsensitive |
|
| 86 | + * @return Mailcode_Commands_IfBase |
|
| 87 | + */ |
|
| 88 | 88 | public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
| 89 | 89 | { |
| 90 | 90 | $keyword = ' '; |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | class Mailcode_Factory_Instantiator |
| 22 | 22 | { |
| 23 | - public function buildIf(string $ifType, string $params, string $type='') : Mailcode_Commands_IfBase |
|
| 23 | + public function buildIf(string $ifType, string $params, string $type = '') : Mailcode_Commands_IfBase |
|
| 24 | 24 | { |
| 25 | 25 | $stringType = $type; |
| 26 | 26 | |
| 27 | - if(!empty($type)) |
|
| 27 | + if (!empty($type)) |
|
| 28 | 28 | { |
| 29 | 29 | $stringType = ' '.$type; |
| 30 | 30 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $this->checkCommand($command); |
| 45 | 45 | |
| 46 | - if($command instanceof Mailcode_Commands_IfBase) |
|
| 46 | + if ($command instanceof Mailcode_Commands_IfBase) |
|
| 47 | 47 | { |
| 48 | 48 | return $command; |
| 49 | 49 | } |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | throw $this->exceptionUnexpectedType('IfBase', $command); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_IfBase |
|
| 54 | + public function buildIfVar(string $ifType, string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_IfBase |
|
| 55 | 55 | { |
| 56 | - if($quoteValue) |
|
| 56 | + if ($quoteValue) |
|
| 57 | 57 | { |
| 58 | 58 | $value = $this->quoteString($value); |
| 59 | 59 | } |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | * @param bool $caseInsensitive |
| 86 | 86 | * @return Mailcode_Commands_IfBase |
| 87 | 87 | */ |
| 88 | - public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
| 88 | + public function buildIfContains(string $ifType, string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
| 89 | 89 | { |
| 90 | 90 | $keyword = ' '; |
| 91 | 91 | |
| 92 | - if($caseInsensitive) |
|
| 92 | + if ($caseInsensitive) |
|
| 93 | 93 | { |
| 94 | 94 | $keyword = ' insensitive: '; |
| 95 | 95 | } |
@@ -104,21 +104,21 @@ discard block |
||
| 104 | 104 | return $this->buildIf($ifType, $condition, 'contains'); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
| 107 | + public function buildIfBeginsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
| 108 | 108 | { |
| 109 | 109 | return $this->buildIfSearch($ifType, 'begins-with', $variable, $search, $caseInsensitive); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
| 112 | + public function buildIfEndsWith(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
| 113 | 113 | { |
| 114 | 114 | return $this->buildIfSearch($ifType, 'ends-with', $variable, $search, $caseInsensitive); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
| 117 | + private function buildIfSearch(string $ifType, string $subType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
| 118 | 118 | { |
| 119 | 119 | $keyword = ' '; |
| 120 | 120 | |
| 121 | - if($caseInsensitive) |
|
| 121 | + if ($caseInsensitive) |
|
| 122 | 122 | { |
| 123 | 123 | $keyword = ' insensitive: '; |
| 124 | 124 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | public function checkCommand(Mailcode_Commands_Command $command) : void |
| 149 | 149 | { |
| 150 | - if($command->isValid()) |
|
| 150 | + if ($command->isValid()) |
|
| 151 | 151 | { |
| 152 | 152 | return; |
| 153 | 153 | } |
@@ -104,12 +104,12 @@ |
||
| 104 | 104 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarNotEqualsString', $command); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - /** |
|
| 108 | - * @param string $variable |
|
| 109 | - * @param string[] $searchTerms |
|
| 110 | - * @param bool $caseInsensitive |
|
| 111 | - * @return Mailcode_Commands_Command_ElseIf_Contains |
|
| 112 | - */ |
|
| 107 | + /** |
|
| 108 | + * @param string $variable |
|
| 109 | + * @param string[] $searchTerms |
|
| 110 | + * @param bool $caseInsensitive |
|
| 111 | + * @return Mailcode_Commands_Command_ElseIf_Contains |
|
| 112 | + */ |
|
| 113 | 113 | public function elseIfContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
| 114 | 114 | { |
| 115 | 115 | $command = $this->instantiator->buildIfContains('ElseIf', $variable, $searchTerms, $caseInsensitive); |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | class Mailcode_Factory_CommandSets_Set_ElseIf extends Mailcode_Factory_CommandSets_IfBase |
| 22 | 22 | { |
| 23 | - public function elseIf(string $condition, string $type='') : Mailcode_Commands_Command_ElseIf |
|
| 23 | + public function elseIf (string $condition, string $type = '') : Mailcode_Commands_Command_ElseIf |
|
| 24 | 24 | { |
| 25 | 25 | $command = $this->instantiator->buildIf('ElseIf', $condition, $type); |
| 26 | 26 | |
| 27 | - if($command instanceof Mailcode_Commands_Command_ElseIf) |
|
| 27 | + if ($command instanceof Mailcode_Commands_Command_ElseIf) |
|
| 28 | 28 | { |
| 29 | 29 | return $command; |
| 30 | 30 | } |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | throw $this->instantiator->exceptionUnexpectedType('ElseIf', $command); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 35 | + public function elseIfVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 36 | 36 | { |
| 37 | 37 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, $operand, $value, $quoteValue); |
| 38 | 38 | |
| 39 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 39 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 40 | 40 | { |
| 41 | 41 | return $command; |
| 42 | 42 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, $operand, $value, true); |
| 50 | 50 | |
| 51 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 51 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 52 | 52 | { |
| 53 | 53 | return $command; |
| 54 | 54 | } |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarString', $command); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - public function elseIfVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 59 | + public function elseIfVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 60 | 60 | { |
| 61 | 61 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '==', $value, $quoteValue); |
| 62 | 62 | |
| 63 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 63 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 64 | 64 | { |
| 65 | 65 | return $command; |
| 66 | 66 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '==', $value, true); |
| 74 | 74 | |
| 75 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 75 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 76 | 76 | { |
| 77 | 77 | return $command; |
| 78 | 78 | } |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarEqualsString', $command); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - public function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 83 | + public function elseIfVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_ElseIf_Variable |
|
| 84 | 84 | { |
| 85 | 85 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, $quoteValue); |
| 86 | 86 | |
| 87 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 87 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 88 | 88 | { |
| 89 | 89 | return $command; |
| 90 | 90 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $command = $this->instantiator->buildIfVar('ElseIf', $variable, '!=', $value, true); |
| 98 | 98 | |
| 99 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 99 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 100 | 100 | { |
| 101 | 101 | return $command; |
| 102 | 102 | } |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | * @param bool $caseInsensitive |
| 111 | 111 | * @return Mailcode_Commands_Command_ElseIf_Contains |
| 112 | 112 | */ |
| 113 | - public function elseIfContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
|
| 113 | + public function elseIfContains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains |
|
| 114 | 114 | { |
| 115 | 115 | $command = $this->instantiator->buildIfContains('ElseIf', $variable, $searchTerms, $caseInsensitive); |
| 116 | 116 | |
| 117 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
| 117 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
| 118 | 118 | { |
| 119 | 119 | return $command; |
| 120 | 120 | } |
@@ -122,11 +122,11 @@ discard block |
||
| 122 | 122 | throw $this->instantiator->exceptionUnexpectedType('ElseIfContains', $command); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - public function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_BeginsWith |
|
| 125 | + public function elseIfBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_BeginsWith |
|
| 126 | 126 | { |
| 127 | 127 | $command = $this->instantiator->buildIfBeginsWith('ElseIf', $variable, $search, $caseInsensitive); |
| 128 | 128 | |
| 129 | - if($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith) |
|
| 129 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_BeginsWith) |
|
| 130 | 130 | { |
| 131 | 131 | return $command; |
| 132 | 132 | } |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | throw $this->instantiator->exceptionUnexpectedType('ElseIfBeginsWith', $command); |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | - public function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_EndsWith |
|
| 137 | + public function elseIfEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_EndsWith |
|
| 138 | 138 | { |
| 139 | 139 | $command = $this->instantiator->buildIfEndsWith('ElseIf', $variable, $search, $caseInsensitive); |
| 140 | 140 | |
| 141 | - if($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith) |
|
| 141 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_EndsWith) |
|
| 142 | 142 | { |
| 143 | 143 | return $command; |
| 144 | 144 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $command = $this->instantiator->buildIfEmpty('ElseIf', $variable); |
| 152 | 152 | |
| 153 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
| 153 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
| 154 | 154 | { |
| 155 | 155 | return $command; |
| 156 | 156 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | { |
| 163 | 163 | $command = $this->instantiator->buildIfNotEmpty('ElseIf', $variable); |
| 164 | 164 | |
| 165 | - if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
| 165 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
| 166 | 166 | { |
| 167 | 167 | return $command; |
| 168 | 168 | } |