Passed
Push — master ( df2682...2600cb )
by Sebastian
04:55
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/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/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.
src/Localization/Parser.php 1 patch
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -30,14 +30,14 @@  discard block
 block discarded – undo
30 30
     const ERROR_UNSUPPORTED_FILE_EXTENSION = 40602;
31 31
     const ERROR_INVALID_LANGUAGE_CLASS = 40603;
32 32
     
33
-   /**
34
-    * @var Localization_Scanner
35
-    */
33
+    /**
34
+     * @var Localization_Scanner
35
+     */
36 36
     protected $scanner;
37 37
     
38
-   /**
39
-    * @var Localization_Scanner_StringsCollection
40
-    */
38
+    /**
39
+     * @var Localization_Scanner_StringsCollection
40
+     */
41 41
     protected $collection;
42 42
 
43 43
     /**
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
         $this->collection = $scanner->getCollection();
55 55
     }
56 56
     
57
-   /**
58
-    * Parses a source file. Must have a valid supported file extension.
59
-    * 
60
-    * @param string $path
61
-    * @return Localization_Parser_Language
62
-    * @throws Localization_Exception
63
-    * 
64
-    * @see Localization_Parser::ERROR_UNSUPPORTED_FILE_EXTENSION
65
-    */
57
+    /**
58
+     * Parses a source file. Must have a valid supported file extension.
59
+     * 
60
+     * @param string $path
61
+     * @return Localization_Parser_Language
62
+     * @throws Localization_Exception
63
+     * 
64
+     * @see Localization_Parser::ERROR_UNSUPPORTED_FILE_EXTENSION
65
+     */
66 66
     public function parseFile(string $path) : Localization_Parser_Language
67 67
     {
68 68
         $this->requireValidFile($path);
@@ -76,16 +76,16 @@  discard block
 block discarded – undo
76 76
         return $language;
77 77
     }
78 78
     
79
-   /**
80
-    * Parses the string for the specified language.
81
-    * 
82
-    * @param string $languageID
83
-    * @param string $code
84
-    * @return Localization_Parser_Language
85
-    * @throws Localization_Exception
86
-    * 
87
-    * @see Localization_Parser::ERROR_INVALID_LANGUAGE_ID
88
-    */
79
+    /**
80
+     * Parses the string for the specified language.
81
+     * 
82
+     * @param string $languageID
83
+     * @param string $code
84
+     * @return Localization_Parser_Language
85
+     * @throws Localization_Exception
86
+     * 
87
+     * @see Localization_Parser::ERROR_INVALID_LANGUAGE_ID
88
+     */
89 89
     public function parseString(string $languageID, string $code) : Localization_Parser_Language
90 90
     {
91 91
         $this->requireValidLanguageID($languageID);
@@ -144,18 +144,18 @@  discard block
 block discarded – undo
144 144
         );
145 145
     }
146 146
     
147
-   /**
148
-    * Retrieves a list of all language IDs that are supported.
149
-    * @return string[] IDs list like "PHP", "Javascript"
150
-    */
147
+    /**
148
+     * Retrieves a list of all language IDs that are supported.
149
+     * @return string[] IDs list like "PHP", "Javascript"
150
+     */
151 151
     public function getLanguageIDs() : array
152 152
     {
153 153
         return array_values($this->languageMappings);
154 154
     }
155 155
     
156
-   /**
157
-    * @var array<string,Localization_Parser_Language>
158
-    */
156
+    /**
157
+     * @var array<string,Localization_Parser_Language>
158
+     */
159 159
     protected $languageParsers = array();
160 160
 
161 161
     /**
@@ -209,12 +209,12 @@  discard block
 block discarded – undo
209 209
         );
210 210
     }
211 211
 
212
-   /**
213
-    * Whether the specified file extension is supported.
214
-    * 
215
-    * @param string $ext
216
-    * @return bool
217
-    */
212
+    /**
213
+     * Whether the specified file extension is supported.
214
+     * 
215
+     * @param string $ext
216
+     * @return bool
217
+     */
218 218
     public function isExtensionSupported(string $ext) : bool
