@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function setEncodingEnabled(string $keyword, bool $enabled) : self |
54 | 54 | { |
55 | - if(!$this->supportsEncoding($keyword)) |
|
55 | + if (!$this->supportsEncoding($keyword)) |
|
56 | 56 | { |
57 | 57 | throw new Mailcode_Exception( |
58 | 58 | 'Cannot set encoding status, command does not support target encoding.', |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | { |
87 | 87 | $name = $keyword->getKeyword(); |
88 | 88 | |
89 | - if($this->supportsEncoding($name) && $this->isEncodingEnabled($name)) |
|
89 | + if ($this->supportsEncoding($name) && $this->isEncodingEnabled($name)) |
|
90 | 90 | { |
91 | 91 | $result[] = $name; |
92 | 92 | } |
@@ -99,22 +99,22 @@ discard block |
||
99 | 99 | { |
100 | 100 | $encodings = array(); |
101 | 101 | |
102 | - if($this instanceof IDNEncodeInterface) |
|
102 | + if ($this instanceof IDNEncodeInterface) |
|
103 | 103 | { |
104 | 104 | $encodings[] = Mailcode_Commands_Keywords::TYPE_IDN_ENCODE; |
105 | 105 | } |
106 | 106 | |
107 | - if($this instanceof IDNDecodeInterface) |
|
107 | + if ($this instanceof IDNDecodeInterface) |
|
108 | 108 | { |
109 | 109 | $encodings[] = Mailcode_Commands_Keywords::TYPE_IDN_DECODE; |
110 | 110 | } |
111 | 111 | |
112 | - if($this instanceof Mailcode_Interfaces_Commands_Validation_URLEncode) |
|
112 | + if ($this instanceof Mailcode_Interfaces_Commands_Validation_URLEncode) |
|
113 | 113 | { |
114 | 114 | $encodings[] = Mailcode_Commands_Keywords::TYPE_URLENCODE; |
115 | 115 | } |
116 | 116 | |
117 | - if($this instanceof Mailcode_Interfaces_Commands_Validation_URLDecode) |
|
117 | + if ($this instanceof Mailcode_Interfaces_Commands_Validation_URLDecode) |
|
118 | 118 | { |
119 | 119 | $encodings[] = Mailcode_Commands_Keywords::TYPE_URLDECODE; |
120 | 120 | } |
@@ -62,23 +62,23 @@ |
||
62 | 62 | |
63 | 63 | public function getNestedMailcode() : Mailcode_Collection |
64 | 64 | { |
65 | - if(isset($this->nestedMailcode)) |
|
66 | - { |
|
67 | - return $this->nestedMailcode; |
|
68 | - } |
|
69 | - |
|
70 | - if($this->isMailcodeEnabled()) |
|
71 | - { |
|
72 | - $collection = Mailcode::create()->parseString($this->getContent()); |
|
73 | - } |
|
74 | - else |
|
75 | - { |
|
76 | - $collection = new Mailcode_Collection(); |
|
77 | - } |
|
78 | - |
|
79 | - $this->nestedMailcode = $collection; |
|
80 | - |
|
81 | - return $collection; |
|
65 | + if(isset($this->nestedMailcode)) |
|
66 | + { |
|
67 | + return $this->nestedMailcode; |
|
68 | + } |
|
69 | + |
|
70 | + if($this->isMailcodeEnabled()) |
|
71 | + { |
|
72 | + $collection = Mailcode::create()->parseString($this->getContent()); |
|
73 | + } |
|
74 | + else |
|
75 | + { |
|
76 | + $collection = new Mailcode_Collection(); |
|
77 | + } |
|
78 | + |
|
79 | + $this->nestedMailcode = $collection; |
|
80 | + |
|
81 | + return $collection; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | protected function validateSyntax_nested_mailcode() : void |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | ->getInfo() |
48 | 48 | ->getTokenByIndex(0); |
49 | 49 | |
50 | - if($contentIDToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number) |
|
50 | + if ($contentIDToken instanceof Mailcode_Parser_Statement_Tokenizer_Token_Number) |
|
51 | 51 | { |
52 | 52 | $this->contentIDToken = $contentIDToken; |
53 | 53 | $this->loadContent(); |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | |
63 | 63 | public function getNestedMailcode() : Mailcode_Collection |
64 | 64 | { |
65 | - if(isset($this->nestedMailcode)) |
|
65 | + if (isset($this->nestedMailcode)) |
|
66 | 66 | { |
67 | 67 | return $this->nestedMailcode; |
68 | 68 | } |
69 | 69 | |
70 | - if($this->isMailcodeEnabled()) |
|
70 | + if ($this->isMailcodeEnabled()) |
|
71 | 71 | { |
72 | 72 | $collection = Mailcode::create()->parseString($this->getContent()); |
73 | 73 | } |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | { |
86 | 86 | $collection = $this->getNestedMailcode(); |
87 | 87 | |
88 | - if($collection->isValid()) |
|
88 | + if ($collection->isValid()) |
|
89 | 89 | { |
90 | 90 | return; |
91 | 91 | } |
92 | 92 | |
93 | 93 | $errors = $collection->getErrors(); |
94 | 94 | |
95 | - foreach($errors as $error) |
|
95 | + foreach ($errors as $error) |
|
96 | 96 | { |
97 | 97 | $this->getValidationResult()->makeError( |
98 | 98 | $error->getMessage(), |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | public function getContentID() : int |
105 | 105 | { |
106 | - if(isset($this->contentIDToken)) |
|
106 | + if (isset($this->contentIDToken)) |
|
107 | 107 | { |
108 | 108 | return (int)$this->contentIDToken->getValue(); |
109 | 109 | } |
@@ -133,13 +133,13 @@ discard block |
||
133 | 133 | { |
134 | 134 | $variables = parent::getVariables(); |
135 | 135 | |
136 | - if($this->isMailcodeEnabled()) |
|
136 | + if ($this->isMailcodeEnabled()) |
|
137 | 137 | { |
138 | 138 | $nested = $this->getNestedMailcode() |
139 | 139 | ->getVariables() |
140 | 140 | ->getAll(); |
141 | 141 | |
142 | - foreach($nested as $variable) |
|
142 | + foreach ($nested as $variable) |
|
143 | 143 | { |
144 | 144 | $variables->add($variable); |
145 | 145 | } |
@@ -70,8 +70,7 @@ |
||
70 | 70 | if($this->isMailcodeEnabled()) |
71 | 71 | { |
72 | 72 | $collection = Mailcode::create()->parseString($this->getContent()); |
73 | - } |
|
74 | - else |
|
73 | + } else |
|
75 | 74 | { |
76 | 75 | $collection = new Mailcode_Collection(); |
77 | 76 | } |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | use Mailcode_Traits_Commands_Validation_Variable; |
26 | 26 | use Mailcode_Traits_Commands_Validation_CaseSensitive; |
27 | 27 | |
28 | - /** |
|
29 | - * @var Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
30 | - */ |
|
28 | + /** |
|
29 | + * @var Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
30 | + */ |
|
31 | 31 | protected array $searchTerms = array(); |
32 | 32 | |
33 | 33 | protected function getValidations() : array |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | - /** |
|
64 | - * Retrieves all search terms. |
|
65 | - * @return Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
66 | - */ |
|
63 | + /** |
|
64 | + * Retrieves all search terms. |
|
65 | + * @return Mailcode_Parser_Statement_Tokenizer_Token_StringLiteral[] |
|
66 | + */ |
|
67 | 67 | public function getSearchTerms() : array |
68 | 68 | { |
69 | 69 | return $this->searchTerms; |
@@ -45,12 +45,12 @@ |
||
45 | 45 | ->getInfo() |
46 | 46 | ->getStringLiterals(); |
47 | 47 | |
48 | - foreach($tokens as $token) |
|
48 | + foreach ($tokens as $token) |
|
49 | 49 | { |
50 | 50 | $this->searchTerms[] = $token; |
51 | 51 | } |
52 | 52 | |
53 | - if(empty($this->searchTerms)) |
|
53 | + if (empty($this->searchTerms)) |
|
54 | 54 | { |
55 | 55 | $this->validationResult->makeError( |
56 | 56 | t('No search terms found:').' '. |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $command->getID() |
64 | 64 | ); |
65 | 65 | |
66 | - if(!class_exists($class)) |
|
66 | + if (!class_exists($class)) |
|
67 | 67 | { |
68 | 68 | $class = sprintf( |
69 | 69 | 'Mailcode\Translator\Syntax\%s\%s', |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ); |
73 | 73 | } |
74 | 74 | |
75 | - if(!class_exists($class)) |
|
75 | + if (!class_exists($class)) |
|
76 | 76 | { |
77 | 77 | throw new Mailcode_Translator_Exception( |
78 | 78 | sprintf('Unknown command %s in translator', $command->getID()), |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $translator = new $class($command); |
88 | 88 | |
89 | - if($translator instanceof Mailcode_Translator_Command) |
|
89 | + if ($translator instanceof Mailcode_Translator_Command) |
|
90 | 90 | { |
91 | 91 | return $translator; |
92 | 92 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | { |
115 | 115 | $subject = $safeguard->makeSafe(); |
116 | 116 | |
117 | - if(!$safeguard->hasPlaceholders()) |
|
117 | + if (!$safeguard->hasPlaceholders()) |
|
118 | 118 | { |
119 | 119 | return $subject; |
120 | 120 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $replaces = array(); |
125 | 125 | |
126 | - foreach($placeholders as $placeholder) |
|
126 | + foreach ($placeholders as $placeholder) |
|
127 | 127 | { |
128 | 128 | $command = $placeholder->getCommand(); |
129 | 129 |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | abstract class Mailcode_Translator_Syntax_ApacheVelocity extends Mailcode_Translator_Command |
24 | 24 | { |
25 | 25 | /** |
26 | - * @var string[] |
|
27 | - */ |
|
26 | + * @var string[] |
|
27 | + */ |
|
28 | 28 | private array $regexSpecialChars = array( |
29 | 29 | '?', |
30 | 30 | '.', |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
52 | - * Filters the string for use in an Apache Velocity (Java) |
|
53 | - * regex string: escapes all special characters. |
|
54 | - * |
|
55 | - * Velocity does its own escaping, so no need to escape special |
|
56 | - * characters as if they were a javascript string. |
|
57 | - * |
|
58 | - * @param string $string |
|
59 | - * @return string |
|
60 | - */ |
|
52 | + * Filters the string for use in an Apache Velocity (Java) |
|
53 | + * regex string: escapes all special characters. |
|
54 | + * |
|
55 | + * Velocity does its own escaping, so no need to escape special |
|
56 | + * characters as if they were a javascript string. |
|
57 | + * |
|
58 | + * @param string $string |
|
59 | + * @return string |
|
60 | + */ |
|
61 | 61 | public function filterRegexString(string $string) : string |
62 | 62 | { |
63 | 63 | // Special case: previously escaped quotes. |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | // All other special characters have to be escaped |
73 | 73 | // with two backslashes. |
74 | - foreach($this->regexSpecialChars as $char) |
|
74 | + foreach ($this->regexSpecialChars as $char) |
|
75 | 75 | { |
76 | 76 | $string = str_replace($char, '\\'.$char, $string); |
77 | 77 | } |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | |
86 | 86 | protected function addURLEncoding(Mailcode_Commands_Command $command, string $statement) : string |
87 | 87 | { |
88 | - if(!$command instanceof URLEncodingInterface) |
|
88 | + if (!$command instanceof URLEncodingInterface) |
|
89 | 89 | { |
90 | 90 | return $statement; |
91 | 91 | } |
92 | 92 | |
93 | - if($command->isURLEncoded()) |
|
93 | + if ($command->isURLEncoded()) |
|
94 | 94 | { |
95 | 95 | return sprintf( |
96 | 96 | '${esc.url($%s)}', |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ); |
99 | 99 | } |
100 | 100 | |
101 | - if($command->isURLDecoded()) |
|
101 | + if ($command->isURLDecoded()) |
|
102 | 102 | { |
103 | 103 | return sprintf( |
104 | 104 | '${esc.unurl($%s)}', |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | { |
117 | 117 | $varName = '$'.ltrim($varName, '$'); |
118 | 118 | |
119 | - if($absolute) |
|
119 | + if ($absolute) |
|
120 | 120 | { |
121 | 121 | $varName = sprintf('${price.abs(%s)}', $varName); |
122 | 122 | } |
@@ -17,16 +17,16 @@ |
||
17 | 17 | $statements = array(); |
18 | 18 | $statements[] = $this->renderURL($command); |
19 | 19 | |
20 | - if($command->isTrackingEnabled()) |
|
20 | + if ($command->isTrackingEnabled()) |
|
21 | 21 | { |
22 | 22 | $statements[] = $this->renderTracking($command); |
23 | 23 | } |
24 | 24 | |
25 | - if($command->hasQueryParams()) |
|
25 | + if ($command->hasQueryParams()) |
|
26 | 26 | { |
27 | 27 | $params = $command->getQueryParams(); |
28 | 28 | |
29 | - foreach($params as $name => $value) |
|
29 | + foreach ($params as $name => $value) |
|
30 | 30 | { |
31 | 31 | $statements[] = $this->renderQueryParam($name, $value); |
32 | 32 | } |
@@ -28,21 +28,21 @@ discard block |
||
28 | 28 | public const ERROR_INVALID_DUMMY_COMMAND_TYPE = 45903; |
29 | 29 | public const ERROR_INVALID_COMMAND_CLASS = 45904; |
30 | 30 | |
31 | - /** |
|
32 | - * @var Mailcode_Commands_Command[] |
|
33 | - */ |
|
31 | + /** |
|
32 | + * @var Mailcode_Commands_Command[] |
|
33 | + */ |
|
34 | 34 | private array $commands = array(); |
35 | 35 | |
36 | - /** |
|
37 | - * @var array<string,Mailcode_Commands_Command> |
|
38 | - */ |
|
36 | + /** |
|
37 | + * @var array<string,Mailcode_Commands_Command> |
|
38 | + */ |
|
39 | 39 | private static array $dummyCommands = array(); |
40 | 40 | |
41 | - /** |
|
42 | - * Retrieves a list of all available command IDs. |
|
43 | - * |
|
44 | - * @return string[] |
|
45 | - */ |
|
41 | + /** |
|
42 | + * Retrieves a list of all available command IDs. |
|
43 | + * |
|
44 | + * @return string[] |
|
45 | + */ |
|
46 | 46 | public function getIDs() : array |
47 | 47 | { |
48 | 48 | static $ids = array(); |
@@ -88,12 +88,12 @@ discard block |
||
88 | 88 | return $result; |
89 | 89 | } |
90 | 90 | |
91 | - /** |
|
92 | - * Gets an available command by its ID. |
|
93 | - * |
|
94 | - * @param string $id |
|
95 | - * @return Mailcode_Commands_Command |
|
96 | - */ |
|
91 | + /** |
|
92 | + * Gets an available command by its ID. |
|
93 | + * |
|
94 | + * @param string $id |
|
95 | + * @return Mailcode_Commands_Command |
|
96 | + */ |
|
97 | 97 | public function getByID(string $id) : Mailcode_Commands_Command |
98 | 98 | { |
99 | 99 | static $instances = array(); |
@@ -106,15 +106,15 @@ discard block |
||
106 | 106 | return $instances[$id]; |
107 | 107 | } |
108 | 108 | |
109 | - /** |
|
110 | - * Retrieves the ID of a command by its name. |
|
111 | - * |
|
112 | - * @param string $name |
|
113 | - * @throws Mailcode_Exception |
|
114 | - * @return string |
|
115 | - * |
|
116 | - * @see Mailcode_Commands::ERROR_COMMAND_NAME_DOES_NOT_EXIST |
|
117 | - */ |
|
109 | + /** |
|
110 | + * Retrieves the ID of a command by its name. |
|
111 | + * |
|
112 | + * @param string $name |
|
113 | + * @throws Mailcode_Exception |
|
114 | + * @return string |
|
115 | + * |
|
116 | + * @see Mailcode_Commands::ERROR_COMMAND_NAME_DOES_NOT_EXIST |
|
117 | + */ |
|
118 | 118 | public function getIDByName(string $name) : string |
119 | 119 | { |
120 | 120 | $items = $this->getAll(); |
@@ -225,14 +225,14 @@ discard block |
||
225 | 225 | return $class; |
226 | 226 | } |
227 | 227 | |
228 | - /** |
|
229 | - * Translates the command type to the expected class naming scheme. |
|
230 | - * |
|
231 | - * Example: not-empty => NotEmpty |
|
232 | - * |
|
233 | - * @param string $type |
|
234 | - * @return string |
|
235 | - */ |
|
228 | + /** |
|
229 | + * Translates the command type to the expected class naming scheme. |
|
230 | + * |
|
231 | + * Example: not-empty => NotEmpty |
|
232 | + * |
|
233 | + * @param string $type |
|
234 | + * @return string |
|
235 | + */ |
|
236 | 236 | private function adjustTypeName(string $type) : string |
237 | 237 | { |
238 | 238 | $type = str_replace('-', ' ', $type); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | static $ids = array(); |
49 | 49 | |
50 | - if(empty($ids)) { |
|
50 | + if (empty($ids)) { |
|
51 | 51 | $ids = FileHelper::createFileFinder(__DIR__.'/Commands/Command') |
52 | 52 | ->getPHPClassNames(); |
53 | 53 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function getAll() : array |
67 | 67 | { |
68 | - if(!empty($this->commands)) { |
|
68 | + if (!empty($this->commands)) { |
|
69 | 69 | return $this->commands; |
70 | 70 | } |
71 | 71 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $result = array(); |
75 | 75 | |
76 | - foreach($ids as $id) |
|
76 | + foreach ($ids as $id) |
|
77 | 77 | { |
78 | 78 | $result[] = $this->getDummyCommand($id); |
79 | 79 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | { |
99 | 99 | static $instances = array(); |
100 | 100 | |
101 | - if(!isset($instances[$id])) |
|
101 | + if (!isset($instances[$id])) |
|
102 | 102 | { |
103 | 103 | $instances[$id] = $this->createCommand($id, '__dummy', '', ''); |
104 | 104 | } |
@@ -119,9 +119,9 @@ discard block |
||
119 | 119 | { |
120 | 120 | $items = $this->getAll(); |
121 | 121 | |
122 | - foreach($items as $item) |
|
122 | + foreach ($items as $item) |
|
123 | 123 | { |
124 | - if($item->getName() === $name) { |
|
124 | + if ($item->getName() === $name) { |
|
125 | 125 | return $item->getID(); |
126 | 126 | } |
127 | 127 | } |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | { |
155 | 155 | $items = $this->getAll(); |
156 | 156 | |
157 | - foreach($items as $item) |
|
157 | + foreach ($items as $item) |
|
158 | 158 | { |
159 | - if($item->getName() === $name) { |
|
159 | + if ($item->getName() === $name) { |
|
160 | 160 | return true; |
161 | 161 | } |
162 | 162 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | { |
177 | 177 | $class = $this->resolveClassName($id, $type); |
178 | 178 | |
179 | - if(!class_exists($class)) |
|
179 | + if (!class_exists($class)) |
|
180 | 180 | { |
181 | 181 | throw new Mailcode_Factory_Exception( |
182 | 182 | 'No such command', |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | $command = new $class($type, $params, $matchedString); |
193 | 193 | |
194 | - if($command instanceof Mailcode_Commands_Command) |
|
194 | + if ($command instanceof Mailcode_Commands_Command) |
|
195 | 195 | { |
196 | 196 | return $command; |
197 | 197 | } |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | |
213 | 213 | $dummy = $this->getDummyCommand($id); |
214 | 214 | |
215 | - if($dummy->supportsType()) |
|
215 | + if ($dummy->supportsType()) |
|
216 | 216 | { |
217 | - if(empty($type)) |
|
217 | + if (empty($type)) |
|
218 | 218 | { |
219 | 219 | $type = $dummy->getDefaultType(); |
220 | 220 | } |
@@ -252,14 +252,14 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function getDummyCommand(string $id) : Mailcode_Commands_Command |
254 | 254 | { |
255 | - if(isset(self::$dummyCommands[$id])) { |
|
255 | + if (isset(self::$dummyCommands[$id])) { |
|
256 | 256 | return self::$dummyCommands[$id]; |
257 | 257 | } |
258 | 258 | |
259 | 259 | $class = 'Mailcode\Mailcode_Commands_Command_'.$id; |
260 | 260 | $cmd = new $class('__dummy'); |
261 | 261 | |
262 | - if($cmd instanceof Mailcode_Commands_Command) |
|
262 | + if ($cmd instanceof Mailcode_Commands_Command) |
|
263 | 263 | { |
264 | 264 | self::$dummyCommands[$id] = $cmd; |
265 | 265 | return $cmd; |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | $result = array(); |
285 | 285 | $commands = $this->getAll(); |
286 | 286 | |
287 | - foreach($commands as $command) |
|
287 | + foreach ($commands as $command) |
|
288 | 288 | { |
289 | - if($command instanceof Mailcode_Interfaces_Commands_ProtectedContent) |
|
289 | + if ($command instanceof Mailcode_Interfaces_Commands_ProtectedContent) |
|
290 | 290 | { |
291 | 291 | $result[] = $command; |
292 | 292 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | private int $instanceID; |
134 | 134 | |
135 | - public function __construct(string $type='', string $paramsString='', string $matchedText='') |
|
135 | + public function __construct(string $type = '', string $paramsString = '', string $matchedText = '') |
|
136 | 136 | { |
137 | 137 | self::$instanceCounter++; |
138 | 138 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | { |
224 | 224 | $this->requireNonDummy(); |
225 | 225 | |
226 | - if($this->hash === '') { |
|
226 | + if ($this->hash === '') { |
|
227 | 227 | $this->hash = md5($this->matchedText); |
228 | 228 | } |
229 | 229 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | protected function requireNonDummy() : void |
238 | 238 | { |
239 | - if(!$this->isDummy()) |
|
239 | + if (!$this->isDummy()) |
|
240 | 240 | { |
241 | 241 | return; |
242 | 242 | } |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | protected function validate() : OperationResult |
257 | 257 | { |
258 | - if(!$this->validated) |
|
258 | + if (!$this->validated) |
|
259 | 259 | { |
260 | 260 | $this->requireNonDummy(); |
261 | 261 | $this->validateSyntax(); |
@@ -275,10 +275,10 @@ discard block |
||
275 | 275 | { |
276 | 276 | $validations = $this->resolveValidations(); |
277 | 277 | |
278 | - foreach($validations as $validation) |
|
278 | + foreach ($validations as $validation) |
|
279 | 279 | { |
280 | 280 | // break off at the first validation issue |
281 | - if(!$this->validateSyntaxMethod($validation)) |
|
281 | + if (!$this->validateSyntaxMethod($validation)) |
|
282 | 282 | { |
283 | 283 | return; |
284 | 284 | } |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | { |
303 | 303 | $method = 'validateSyntax_'.$validation; |
304 | 304 | |
305 | - if(!method_exists($this, $method)) |
|
305 | + if (!method_exists($this, $method)) |
|
306 | 306 | { |
307 | 307 | throw new CommandException( |
308 | 308 | 'Missing validation method ['.$validation.']', |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | public function validateNesting() : OperationResult |
334 | 334 | { |
335 | - if($this->nestingValidated) |
|
335 | + if ($this->nestingValidated) |
|
336 | 336 | { |
337 | 337 | return $this->validationResult; |
338 | 338 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | |
357 | 357 | public function getType() : string |
358 | 358 | { |
359 | - if($this->supportsType()) |
|
359 | + if ($this->supportsType()) |
|
360 | 360 | { |
361 | 361 | return $this->type; |
362 | 362 | } |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | |
377 | 377 | public function getHighlighted() : string |
378 | 378 | { |
379 | - if(!$this->isValid()) |
|
379 | + if (!$this->isValid()) |
|
380 | 380 | { |
381 | 381 | return ''; |
382 | 382 | } |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | |
387 | 387 | public function getParamsString() : string |
388 | 388 | { |
389 | - if($this->requiresParameters()) |
|
389 | + if ($this->requiresParameters()) |
|
390 | 390 | { |
391 | 391 | return $this->paramsString; |
392 | 392 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | */ |
406 | 406 | public function requireParams() : Mailcode_Parser_Statement |
407 | 407 | { |
408 | - if(isset($this->params)) |
|
408 | + if (isset($this->params)) |
|
409 | 409 | { |
410 | 410 | return $this->params; |
411 | 411 | } |
@@ -437,22 +437,22 @@ discard block |
||
437 | 437 | */ |
438 | 438 | final public function getCommandType() : string |
439 | 439 | { |
440 | - if($this instanceof Mailcode_Commands_Command_Type_Closing) |
|
440 | + if ($this instanceof Mailcode_Commands_Command_Type_Closing) |
|
441 | 441 | { |
442 | 442 | return 'Closing'; |
443 | 443 | } |
444 | 444 | |
445 | - if($this instanceof Mailcode_Commands_Command_Type_Opening) |
|
445 | + if ($this instanceof Mailcode_Commands_Command_Type_Opening) |
|
446 | 446 | { |
447 | 447 | return 'Opening'; |
448 | 448 | } |
449 | 449 | |
450 | - if($this instanceof Mailcode_Commands_Command_Type_Sibling) |
|
450 | + if ($this instanceof Mailcode_Commands_Command_Type_Sibling) |
|
451 | 451 | { |
452 | 452 | return 'Sibling'; |
453 | 453 | } |
454 | 454 | |
455 | - if($this instanceof Mailcode_Commands_Command_Type_Standalone) |
|
455 | + if ($this instanceof Mailcode_Commands_Command_Type_Standalone) |
|
456 | 456 | { |
457 | 457 | return 'Standalone'; |
458 | 458 | } |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | */ |
494 | 494 | public function getLogicKeywords() : Mailcode_Commands_LogicKeywords |
495 | 495 | { |
496 | - if(isset($this->logicKeywords) && $this->supportsLogicKeywords()) |
|
496 | + if (isset($this->logicKeywords) && $this->supportsLogicKeywords()) |
|
497 | 497 | { |
498 | 498 | return $this->logicKeywords; |
499 | 499 | } |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | |
524 | 524 | protected function getValidator() : Mailcode_Parser_Statement_Validator |
525 | 525 | { |
526 | - if(isset($this->validator)) |
|
526 | + if (isset($this->validator)) |
|
527 | 527 | { |
528 | 528 | return $this->validator; |
529 | 529 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $tokens = $this->params->getInfo()->getTokens(); |
59 | 59 | $allowed = $this->resolveActiveTokens(); |
60 | 60 | |
61 | - if(count($tokens) > count($allowed)) |
|
61 | + if (count($tokens) > count($allowed)) |
|
62 | 62 | { |
63 | 63 | $this->validationResult->makeError( |
64 | 64 | t('Unknown parameters found:').' '. |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | |
82 | 82 | $encodings = $this->getSupportedEncodings(); |
83 | 83 | |
84 | - foreach($encodings as $keyword) |
|
84 | + foreach ($encodings as $keyword) |
|
85 | 85 | { |
86 | 86 | $token = $this->getEncodingToken($keyword); |
87 | - if($token) |
|
87 | + if ($token) |
|
88 | 88 | { |
89 | 89 | $allowed[] = $token; |
90 | 90 | } |