Passed
Push — master ( 82b8bb...ff0cce )
by Sebastian
03:28
created
example/index.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,9 +16,9 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Localization/Event.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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])) {
Please login to merge, or discard this patch.
src/Localization/Generator.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -258,8 +258,7 @@
 block discarded – undo
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.
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -17,24 +17,24 @@  discard block
 block discarded – undo
17 17
     const FILES_LOCALES = 'locales';
18 18
     const FILES_CACHE_KEY = 'cachekey';
19 19
     
20
-   /**
21
-    * @var bool
22
-    */
20
+    /**
21
+     * @var bool
22
+     */
23 23
     protected $force = false;
24 24
     
25
-   /**
26
-    * @var Localization_Translator
27
-    */
25
+    /**
26
+     * @var Localization_Translator
27
+     */
28 28
     protected $translator;
29 29
     
30
-   /**
31
-    * @var string
32
-    */
30
+    /**
31
+     * @var string
32
+     */
33 33
     protected $targetFolder;
34 34
     
35
-   /**
36
-    * @var string
37
-    */
35
+    /**
36
+     * @var string
37
+     */
38 38
     protected $cacheKeyFile;
39 39
 
40 40
     /**
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
         $this->writeCacheKey();
120 120
     }
121 121
     
122
-   /**
123
-    * Retrieves a list of all localization client 
124
-    * files that are written to disk. This includes
125
-    * the locale files and the libraries required
126
-    * to make it work clientside.
127
-    * 
128
-    * @return string[]
129
-    */
122
+    /**
123
+     * Retrieves a list of all localization client 
124
+     * files that are written to disk. This includes
125
+     * the locale files and the libraries required
126
+     * to make it work clientside.
127
+     * 
128
+     * @return string[]
129
+     */
130 130
     public function getFilesList() : array
131 131
     {
132 132
         $files = array();
@@ -279,11 +279,11 @@  discard block
 block discarded – undo
279 279
         $this->written[self::FILES_LOCALES] = true;
280 280
     }
281 281
     
282
-   /**
283
-    * Generates the cache key file, which is used to determine
284
-    * automatically whether the client libraries need to be 
285
-    * refreshed.
286
-    */
282
+    /**
283
+     * Generates the cache key file, which is used to determine
284
+     * automatically whether the client libraries need to be 
285
+     * refreshed.
286
+     */
287 287
     protected function writeCacheKey() : void
288 288
     {
289 289
         if(file_exists($this->cacheKeyFile) && !$this->force) {
Please login to merge, or discard this patch.
src/Localization/Parser/Token/PHP.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
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];
Please login to merge, or discard this patch.
src/Localization/Editor/Filters.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Indentation   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -23,25 +23,25 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Localization/Scanner/StringsCollection/Warning.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
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)
Please login to merge, or discard this patch.
src/Localization/Writer.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,8 +121,7 @@
 block discarded – undo
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.';
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -20,29 +20,29 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class Localization_Writer
22 22
 {
23
-   /**
24
-    * @var boolean
25
-    */
23
+    /**
24
+     * @var boolean
25
+     */
26 26
     private $editable = false;
27 27
     
28
-   /**
29
-    * @var array<string,string>
30
-    */
28
+    /**
29
+     * @var array<string,string>
30
+     */
31 31
     private $hashes = array();
32 32
     
33
-   /**
34
-    * @var Localization_Locale
35
-    */
33
+    /**
34
+     * @var Localization_Locale
35
+     */
36 36
     private $locale;
37 37
     
38
-   /**
39
-    * @var string
40
-    */
38
+    /**
39
+     * @var string
40
+     */
41 41
     private $fileType;
42 42
     
43
-   /**
44
-    * @var string
45
-    */
43
+    /**
44
+     * @var string
45
+     */
46 46
     private $filePath;
47 47
     
48 48
     public function __construct(Localization_Locale $locale, string $fileType, string $filePath)
@@ -150,16 +150,16 @@  discard block
 block discarded – undo
150 150
         return $hashes;
151 151
     }
152 152
     
153
-   /**
154
-    * Sort the strings to ensure they always appear in the same order:
155
-    * first by text, and same strings by their hashes. This is important
156
-    * for strings that have the same translation to avoid them changing
157
-    * order between sorts.
158
-    *
159
-    * @param array $a
160
-    * @param array $b
161
-    * @return int
162
-    */
153
+    /**
154
+     * Sort the strings to ensure they always appear in the same order:
155
+     * first by text, and same strings by their hashes. This is important
156
+     * for strings that have the same translation to avoid them changing
157
+     * order between sorts.
158
+     *
159
+     * @param array $a
160
+     * @param array $b
161
+     * @return int
162
+     */
163 163
     public function callback_sortStrings(array $a, array $b) : int
164 164
     {
165 165
         $result = strnatcasecmp($a['text'], $b['text']);
Please login to merge, or discard this patch.
src/Localization/Parser/Token/Javascript.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@
 block discarded – undo
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];
Please login to merge, or discard this patch.
src/Localization/Scanner/StringInfo.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.