@@ -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 | } |
@@ -128,12 +128,12 @@ |
||
| 128 | 128 | throw $this->instantiator->exceptionUnexpectedType('IfNotEmpty', $command); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - /** |
|
| 132 | - * @param string $variable |
|
| 133 | - * @param string[] $searchTerms |
|
| 134 | - * @param bool $caseInsensitive |
|
| 135 | - * @return Mailcode_Commands_Command_If_Contains |
|
| 136 | - */ |
|
| 131 | + /** |
|
| 132 | + * @param string $variable |
|
| 133 | + * @param string[] $searchTerms |
|
| 134 | + * @param bool $caseInsensitive |
|
| 135 | + * @return Mailcode_Commands_Command_If_Contains |
|
| 136 | + */ |
|
| 137 | 137 | public function ifContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
| 138 | 138 | { |
| 139 | 139 | $command = $this->instantiator->buildIfContains('If', $variable, $searchTerms, $caseInsensitive); |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | class Mailcode_Factory_CommandSets_Set_If extends Mailcode_Factory_CommandSets_IfBase |
| 22 | 22 | { |
| 23 | - public function if(string $condition, string $type='') : Mailcode_Commands_Command_If |
|
| 23 | + public function if (string $condition, string $type = '') : Mailcode_Commands_Command_If |
|
| 24 | 24 | { |
| 25 | 25 | $command = $this->instantiator->buildIf('If', $condition, $type); |
| 26 | 26 | |
| 27 | - if($command instanceof Mailcode_Commands_Command_If) |
|
| 27 | + if ($command instanceof Mailcode_Commands_Command_If) |
|
| 28 | 28 | { |
| 29 | 29 | return $command; |
| 30 | 30 | } |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | throw $this->instantiator->exceptionUnexpectedType('If', $command); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function ifVar(string $variable, string $operand, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
| 35 | + public function ifVar(string $variable, string $operand, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
| 36 | 36 | { |
| 37 | 37 | $command = $this->instantiator->buildIfVar('If', $variable, $operand, $value, $quoteValue); |
| 38 | 38 | |
| 39 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 39 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 40 | 40 | { |
| 41 | 41 | return $command; |
| 42 | 42 | } |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $command = $this->instantiator->buildIfVar('If', $variable, $operand, $value, true); |
| 50 | 50 | |
| 51 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 51 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 52 | 52 | { |
| 53 | 53 | return $command; |
| 54 | 54 | } |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | throw $this->instantiator->exceptionUnexpectedType('IfVarString', $command); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - public function ifVarEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
| 59 | + public function ifVarEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
| 60 | 60 | { |
| 61 | 61 | $command = $this->instantiator->buildIfVar('If', $variable, '==', $value, $quoteValue); |
| 62 | 62 | |
| 63 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 63 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 64 | 64 | { |
| 65 | 65 | return $command; |
| 66 | 66 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $command = $this->instantiator->buildIfVar('If', $variable, '==', $value, true); |
| 74 | 74 | |
| 75 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 75 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 76 | 76 | { |
| 77 | 77 | return $command; |
| 78 | 78 | } |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | throw $this->instantiator->exceptionUnexpectedType('IfarEqualsString', $command); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - public function ifVarNotEquals(string $variable, string $value, bool $quoteValue=false) : Mailcode_Commands_Command_If_Variable |
|
| 83 | + public function ifVarNotEquals(string $variable, string $value, bool $quoteValue = false) : Mailcode_Commands_Command_If_Variable |
|
| 84 | 84 | { |
| 85 | 85 | $command = $this->instantiator->buildIfVar('If', $variable, '!=', $value, $quoteValue); |
| 86 | 86 | |
| 87 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 87 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 88 | 88 | { |
| 89 | 89 | return $command; |
| 90 | 90 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | { |
| 97 | 97 | $command = $this->instantiator->buildIfVar('If', $variable, '!=', $value, true); |
| 98 | 98 | |
| 99 | - if($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 99 | + if ($command instanceof Mailcode_Commands_Command_If_Variable) |
|
| 100 | 100 | { |
| 101 | 101 | return $command; |
| 102 | 102 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | { |
| 109 | 109 | $command = $this->instantiator->buildIfEmpty('If', $variable); |
| 110 | 110 | |
| 111 | - if($command instanceof Mailcode_Commands_Command_If_Empty) |
|
| 111 | + if ($command instanceof Mailcode_Commands_Command_If_Empty) |
|
| 112 | 112 | { |
| 113 | 113 | return $command; |
| 114 | 114 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $command = $this->instantiator->buildIfNotEmpty('If', $variable); |
| 122 | 122 | |
| 123 | - if($command instanceof Mailcode_Commands_Command_If_NotEmpty) |
|
| 123 | + if ($command instanceof Mailcode_Commands_Command_If_NotEmpty) |
|
| 124 | 124 | { |
| 125 | 125 | return $command; |
| 126 | 126 | } |
@@ -134,11 +134,11 @@ discard block |
||
| 134 | 134 | * @param bool $caseInsensitive |
| 135 | 135 | * @return Mailcode_Commands_Command_If_Contains |
| 136 | 136 | */ |
| 137 | - public function ifContains(string $variable, array $searchTerms, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
|
| 137 | + public function ifContains(string $variable, array $searchTerms, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains |
|
| 138 | 138 | { |
| 139 | 139 | $command = $this->instantiator->buildIfContains('If', $variable, $searchTerms, $caseInsensitive); |
| 140 | 140 | |
| 141 | - if($command instanceof Mailcode_Commands_Command_If_Contains) |
|
| 141 | + if ($command instanceof Mailcode_Commands_Command_If_Contains) |
|
| 142 | 142 | { |
| 143 | 143 | return $command; |
| 144 | 144 | } |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | throw $this->instantiator->exceptionUnexpectedType('IfContains', $command); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - public function ifBeginsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_BeginsWith |
|
| 149 | + public function ifBeginsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_BeginsWith |
|
| 150 | 150 | { |
| 151 | 151 | $command = $this->instantiator->buildIfBeginsWith('If', $variable, $search, $caseInsensitive); |
| 152 | 152 | |
| 153 | - if($command instanceof Mailcode_Commands_Command_If_BeginsWith) |
|
| 153 | + if ($command instanceof Mailcode_Commands_Command_If_BeginsWith) |
|
| 154 | 154 | { |
| 155 | 155 | return $command; |
| 156 | 156 | } |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | throw $this->instantiator->exceptionUnexpectedType('IfBeginsWith', $command); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - public function ifEndsWith(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_EndsWith |
|
| 161 | + public function ifEndsWith(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_EndsWith |
|
| 162 | 162 | { |
| 163 | 163 | $command = $this->instantiator->buildIfEndsWith('If', $variable, $search, $caseInsensitive); |
| 164 | 164 | |
| 165 | - if($command instanceof Mailcode_Commands_Command_If_EndsWith) |
|
| 165 | + if ($command instanceof Mailcode_Commands_Command_If_EndsWith) |
|
| 166 | 166 | { |
| 167 | 167 | return $command; |
| 168 | 168 | } |
@@ -20,9 +20,9 @@ discard block |
||
| 20 | 20 | */ |
| 21 | 21 | abstract class Mailcode_Translator_Syntax_ApacheVelocity extends Mailcode_Translator_Command |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * @var string[] |
|
| 25 | - */ |
|
| 23 | + /** |
|
| 24 | + * @var string[] |
|
| 25 | + */ |
|
| 26 | 26 | private $regexSpecialChars = array( |
| 27 | 27 | '?', |
| 28 | 28 | '.', |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | ')' |
| 42 | 42 | ); |
| 43 | 43 | |
| 44 | - /** |
|
| 45 | - * Filters the string for use in an Apache Velocity (Java) |
|
| 46 | - * regex string: escapes all special characters. |
|
| 47 | - * |
|
| 48 | - * @param string $string |
|
| 49 | - * @return string |
|
| 50 | - */ |
|
| 44 | + /** |
|
| 45 | + * Filters the string for use in an Apache Velocity (Java) |
|
| 46 | + * regex string: escapes all special characters. |
|
| 47 | + * |
|
| 48 | + * @param string $string |
|
| 49 | + * @return string |
|
| 50 | + */ |
|
| 51 | 51 | protected function filterRegexString(string $string) : string |
| 52 | 52 | { |
| 53 | 53 | // Special case: previously escaped quotes. |
@@ -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 | } |