219 219
     {
220 220
         $ext = strtolower($ext);
Please login to merge, or discard this patch.
src/Localization/Translator.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@  discard block
 block discarded – undo
57 57
     protected $reverseStrings = array();
58 58
 
59 59
     /**
60
-    * @var Localization_Source[]
61
-    */
60
+     * @var Localization_Source[]
61
+     */
62 62
     private $sources = array();
63 63
 
64 64
     /**
@@ -191,14 +191,14 @@  discard block
 block discarded – undo
191 191
         );
192 192
     }
193 193
     
194
-   /**
195
-    * Retrieves all available strings for the specified locale,
196
-    * as hash => text value pairs.
197
-    * 
198
-    * @param Localization_Locale $locale
199
-    * @throws Localization_Exception
200
-    * @return string[]
201
-    */
194
+    /**
195
+     * Retrieves all available strings for the specified locale,
196
+     * as hash => text value pairs.
197
+     * 
198
+     * @param Localization_Locale $locale
199
+     * @throws Localization_Exception
200
+     * @return string[]
201
+     */
202 202
     public function getStrings(Localization_Locale $locale) : array
203 203
     {
204 204
         $this->load($locale);
Please login to merge, or discard this patch.
src/Localization/Scanner.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -24,24 +24,24 @@  discard block
 block discarded – undo
24 24
  */
25 25
 class Localization_Scanner
26 26
 {
27
-   /**
28
-    * @var float
29
-    */
27
+    /**
28
+     * @var float
29
+     */
30 30
     protected $timeStart;
31 31
     
32
-   /**
33
-    * @var float
34
-    */
32
+    /**
33
+     * @var float
34
+     */
35 35
     protected $timeEnd;
36 36
     
37
-   /**
38
-    * @var array
39
-    */
37
+    /**
38
+     * @var array
39
+     */
40 40
     protected $stringInfos = array();
41 41
     
42
-   /**
43
-    * @var string
44
-    */
42
+    /**
43
+     * @var string
44
+     */
45 45
     protected $storageFile;
46 46
 
47 47
     /**
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
         return $this->getCollection()->countWarnings();
173 173
     }
174 174
     
175
-   /**
176
-    * Retrieves all warnings that have been registered
177
-    * during the last search for translatable texts.
178
-    * 
179
-    * @return Localization_Scanner_StringsCollection_Warning[]
180
-    */
175
+    /**
176
+     * Retrieves all warnings that have been registered
177
+     * during the last search for translatable texts.
178
+     * 
179
+     * @return Localization_Scanner_StringsCollection_Warning[]
180
+     */
181 181
     public function getWarnings() : array
182 182
     {
183 183
         return $this->getCollection()->getWarnings();
Please login to merge, or discard this patch.
src/Localization/Scanner/StringsCollection.php 1 patch
Indentation   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -12,19 +12,19 @@  discard block
 block discarded – undo
12 12
     
13 13
     const STORAGE_FORMAT_VERSION = 2;
14 14
     
15
-   /**
16
-    * @var Localization_Scanner
17
-    */
15
+    /**
16
+     * @var Localization_Scanner
17
+     */
18 18
     protected $scanner;
19 19
     
20
-   /**
21
-    * @var Localization_Scanner_StringHash[]
22
-    */
20
+    /**
21
+     * @var Localization_Scanner_StringHash[]
22
+     */
23 23
     protected $hashes = array();
24 24
     
25
-   /**
26
-    * @var array
27
-    */
25
+    /**
26
+     * @var array
27
+     */
28 28
     protected $warnings = array();
29 29
     
30 30
     public function __construct(Localization_Scanner $scanner)
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
         return new Localization_Scanner_StringInfo($this, $sourceID, $sourceType, $text);
53 53
     }
54 54
     
55
-   /**
56
-    * Adds a single translatable string.
57
-    * 
58
-    * @param Localization_Scanner_StringInfo $string
59
-    * @return Localization_Scanner_StringsCollection
60
-    */
55
+    /**
56
+     * Adds a single translatable string.
57
+     * 
58
+     * @param Localization_Scanner_StringInfo $string
59
+     * @return Localization_Scanner_StringsCollection
60
+     */
61 61
     protected function add(Localization_Scanner_StringInfo $string) : Localization_Scanner_StringsCollection
62 62
     {
63 63
         $hash = $string->getHash();
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
         return $this;
71 71
     }
72 72
     
73
-   /**
74
-    * Retrieves all available translatable strings,
75
-    * grouped by their hash to identify unique strings.
76
-    * 
77
-    * @return Localization_Scanner_StringHash[]
78
-    */
73
+    /**
74
+     * Retrieves all available translatable strings,
75
+     * grouped by their hash to identify unique strings.
76
+     * 
77
+     * @return Localization_Scanner_StringHash[]
78
+     */
79 79
     public function getHashes() : array
80 80
     {
81 81
         return array_values($this->hashes);
@@ -146,32 +146,32 @@  discard block
 block discarded – undo
146 146
         return true;
147 147
     }
148 148
     
149
-   /**
150
-    * Whether the parser reported warnings during the
151
-    * search for translatable texts.
152
-    * 
153
-    * @return bool
154
-    */
149
+    /**
150
+     * Whether the parser reported warnings during the
151
+     * search for translatable texts.
152
+     * 
153
+     * @return bool
154
+     */
155 155
     public function hasWarnings() : bool
156 156
     {
157 157
         return !empty($this->warnings);
158 158
     }
159 159
     
160
-   /**
161
-    * Retrieves the amount of warnings.
162
-    * @return int
163
-    */
160
+    /**
161
+     * Retrieves the amount of warnings.
162
+     * @return int
163
+     */
164 164
     public function countWarnings() : int
165 165
     {
166 166
         return count($this->warnings);
167 167
     }
168 168
     
169
-   /**
170
-    * Retrieves all warning messages that were added
171
-    * during the search for translatable texts, if any.
172
-    * 
173
-    * @return Localization_Scanner_StringsCollection_Warning[]
174
-    */
169
+    /**
170
+     * Retrieves all warning messages that were added
171
+     * during the search for translatable texts, if any.
172
+     * 
173
+     * @return Localization_Scanner_StringsCollection_Warning[]
174
+     */
175 175
     public function getWarnings() : array
176 176
     {
177 177
         $result = array();
@@ -198,12 +198,12 @@  discard block
 block discarded – undo
198 198
         return $amount;
199 199
     }
200 200
     
201
-   /**
202
-    * Retrieves all string hashed for the specified source.
203
-    * 
204
-    * @param string $id
205
-    * @return Localization_Scanner_StringHash[]
206
-    */
201
+    /**
202
+     * Retrieves all string hashed for the specified source.
203
+     * 
204
+     * @param string $id
205
+     * @return Localization_Scanner_StringHash[]
206
+     */
207 207
     public function getHashesBySourceID(string $id) : array
208 208
     {
209 209
         $hashes = array();
@@ -217,12 +217,12 @@  discard block
 block discarded – undo
217 217
         return $hashes;
218 218
     }
219 219
     
220
-   /**
221
-    * Retrieves all hashes for the specified language ID.
222
-    * 
223
-    * @param string $languageID The language ID, e.g. "PHP"
224
-    * @return Localization_Scanner_StringHash[]
225
-    */
220
+    /**
221
+     * Retrieves all hashes for the specified language ID.
222
+     * 
223
+     * @param string $languageID The language ID, e.g. "PHP"
224
+     * @return Localization_Scanner_StringHash[]
225
+     */
226 226
     public function getHashesByLanguageID(string $languageID) : array
227 227
     {
228 228
         $hashes = array();
Please login to merge, or discard this patch.
src/Localization/Editor/Filters.php 1 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.