@@ -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 | } |
@@ -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 | } |
@@ -78,11 +78,11 @@ discard block |
||
78 | 78 | return $this->buildIf($ifType, $this->filterVariableName($variable), 'not-empty'); |
79 | 79 | } |
80 | 80 | |
81 | - public function buildIfContains(string $ifType, string $variable, string $search, bool $caseInsensitive=false) : Mailcode_Commands_IfBase |
|
81 | + public function buildIfContains(string $ifType, string $variable, string $search, bool $caseInsensitive = false) : Mailcode_Commands_IfBase |
|
82 | 82 | { |
83 | 83 | $keyword = ' '; |
84 | 84 | |
85 | - if($caseInsensitive) |
|
85 | + if ($caseInsensitive) |
|
86 | 86 | { |
87 | 87 | $keyword = ' insensitive: '; |
88 | 88 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | public function checkCommand(Mailcode_Commands_Command $command) : void |
108 | 108 | { |
109 | - if($command->isValid()) |
|
109 | + if ($command->isValid()) |
|
110 | 110 | { |
111 | 111 | return; |
112 | 112 | } |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | */ |
46 | 46 | private $elseIf; |
47 | 47 | |
48 | - public function if() : Mailcode_Factory_CommandSets_Set_If |
|
48 | + public function if () : Mailcode_Factory_CommandSets_Set_If |
|
49 | 49 | { |
50 | - if(!isset($this->if)) |
|
50 | + if (!isset($this->if)) |
|
51 | 51 | { |
52 | 52 | $this->if = new Mailcode_Factory_CommandSets_Set_If(); |
53 | 53 | } |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | return $this->if; |
56 | 56 | } |
57 | 57 | |
58 | - public function elseIf() : Mailcode_Factory_CommandSets_Set_ElseIf |
|
58 | + public function elseIf () : Mailcode_Factory_CommandSets_Set_ElseIf |
|
59 | 59 | { |
60 | - if(!isset($this->elseIf)) |
|
60 | + if (!isset($this->elseIf)) |
|
61 | 61 | { |
62 | 62 | $this->elseIf = new Mailcode_Factory_CommandSets_Set_ElseIf(); |
63 | 63 | } |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | |
68 | 68 | public function show() : Mailcode_Factory_CommandSets_Set_Show |
69 | 69 | { |
70 | - if(!isset($this->show)) |
|
70 | + if (!isset($this->show)) |
|
71 | 71 | { |
72 | 72 | $this->show = new Mailcode_Factory_CommandSets_Set_Show(); |
73 | 73 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | public function misc() : Mailcode_Factory_CommandSets_Set_Misc |
79 | 79 | { |
80 | - if(!isset($this->misc)) |
|
80 | + if (!isset($this->misc)) |
|
81 | 81 | { |
82 | 82 | $this->misc = new Mailcode_Factory_CommandSets_Set_Misc(); |
83 | 83 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | public function set() : Mailcode_Factory_CommandSets_Set_Set |
89 | 89 | { |
90 | - if(!isset($this->set)) |
|
90 | + if (!isset($this->set)) |
|
91 | 91 | { |
92 | 92 | $this->set = new Mailcode_Factory_CommandSets_Set_Set(); |
93 | 93 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function setDelimiter(string $delimiter) : Mailcode_Parser_Safeguard |
136 | 136 | { |
137 | - if(empty($delimiter)) |
|
137 | + if (empty($delimiter)) |
|
138 | 138 | { |
139 | 139 | throw new Mailcode_Exception( |
140 | 140 | 'Empty delimiter', |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | $safe = str_replace(array_values($replaces), array_keys($replaces), $this->originalString); |
187 | 187 | |
188 | 188 | // If a formatter has been selected, let it modify the string. |
189 | - if(isset($this->formatter)) |
|
189 | + if (isset($this->formatter)) |
|
190 | 190 | { |
191 | 191 | $safe = $this->formatter->format($safe); |
192 | 192 | } |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | { |
199 | 199 | $class = 'Mailcode\Mailcode_Parser_Safeguard_Formatter_'.$formatterID; |
200 | 200 | |
201 | - if(class_exists($class)) |
|
201 | + if (class_exists($class)) |
|
202 | 202 | { |
203 | 203 | $this->formatter = new $class($this); |
204 | 204 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | { |
225 | 225 | $formatter = $this->selectFormatter('SingleLines'); |
226 | 226 | |
227 | - if($formatter instanceof Mailcode_Parser_Safeguard_Formatter_SingleLines) |
|
227 | + if ($formatter instanceof Mailcode_Parser_Safeguard_Formatter_SingleLines) |
|
228 | 228 | { |
229 | 229 | return $formatter; |
230 | 230 | } |
@@ -246,17 +246,17 @@ discard block |
||
246 | 246 | * @param bool $highlighted |
247 | 247 | * @return string[]string |
248 | 248 | */ |
249 | - protected function getReplaces(bool $highlighted=false) : array |
|
249 | + protected function getReplaces(bool $highlighted = false) : array |
|
250 | 250 | { |
251 | 251 | $placeholders = $this->getPlaceholders(); |
252 | 252 | |
253 | 253 | $replaces = array(); |
254 | 254 | |
255 | - foreach($placeholders as $placeholder) |
|
255 | + foreach ($placeholders as $placeholder) |
|
256 | 256 | { |
257 | 257 | $replace = ''; |
258 | 258 | |
259 | - if($highlighted) |
|
259 | + if ($highlighted) |
|
260 | 260 | { |
261 | 261 | $replace = $placeholder->getHighlightedText(); |
262 | 262 | } |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | */ |
281 | 281 | public function getPlaceholders() |
282 | 282 | { |
283 | - if(isset($this->placeholders)) |
|
283 | + if (isset($this->placeholders)) |
|
284 | 284 | { |
285 | 285 | return $this->placeholders; |
286 | 286 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | $cmds = $this->getCollection()->getGroupedByHash(); |
291 | 291 | |
292 | - foreach($cmds as $command) |
|
292 | + foreach ($cmds as $command) |
|
293 | 293 | { |
294 | 294 | self::$counter++; |
295 | 295 | |
@@ -303,9 +303,9 @@ discard block |
||
303 | 303 | return $this->placeholders; |
304 | 304 | } |
305 | 305 | |
306 | - protected function restore(string $string, bool $partial=false, bool $highlighted=false) : string |
|
306 | + protected function restore(string $string, bool $partial = false, bool $highlighted = false) : string |
|
307 | 307 | { |
308 | - if(!$partial) |
|
308 | + if (!$partial) |
|
309 | 309 | { |
310 | 310 | $this->requireValidCollection(); |
311 | 311 | } |
@@ -314,9 +314,9 @@ discard block |
||
314 | 314 | |
315 | 315 | $placeholderStrings = array_keys($replaces); |
316 | 316 | |
317 | - foreach($placeholderStrings as $search) |
|
317 | + foreach ($placeholderStrings as $search) |
|
318 | 318 | { |
319 | - if(!$partial && !strstr($string, $search)) |
|
319 | + if (!$partial && !strstr($string, $search)) |
|
320 | 320 | { |
321 | 321 | throw new Mailcode_Exception( |
322 | 322 | 'Command placeholder not found', |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | */ |
419 | 419 | public function getCollection() : Mailcode_Collection |
420 | 420 | { |
421 | - if(isset($this->collection)) |
|
421 | + if (isset($this->collection)) |
|
422 | 422 | { |
423 | 423 | return $this->collection; |
424 | 424 | } |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | */ |
441 | 441 | protected function requireValidCollection() : void |
442 | 442 | { |
443 | - if($this->getCollection()->isValid()) |
|
443 | + if ($this->getCollection()->isValid()) |
|
444 | 444 | { |
445 | 445 | return; |
446 | 446 | } |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | */ |
464 | 464 | public function getPlaceholderStrings() : array |
465 | 465 | { |
466 | - if(is_array($this->placeholderStrings)) |
|
466 | + if (is_array($this->placeholderStrings)) |
|
467 | 467 | { |
468 | 468 | return $this->placeholderStrings; |
469 | 469 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | |
473 | 473 | $this->placeholderStrings = array(); |
474 | 474 | |
475 | - foreach($placeholders as $placeholder) |
|
475 | + foreach ($placeholders as $placeholder) |
|
476 | 476 | { |
477 | 477 | $this->placeholderStrings[] = $placeholder->getReplacementText(); |
478 | 478 | } |
@@ -498,9 +498,9 @@ discard block |
||
498 | 498 | { |
499 | 499 | $placeholders = $this->getPlaceholders(); |
500 | 500 | |
501 | - foreach($placeholders as $placeholder) |
|
501 | + foreach ($placeholders as $placeholder) |
|
502 | 502 | { |
503 | - if($placeholder->getID() === $id) |
|
503 | + if ($placeholder->getID() === $id) |
|
504 | 504 | { |
505 | 505 | return $placeholder; |
506 | 506 | } |
@@ -527,9 +527,9 @@ discard block |
||
527 | 527 | { |
528 | 528 | $placeholders = $this->getPlaceholders(); |
529 | 529 | |
530 | - foreach($placeholders as $placeholder) |
|
530 | + foreach ($placeholders as $placeholder) |
|
531 | 531 | { |
532 | - if($placeholder->getReplacementText() === $string) |
|
532 | + if ($placeholder->getReplacementText() === $string) |
|
533 | 533 | { |
534 | 534 | return $placeholder; |
535 | 535 | } |
@@ -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 | } |