@@ -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,12 +187,12 @@ discard block |
||
| 187 | 187 | return self::$commandSets->elseIf()->elseIfVarNotEqualsString($variable, $value); |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - public static function ifContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
|
| 190 | + public static function ifContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains |
|
| 191 | 191 | { |
| 192 | 192 | return self::$commandSets->if()->ifContains($variable, $search, $caseInsensitive); |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - public static function elseIfContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
|
| 195 | + public static function elseIfContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains |
|
| 196 | 196 | { |
| 197 | 197 | return self::$commandSets->elseIf()->elseIfContains($variable, $search, $caseInsensitive); |
| 198 | 198 | } |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | public static function init() : void |
| 244 | 244 | { |
| 245 | - if(!isset(self::$commandSets)) |
|
| 245 | + if (!isset(self::$commandSets)) |
|
| 246 | 246 | { |
| 247 | 247 | self::$commandSets = new Mailcode_Factory_CommandSets(); |
| 248 | 248 | } |
@@ -22,27 +22,27 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | public function translate(Mailcode_Commands_Command_ElseIf $command): string |
| 24 | 24 | { |
| 25 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Command) |
|
| 25 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Command) |
|
| 26 | 26 | { |
| 27 | 27 | return $this->translateCommand($command); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 30 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Variable) |
|
| 31 | 31 | { |
| 32 | 32 | return $this->translateVariable($command); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
| 35 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
| 36 | 36 | { |
| 37 | 37 | return $this->translateContains($command); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
| 40 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
| 41 | 41 | { |
| 42 | 42 | return $this->translateEmpty($command); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
| 45 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
| 46 | 46 | { |
| 47 | 47 | return $this->translateNotEmpty($command); |
| 48 | 48 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $params = $command->getParams(); |
| 56 | 56 | |
| 57 | - if(!$params) |
|
| 57 | + if (!$params) |
|
| 58 | 58 | { |
| 59 | 59 | return ''; |
| 60 | 60 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | protected function translateContains(Mailcode_Commands_Command_ElseIf_Contains $command) : string |
| 79 | 79 | { |
| 80 | 80 | $opts = 's'; |
| 81 | - if($command->isCaseInsensitive()) |
|
| 81 | + if ($command->isCaseInsensitive()) |
|
| 82 | 82 | { |
| 83 | 83 | $opts = 'is'; |
| 84 | 84 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $sign = ''; |
| 107 | 107 | |
| 108 | - if($notEmpty) |
|
| 108 | + if ($notEmpty) |
|
| 109 | 109 | { |
| 110 | 110 | $sign = '!'; |
| 111 | 111 | } |
@@ -22,27 +22,27 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | public function translate(Mailcode_Commands_Command_If $command): string |
| 24 | 24 | { |
| 25 | - if($command instanceof Mailcode_Commands_Command_If_Command) |
|
| 25 | + if ($command instanceof Mailcode_Commands_Command_If_Command) |
|
| 26 | 26 | { |
| 27 | 27 | return $this->translateCommand($command); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 30 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 31 | 31 | { |
| 32 | 32 | return $this->translateVariable($command); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - if($command instanceof Mailcode_Commands_Command_If_Contains) |
|
| 35 | + if ($command instanceof Mailcode_Commands_Command_If_Contains) |
|
| 36 | 36 | { |
| 37 | 37 | return $this->translateContains($command); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if($command instanceof Mailcode_Commands_Command_If_Empty) |
|
| 40 | + if ($command instanceof Mailcode_Commands_Command_If_Empty) |
|
| 41 | 41 | { |
| 42 | 42 | return $this->translateEmpty($command); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if($command instanceof Mailcode_Commands_Command_If_NotEmpty) |
|
| 45 | + if ($command instanceof Mailcode_Commands_Command_If_NotEmpty) |
|
| 46 | 46 | { |
| 47 | 47 | return $this->translateNotEmpty($command); |
| 48 | 48 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | $params = $command->getParams(); |
| 56 | 56 | |
| 57 | - if(!$params) |
|
| 57 | + if (!$params) |
|
| 58 | 58 | { |
| 59 | 59 | return ''; |
| 60 | 60 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | protected function translateContains(Mailcode_Commands_Command_If_Contains $command) : string |
| 79 | 79 | { |
| 80 | 80 | $opts = 's'; |
| 81 | - if($command->isCaseInsensitive()) |
|
| 81 | + if ($command->isCaseInsensitive()) |
|
| 82 | 82 | { |
| 83 | 83 | $opts = 'is'; |
| 84 | 84 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $sign = ''; |
| 107 | 107 | |
| 108 | - if($notEmpty) |
|
| 108 | + if ($notEmpty) |
|
| 109 | 109 | { |
| 110 | 110 | $sign = '!'; |
| 111 | 111 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $variable = $info->getVariableByIndex(0); |
| 43 | 43 | |
| 44 | - if($variable !== null) |
|
| 44 | + if ($variable !== null) |
|
| 45 | 45 | { |
| 46 | 46 | $this->variableToken = $variable; |
| 47 | 47 | return; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function getVariable() : Mailcode_Variables_Variable |
| 62 | 62 | { |
| 63 | - if($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) |
|
| 63 | + if ($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) |
|
| 64 | 64 | { |
| 65 | 65 | return $this->variableToken->getVariable(); |
| 66 | 66 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $variable = $info->getVariableByIndex(0); |
| 43 | 43 | |
| 44 | - if($variable !== null) |
|
| 44 | + if ($variable !== null) |
|
| 45 | 45 | { |
| 46 | 46 | $this->variableToken = $variable; |
| 47 | 47 | return; |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function getVariable() : Mailcode_Variables_Variable |
| 62 | 62 | { |
| 63 | - if($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) |
|
| 63 | + if ($this->variableToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Variable) |
|
| 64 | 64 | { |
| 65 | 65 | return $this->variableToken->getVariable(); |
| 66 | 66 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | $this->instantiator->checkCommand($cmd); |
| 43 | 43 | |
| 44 | - if($cmd instanceof Mailcode_Commands_Command_End) |
|
| 44 | + if ($cmd instanceof Mailcode_Commands_Command_End) |
|
| 45 | 45 | { |
| 46 | 46 | return $cmd; |
| 47 | 47 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | $this->instantiator->checkCommand($cmd); |
| 33 | 33 | |
| 34 | - if($cmd instanceof Mailcode_Commands_Command_Else) |
|
| 34 | + if ($cmd instanceof Mailcode_Commands_Command_Else) |
|
| 35 | 35 | { |
| 36 | 36 | return $cmd; |
| 37 | 37 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | $this->instantiator->checkCommand($cmd); |
| 35 | 35 | |
| 36 | - if($cmd instanceof Mailcode_Commands_Command_ShowVariable) |
|
| 36 | + if ($cmd instanceof Mailcode_Commands_Command_ShowVariable) |
|
| 37 | 37 | { |
| 38 | 38 | return $cmd; |
| 39 | 39 | } |
@@ -41,12 +41,12 @@ discard block |
||
| 41 | 41 | throw $this->instantiator->exceptionUnexpectedType('ShowVariable', $cmd); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public function showDate(string $variableName, string $formatString="") : Mailcode_Commands_Command_ShowDate |
|
| 44 | + public function showDate(string $variableName, string $formatString = "") : Mailcode_Commands_Command_ShowDate |
|
| 45 | 45 | { |
| 46 | 46 | $variableName = $this->instantiator->filterVariableName($variableName); |
| 47 | 47 | |
| 48 | 48 | $format = ''; |
| 49 | - if(!empty($formatString)) |
|
| 49 | + if (!empty($formatString)) |
|
| 50 | 50 | { |
| 51 | 51 | $format = sprintf( |
| 52 | 52 | ' "%s"', |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | $this->instantiator->checkCommand($cmd); |
| 69 | 69 | |
| 70 | - if($cmd instanceof Mailcode_Commands_Command_ShowDate) |
|
| 70 | + if ($cmd instanceof Mailcode_Commands_Command_ShowDate) |
|
| 71 | 71 | { |
| 72 | 72 | return $cmd; |
| 73 | 73 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $this->instantiator->checkCommand($cmd); |
| 90 | 90 | |
| 91 | - if($cmd instanceof Mailcode_Commands_Command_ShowSnippet) |
|
| 91 | + if ($cmd instanceof Mailcode_Commands_Command_ShowSnippet) |
|
| 92 | 92 | { |
| 93 | 93 | return $cmd; |
| 94 | 94 | } |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | class Mailcode_Factory_CommandSets_Set_Set extends Mailcode_Factory_CommandSets_Set |
| 22 | 22 | { |
| 23 | - public function setVar(string $variableName, string $value, bool $quoteValue=true) : Mailcode_Commands_Command_SetVariable |
|
| 23 | + public function setVar(string $variableName, string $value, bool $quoteValue = true) : Mailcode_Commands_Command_SetVariable |
|
| 24 | 24 | { |
| 25 | 25 | $variableName = $this->instantiator->filterVariableName($variableName); |
| 26 | 26 | |
| 27 | - if($quoteValue) |
|
| 27 | + if ($quoteValue) |
|
| 28 | 28 | { |
| 29 | 29 | $value = $this->instantiator->quoteString($value); |
| 30 | 30 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $this->instantiator->checkCommand($cmd); |
| 42 | 42 | |
| 43 | - if($cmd instanceof Mailcode_Commands_Command_SetVariable) |
|
| 43 | + if ($cmd instanceof Mailcode_Commands_Command_SetVariable) |
|
| 44 | 44 | { |
| 45 | 45 | return $cmd; |
| 46 | 46 | } |