@@ -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 @@ |
||
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 | } |
@@ -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 | } |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | throw $this->instantiator->exceptionUnexpectedType('ElseIfVarNotEqualsString', $command); |
105 | 105 | } |
106 | 106 | |
107 | - public function elseIfContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_ElseIf_Contains |
|
107 | + public function elseIfContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_ElseIf_Contains |
|
108 | 108 | { |
109 | 109 | $command = $this->instantiator->buildIfContains('ElseIf', $variable, $search, $caseInsensitive); |
110 | 110 | |
111 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
111 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Contains) |
|
112 | 112 | { |
113 | 113 | return $command; |
114 | 114 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | { |
121 | 121 | $command = $this->instantiator->buildIfEmpty('ElseIf', $variable); |
122 | 122 | |
123 | - if($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
123 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_Empty) |
|
124 | 124 | { |
125 | 125 | return $command; |
126 | 126 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | { |
133 | 133 | $command = $this->instantiator->buildIfNotEmpty('ElseIf', $variable); |
134 | 134 | |
135 | - if($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
135 | + if ($command instanceof Mailcode_Commands_Command_ElseIf_NotEmpty) |
|
136 | 136 | { |
137 | 137 | return $command; |
138 | 138 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | $this->instantiator->checkCommand($cmd); |
36 | 36 | |
37 | - if($cmd instanceof Mailcode_Commands_Command_Comment) |
|
37 | + if ($cmd instanceof Mailcode_Commands_Command_Comment) |
|
38 | 38 | { |
39 | 39 | return $cmd; |
40 | 40 | } |
@@ -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 | } |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | throw $this->instantiator->exceptionUnexpectedType('IfNotEmpty', $command); |
129 | 129 | } |
130 | 130 | |
131 | - public function ifContains(string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_Command_If_Contains |
|
131 | + public function ifContains(string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_Command_If_Contains |
|
132 | 132 | { |
133 | 133 | $command = $this->instantiator->buildIfContains('If', $variable, $search, $caseInsensitive); |
134 | 134 | |
135 | - if($command instanceof Mailcode_Commands_Command_If_Contains) |
|
135 | + if ($command instanceof Mailcode_Commands_Command_If_Contains) |
|
136 | 136 | { |
137 | 137 | return $command; |
138 | 138 | } |