@@ -16,9 +16,9 @@ |
||
16 | 16 | die('<b>ERROR:</b> Autoloader not present. Run composer update first.'); |
17 | 17 | } |
18 | 18 | |
19 | - /** |
|
20 | - * The composer autoloader |
|
21 | - */ |
|
19 | + /** |
|
20 | + * The composer autoloader |
|
21 | + */ |
|
22 | 22 | require_once $autoload; |
23 | 23 | |
24 | 24 | // the folder in which the localization .ini files are stored |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | */ |
21 | 21 | abstract class Localization_Event |
22 | 22 | { |
23 | - /** |
|
24 | - * @var array |
|
25 | - */ |
|
23 | + /** |
|
24 | + * @var array |
|
25 | + */ |
|
26 | 26 | protected $args; |
27 | 27 | |
28 | 28 | public function __construct(array $args) |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | $this->args = $args; |
31 | 31 | } |
32 | 32 | |
33 | - /** |
|
34 | - * Fetches the argument at the specified index in the |
|
35 | - * event's arguments list, if it exists. |
|
36 | - * |
|
37 | - * @param int $index Zero-based index number. |
|
38 | - * @return mixed|NULL |
|
39 | - */ |
|
33 | + /** |
|
34 | + * Fetches the argument at the specified index in the |
|
35 | + * event's arguments list, if it exists. |
|
36 | + * |
|
37 | + * @param int $index Zero-based index number. |
|
38 | + * @return mixed|NULL |
|
39 | + */ |
|
40 | 40 | public function getArgument(int $index) |
41 | 41 | { |
42 | 42 | if(isset($this->args[$index])) { |
@@ -258,8 +258,7 @@ |
||
258 | 258 | if(empty($tokens)) |
259 | 259 | { |
260 | 260 | $content = '/* No strings found. */'; |
261 | - } |
|
262 | - else |
|
261 | + } else |
|
263 | 262 | { |
264 | 263 | $content = |
265 | 264 | '/**'.PHP_EOL. |
@@ -143,14 +143,14 @@ discard block |
||
143 | 143 | $this->writeCacheKey(); |
144 | 144 | } |
145 | 145 | |
146 | - /** |
|
147 | - * Retrieves a list of all localization client |
|
148 | - * files that are written to disk. This includes |
|
149 | - * the locale files and the libraries required |
|
150 | - * to make it work clientside. |
|
151 | - * |
|
152 | - * @return string[] |
|
153 | - */ |
|
146 | + /** |
|
147 | + * Retrieves a list of all localization client |
|
148 | + * files that are written to disk. This includes |
|
149 | + * the locale files and the libraries required |
|
150 | + * to make it work clientside. |
|
151 | + * |
|
152 | + * @return string[] |
|
153 | + */ |
|
154 | 154 | public function getFilesList() : array |
155 | 155 | { |
156 | 156 | $files = array(); |
@@ -328,11 +328,11 @@ discard block |
||
328 | 328 | return self::$systemKey; |
329 | 329 | } |
330 | 330 | |
331 | - /** |
|
332 | - * Generates the cache key file, which is used to determine |
|
333 | - * automatically whether the client libraries need to be |
|
334 | - * refreshed. |
|
335 | - */ |
|
331 | + /** |
|
332 | + * Generates the cache key file, which is used to determine |
|
333 | + * automatically whether the client libraries need to be |
|
334 | + * refreshed. |
|
335 | + */ |
|
336 | 336 | protected function writeCacheKey() : void |
337 | 337 | { |
338 | 338 | $this->cacheKey = self::getSystemKey(); |
@@ -17,8 +17,7 @@ |
||
17 | 17 | if(isset($this->parentToken)) { |
18 | 18 | $this->line = $this->parentToken->getLine(); |
19 | 19 | } |
20 | - } |
|
21 | - else |
|
20 | + } else |
|
22 | 21 | { |
23 | 22 | $this->token = token_name($this->definition[0]); |
24 | 23 | $this->value = $this->definition[1]; |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | foreach($defaults as $name => $val) { |
51 | 51 | $this->setValue($name, $val); |
52 | 52 | } |
53 | - } |
|
54 | - else if($this->request->getBool($this->vars['filter'])) |
|
53 | + } else if($this->request->getBool($this->vars['filter'])) |
|
55 | 54 | { |
56 | 55 | $this->parseSearchTerms($this->request->getParam($this->vars['search'])); |
57 | 56 | |
@@ -72,8 +71,7 @@ discard block |
||
72 | 71 | ->setEnum('', 'client', 'server') |
73 | 72 | ->get('') |
74 | 73 | ); |
75 | - } |
|
76 | - else |
|
74 | + } else |
|
77 | 75 | { |
78 | 76 | $this->parseSearchTerms($this->getValue($this->vars['search'])); |
79 | 77 | } |
@@ -23,25 +23,25 @@ discard block |
||
23 | 23 | */ |
24 | 24 | class Localization_Editor_Filters |
25 | 25 | { |
26 | - /** |
|
27 | - * @var Localization_Editor |
|
28 | - */ |
|
26 | + /** |
|
27 | + * @var Localization_Editor |
|
28 | + */ |
|
29 | 29 | protected $editor; |
30 | 30 | |
31 | - /** |
|
32 | - * @var Request |
|
33 | - */ |
|
31 | + /** |
|
32 | + * @var Request |
|
33 | + */ |
|
34 | 34 | |
35 | 35 | protected $request; |
36 | 36 | |
37 | - /** |
|
38 | - * @var string |
|
39 | - */ |
|
37 | + /** |
|
38 | + * @var string |
|
39 | + */ |
|
40 | 40 | protected $sessionName = 'localize_filters'; |
41 | 41 | |
42 | - /** |
|
43 | - * @var string[] |
|
44 | - */ |
|
42 | + /** |
|
43 | + * @var string[] |
|
44 | + */ |
|
45 | 45 | protected $vars = array( |
46 | 46 | 'resetfilter' => '', |
47 | 47 | 'filter' => '', |
@@ -204,13 +204,13 @@ discard block |
||
204 | 204 | <form class="form-inline"> |
205 | 205 | <div class="form-hiddens"> |
206 | 206 | <?php |
207 | - $params = $this->editor->getRequestParams(); |
|
208 | - foreach($params as $name => $value) { |
|
209 | - ?> |
|
207 | + $params = $this->editor->getRequestParams(); |
|
208 | + foreach($params as $name => $value) { |
|
209 | + ?> |
|
210 | 210 | <input type="hidden" name="<?php echo $name ?>" value="<?php echo $value ?>"> |
211 | 211 | <?php |
212 | - } |
|
213 | - ?> |
|
212 | + } |
|
213 | + ?> |
|
214 | 214 | </div> |
215 | 215 | <div class="form-row"> |
216 | 216 | <div class="col-auto"> |
@@ -218,42 +218,42 @@ discard block |
||
218 | 218 | </div> |
219 | 219 | <div class="col-auto"> |
220 | 220 | <?php |
221 | - echo $this->renderSelect( |
|
222 | - $this->vars['status'], |
|
223 | - array( |
|
224 | - array( |
|
225 | - 'value' => '', |
|
226 | - 'label' => t('Status...') |
|
227 | - ), |
|
228 | - array( |
|
229 | - 'value' => 'untranslated', |
|
230 | - 'label' => t('Not translated') |
|
231 | - ), |
|
232 | - array( |
|
233 | - 'value' => 'translated', |
|
234 | - 'label' => t('Translated') |
|
235 | - ) |
|
236 | - ) |
|
237 | - ); |
|
221 | + echo $this->renderSelect( |
|
222 | + $this->vars['status'], |
|
223 | + array( |
|
224 | + array( |
|
225 | + 'value' => '', |
|
226 | + 'label' => t('Status...') |
|
227 | + ), |
|
228 | + array( |
|
229 | + 'value' => 'untranslated', |
|
230 | + 'label' => t('Not translated') |
|
231 | + ), |
|
232 | + array( |
|
233 | + 'value' => 'translated', |
|
234 | + 'label' => t('Translated') |
|
235 | + ) |
|
236 | + ) |
|
237 | + ); |
|
238 | 238 | |
239 | - echo $this->renderSelect( |
|
240 | - $this->vars['location'], |
|
241 | - array( |
|
242 | - array( |
|
243 | - 'value' => '', |
|
244 | - 'label' => t('Location...') |
|
245 | - ), |
|
246 | - array( |
|
247 | - 'value' => 'client', |
|
248 | - 'label' => t('Clientside') |
|
249 | - ), |
|
250 | - array( |
|
251 | - 'value' => 'server', |
|
252 | - 'label' => t('Serverside') |
|
253 | - ) |
|
254 | - ) |
|
255 | - ); |
|
256 | - ?> |
|
239 | + echo $this->renderSelect( |
|
240 | + $this->vars['location'], |
|
241 | + array( |
|
242 | + array( |
|
243 | + 'value' => '', |
|
244 | + 'label' => t('Location...') |
|
245 | + ), |
|
246 | + array( |
|
247 | + 'value' => 'client', |
|
248 | + 'label' => t('Clientside') |
|
249 | + ), |
|
250 | + array( |
|
251 | + 'value' => 'server', |
|
252 | + 'label' => t('Serverside') |
|
253 | + ) |
|
254 | + ) |
|
255 | + ); |
|
256 | + ?> |
|
257 | 257 | </div> |
258 | 258 | <div class="col-auto"> |
259 | 259 | <button type="submit" name="<?php echo $this->vars['filter'] ?>" value="yes" class="btn btn-primary mb-2" title="<?php pt('Filter the list with the selected criteria.') ?>" data-toggle="tooltip"> |
@@ -268,9 +268,9 @@ discard block |
||
268 | 268 | </form> |
269 | 269 | <p> |
270 | 270 | <small class="text-muted"><?php |
271 | - pts('Hint:'); |
|
272 | - pt('Search works in translated and untranslated text, as well as the file name.') |
|
273 | - ?></small> |
|
271 | + pts('Hint:'); |
|
272 | + pt('Search works in translated and untranslated text, as well as the file name.') |
|
273 | + ?></small> |
|
274 | 274 | </p> |
275 | 275 | <br> |
276 | 276 | <?php |
@@ -6,9 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class Localization_Scanner_StringsCollection_Warning |
8 | 8 | { |
9 | - /** |
|
10 | - * @var array |
|
11 | - */ |
|
9 | + /** |
|
10 | + * @var array |
|
11 | + */ |
|
12 | 12 | protected $data; |
13 | 13 | |
14 | 14 | public function __construct(array $data) |
@@ -121,8 +121,7 @@ |
||
121 | 121 | $lines[] = '; '; |
122 | 122 | $lines[] = '; 1) Do not to modify the keys (left hand side of the = sign)'; |
123 | 123 | $lines[] = '; 2) Save the file as UTF-8 without BOM'; |
124 | - } |
|
125 | - else |
|
124 | + } else |
|
126 | 125 | { |
127 | 126 | $lines[] = '; Do NOT edit this file directly! It depends on the main translation file'; |
128 | 127 | $lines[] = '; and any changes will be lost. Edit the main file instead.'; |
@@ -20,9 +20,9 @@ discard block |
||
20 | 20 | */ |
21 | 21 | class Localization_Writer |
22 | 22 | { |
23 | - /** |
|
24 | - * @var array<string,string> |
|
25 | - */ |
|
23 | + /** |
|
24 | + * @var array<string,string> |
|
25 | + */ |
|
26 | 26 | private array $hashes = array(); |
27 | 27 | |
28 | 28 | private bool $editable = false; |
@@ -138,16 +138,16 @@ discard block |
||
138 | 138 | return $hashes; |
139 | 139 | } |
140 | 140 | |
141 | - /** |
|
142 | - * Sort the strings to ensure they always appear in the same order: |
|
143 | - * first by text, and same strings by their hashes. This is important |
|
144 | - * for strings that have the same translation to avoid them changing |
|
145 | - * order between sorts. |
|
146 | - * |
|
147 | - * @param array $a |
|
148 | - * @param array $b |
|
149 | - * @return int |
|
150 | - */ |
|
141 | + /** |
|
142 | + * Sort the strings to ensure they always appear in the same order: |
|
143 | + * first by text, and same strings by their hashes. This is important |
|
144 | + * for strings that have the same translation to avoid them changing |
|
145 | + * order between sorts. |
|
146 | + * |
|
147 | + * @param array $a |
|
148 | + * @param array $b |
|
149 | + * @return int |
|
150 | + */ |
|
151 | 151 | public function callback_sortStrings(array $a, array $b) : int |
152 | 152 | { |
153 | 153 | $result = strnatcasecmp($a['text'], $b['text']); |
@@ -19,8 +19,7 @@ |
||
19 | 19 | if(isset($this->parentToken)) { |
20 | 20 | $this->line = $this->parentToken->getLine(); |
21 | 21 | } |
22 | - } |
|
23 | - else |
|
22 | + } else |
|
24 | 23 | { |
25 | 24 | $this->token = JTokenizer::getTokenName($this->definition[0]); |
26 | 25 | $this->value = $this->definition[1]; |
@@ -12,8 +12,8 @@ |
||
12 | 12 | const SERIALIZED_PROPERTIES = 'properties'; |
13 | 13 | |
14 | 14 | /** |
15 | - * @var Localization_Scanner_StringsCollection |
|
16 | - */ |
|
15 | + * @var Localization_Scanner_StringsCollection |
|
16 | + */ |
|
17 | 17 | protected $collection; |
18 | 18 | |
19 | 19 | /** |