@@ -59,7 +59,7 @@ |
||
59 | 59 | */ |
60 | 60 | public function excludeTags(array $tagNames) : self |
61 | 61 | { |
62 | - foreach($tagNames as $tagName) |
|
62 | + foreach ($tagNames as $tagName) |
|
63 | 63 | { |
64 | 64 | $this->excludeTag((string)$tagName); |
65 | 65 | } |
@@ -52,12 +52,12 @@ discard block |
||
52 | 52 | { |
53 | 53 | $this->parts[] = $this->renderTag(array('command-name'), $this->command->getName()); |
54 | 54 | |
55 | - if($this->command->hasType()) |
|
55 | + if ($this->command->hasType()) |
|
56 | 56 | { |
57 | 57 | $this->parts[] = ' '.$this->renderTag(array('command-type'), $this->command->getType()); |
58 | 58 | } |
59 | 59 | |
60 | - if($this->command->requiresParameters()) |
|
60 | + if ($this->command->requiresParameters()) |
|
61 | 61 | { |
62 | 62 | $this->parts[] = $this->renderTag(array('hyphen'), ':'); |
63 | 63 | $this->parts[] = '<wbr>'; |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | { |
69 | 69 | $params = $command->getParams(); |
70 | 70 | |
71 | - if($params === null) |
|
71 | + if ($params === null) |
|
72 | 72 | { |
73 | 73 | return; |
74 | 74 | } |
75 | 75 | |
76 | 76 | $tokens = $params->getInfo()->getTokens(); |
77 | 77 | |
78 | - if(!empty($tokens)) |
|
78 | + if (!empty($tokens)) |
|
79 | 79 | { |
80 | 80 | $this->parts[] = ' '; |
81 | 81 | $this->parts[] = '<span class="mailcode-params">'; |
@@ -91,9 +91,9 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | - protected function appendParamToken(Mailcode_Parser_Statement_Tokenizer_Token $token, ?Mailcode_Parser_Statement_Tokenizer_Token $previous=null) : void |
|
94 | + protected function appendParamToken(Mailcode_Parser_Statement_Tokenizer_Token $token, ?Mailcode_Parser_Statement_Tokenizer_Token $previous = null) : void |
|
95 | 95 | { |
96 | - if($previous && $previous->hasSpacing()) { |
|
96 | + if ($previous && $previous->hasSpacing()) { |
|
97 | 97 | $this->parts[] = ' '; |
98 | 98 | } |
99 | 99 | |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | |
103 | 103 | protected function appendLogicKeywords() : void |
104 | 104 | { |
105 | - if(!$this->command->supportsLogicKeywords()) |
|
105 | + if (!$this->command->supportsLogicKeywords()) |
|
106 | 106 | { |
107 | 107 | return; |
108 | 108 | } |
109 | 109 | |
110 | 110 | $keywords = $this->command->getLogicKeywords()->getKeywords(); |
111 | 111 | |
112 | - foreach($keywords as $keyword) |
|
112 | + foreach ($keywords as $keyword) |
|
113 | 113 | { |
114 | 114 | $this->appendLogicKeyword($keyword); |
115 | 115 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | $type = $keyword->getType(); |
123 | 123 | |
124 | - if(!empty($type)) |
|
124 | + if (!empty($type)) |
|
125 | 125 | { |
126 | 126 | $this->parts[] = ' '.$this->renderTag(array('command-type'), $type); |
127 | 127 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | { |
141 | 141 | $parts = array(); |
142 | 142 | |
143 | - foreach($classes as $class) |
|
143 | + foreach ($classes as $class) |
|
144 | 144 | { |
145 | 145 | $parts[] = 'mailcode-'.$class; |
146 | 146 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | use AppUtils\CSVHelper; |
16 | 16 | use AppUtils\FileHelper; |
17 | 17 | use libphonenumber\PhoneNumberFormat; |
18 | -use libphonenumber\PhoneNumberUtil;use Mailcode\Mailcode;use function AppLocalize\pts; |
|
18 | +use libphonenumber\PhoneNumberUtil; use Mailcode\Mailcode; use function AppLocalize\pts; |
|
19 | 19 | |
20 | 20 | require_once 'prepend.php'; |
21 | 21 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | { |
90 | 90 | $meta = $phoneNumberUtil->getMetadataForRegion($code); |
91 | 91 | if (!$meta) { |
92 | - die('No metadata for ' . $code); |
|
92 | + die('No metadata for '.$code); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | $exampleNumber = $phoneNumberUtil->getExampleNumber($code); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | use Mailcode\Mailcode_Exception; |
17 | 17 | use Mailcode\Mailcode_Translator_Exception; |
18 | 18 | use function \AppLocalize\pt; |
19 | -use function \AppLocalize\pts;use function AppLocalize\t; |
|
19 | +use function \AppLocalize\pts; use function AppLocalize\t; |
|
20 | 20 | |
21 | 21 | require_once 'prepend.php'; |
22 | 22 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $translated = ''; |
28 | 28 | $error = null; |
29 | 29 | |
30 | -if($request->getBool('highlight')) |
|
30 | +if ($request->getBool('highlight')) |
|
31 | 31 | { |
32 | 32 | $commandsText = $request->getParam('mailcode'); |
33 | 33 | |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | $error = $e->getMessage(); |
43 | 43 | |
44 | 44 | $collection = $e->getCollection(); |
45 | - if($collection) |
|
45 | + if ($collection) |
|
46 | 46 | { |
47 | 47 | $first = $collection->getFirstError(); |
48 | 48 | $error = $first->getMessage(); |
49 | 49 | $matched = $first->getMatchedText(); |
50 | - if(!empty($matched)) { |
|
51 | - $error .= '<br>'. t('In command:').' <code>'.$matched.'</code>'; |
|
50 | + if (!empty($matched)) { |
|
51 | + $error .= '<br>'.t('In command:').' <code>'.$matched.'</code>'; |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | <p></p><br> |
93 | 93 | <h2><?php pt('Highlighted commands') ?></h2> |
94 | 94 | <?php |
95 | - if(empty($commandsText)) |
|
95 | + if (empty($commandsText)) |
|
96 | 96 | { |
97 | 97 | ?> |
98 | 98 | <div class="alert alert-info"> |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | </div> |
101 | 101 | <?php |
102 | 102 | } |
103 | - else if($error) |
|
103 | + else if ($error) |
|
104 | 104 | { |
105 | 105 | ?> |
106 | 106 | <div class="alert alert-danger"> |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | private ?Mailcode_Commands_Command $command; |
74 | 74 | |
75 | - public function __construct(string $path, string $name, string $matchedText, ?Mailcode_Commands_Command $sourceCommand=null) |
|
75 | + public function __construct(string $path, string $name, string $matchedText, ?Mailcode_Commands_Command $sourceCommand = null) |
|
76 | 76 | { |
77 | 77 | $this->path = $path; |
78 | 78 | $this->name = $name; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | public function getFullName() : string |
97 | 97 | { |
98 | - if(empty($this->path)) |
|
98 | + if (empty($this->path)) |
|
99 | 99 | { |
100 | 100 | return dollarize($this->name); |
101 | 101 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function getUniqueName() : string |
115 | 115 | { |
116 | - if(isset($this->command)) |
|
116 | + if (isset($this->command)) |
|
117 | 117 | { |
118 | 118 | return $this->getFullName().'/'.$this->command->getHash(); |
119 | 119 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | public function getHash() : string |
140 | 140 | { |
141 | - if(empty($this->hash)) |
|
141 | + if (empty($this->hash)) |
|
142 | 142 | { |
143 | 143 | $this->hash = md5($this->matchedText); |
144 | 144 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function getValidationResult() : OperationResult |
159 | 159 | { |
160 | - if(isset($this->validationResult)) |
|
160 | + if (isset($this->validationResult)) |
|
161 | 161 | { |
162 | 162 | return $this->validationResult; |
163 | 163 | } |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | |
172 | 172 | protected function validate(OperationResult $result) : void |
173 | 173 | { |
174 | - foreach($this->validations as $validation) |
|
174 | + foreach ($this->validations as $validation) |
|
175 | 175 | { |
176 | 176 | $method = 'validate_'.$validation; |
177 | 177 | |
178 | - if(!method_exists($this, $method)) |
|
178 | + if (!method_exists($this, $method)) |
|
179 | 179 | { |
180 | 180 | throw new Mailcode_Exception( |
181 | 181 | 'Unknown validation method', |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | protected function validateNumber(string $value, int $errorCode) : void |
227 | 227 | { |
228 | - if(empty($value) || !is_numeric($value[0])) |
|
228 | + if (empty($value) || !is_numeric($value[0])) |
|
229 | 229 | { |
230 | 230 | return; |
231 | 231 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | protected function validateUnderscore(string $value, int $errorCode) : void |
244 | 244 | { |
245 | 245 | // allow empty paths |
246 | - if(empty($value)) |
|
246 | + if (empty($value)) |
|
247 | 247 | { |
248 | 248 | return; |
249 | 249 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $length = strlen($value); |
252 | 252 | |
253 | 253 | // trimming underscores does not change the length: no underscores at start or end of string. |
254 | - if(strlen(trim($value, '_')) === $length) |
|
254 | + if (strlen(trim($value, '_')) === $length) |
|
255 | 255 | { |
256 | 256 | return; |
257 | 257 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | if ($command->isCountEnabled()) |
28 | 28 | { |
29 | 29 | $result = $this->buildCountAssignment($command); |
30 | - if($result !== null) { |
|
30 | + if ($result !== null) { |
|
31 | 31 | $assignmentString = $result; |
32 | 32 | } |
33 | 33 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return null; |
48 | 48 | } |
49 | 49 | |
50 | - if($variable->hasPath()) { |
|
50 | + if ($variable->hasPath()) { |
|
51 | 51 | return sprintf( |
52 | 52 | '$map.of(%s).keys("%s").count()', |
53 | 53 | dollarize($variable->getPath()), |