@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | const EVENT_LOCALE_CHANGED = 'LocaleChanged'; |
49 | 49 | |
50 | 50 | /** |
51 | - * Collection of all locales by namespace (application, content, custom...). |
|
52 | - * |
|
53 | - * @var array<string,array<string,Localization_Locale>> |
|
54 | - * @see Localization::addLocale() |
|
55 | - */ |
|
51 | + * Collection of all locales by namespace (application, content, custom...). |
|
52 | + * |
|
53 | + * @var array<string,array<string,Localization_Locale>> |
|
54 | + * @see Localization::addLocale() |
|
55 | + */ |
|
56 | 56 | protected static $locales = array(); |
57 | 57 | |
58 | 58 | /** |
@@ -61,57 +61,57 @@ discard block |
||
61 | 61 | */ |
62 | 62 | private static $initDone = false; |
63 | 63 | |
64 | - /** |
|
65 | - * Path to the file in which the scanner results are stored. |
|
66 | - * @var string |
|
67 | - * @see Localization::configure() |
|
68 | - */ |
|
64 | + /** |
|
65 | + * Path to the file in which the scanner results are stored. |
|
66 | + * @var string |
|
67 | + * @see Localization::configure() |
|
68 | + */ |
|
69 | 69 | protected static $storageFile = ''; |
70 | 70 | |
71 | - /** |
|
72 | - * Path to the folder into which the client libraries are written. |
|
73 | - * @var string |
|
74 | - * @see Localization::setClientLibrariesFolder() |
|
75 | - */ |
|
71 | + /** |
|
72 | + * Path to the folder into which the client libraries are written. |
|
73 | + * @var string |
|
74 | + * @see Localization::setClientLibrariesFolder() |
|
75 | + */ |
|
76 | 76 | protected static $clientFolder = ''; |
77 | 77 | |
78 | - /** |
|
79 | - * If this key changes, client libraries are refreshed. |
|
80 | - * @var string |
|
81 | - * @see Localization::setClientLibrariesCacheKey() |
|
82 | - */ |
|
78 | + /** |
|
79 | + * If this key changes, client libraries are refreshed. |
|
80 | + * @var string |
|
81 | + * @see Localization::setClientLibrariesCacheKey() |
|
82 | + */ |
|
83 | 83 | protected static $clientCacheKey = ''; |
84 | 84 | |
85 | - /** |
|
86 | - * Whether the configuration has been made. |
|
87 | - * @var bool |
|
88 | - * @see Localization::configure() |
|
89 | - */ |
|
85 | + /** |
|
86 | + * Whether the configuration has been made. |
|
87 | + * @var bool |
|
88 | + * @see Localization::configure() |
|
89 | + */ |
|
90 | 90 | protected static $configured = false; |
91 | 91 | |
92 | - /** |
|
93 | - * Stores event listener instances. |
|
94 | - * @var array |
|
95 | - */ |
|
92 | + /** |
|
93 | + * Stores event listener instances. |
|
94 | + * @var array |
|
95 | + */ |
|
96 | 96 | protected static $listeners = array(); |
97 | 97 | |
98 | - /** |
|
99 | - * @var integer |
|
100 | - * @see Localization::addEventListener() |
|
101 | - */ |
|
98 | + /** |
|
99 | + * @var integer |
|
100 | + * @see Localization::addEventListener() |
|
101 | + */ |
|
102 | 102 | protected static $listenersCounter = 0; |
103 | 103 | |
104 | - /** |
|
105 | - * @var Localization_Translator|NULL |
|
106 | - */ |
|
104 | + /** |
|
105 | + * @var Localization_Translator|NULL |
|
106 | + */ |
|
107 | 107 | protected static $translator; |
108 | 108 | |
109 | - /** |
|
110 | - * Initializes the localization layer. This is done |
|
111 | - * automatically, and only once per request. |
|
112 | - * |
|
113 | - * (Called at the end of this file) |
|
114 | - */ |
|
109 | + /** |
|
110 | + * Initializes the localization layer. This is done |
|
111 | + * automatically, and only once per request. |
|
112 | + * |
|
113 | + * (Called at the end of this file) |
|
114 | + */ |
|
115 | 115 | public static function init() : void |
116 | 116 | { |
117 | 117 | if(self::$initDone) { |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | return self::getLocalesByNS(self::NAMESPACE_APPLICATION); |
151 | 151 | } |
152 | 152 | |
153 | - /** |
|
154 | - * Retrieves all locales in the specified namespace. |
|
155 | - * |
|
156 | - * @param string $namespace |
|
157 | - * @return Localization_Locale[] |
|
158 | - */ |
|
153 | + /** |
|
154 | + * Retrieves all locales in the specified namespace. |
|
155 | + * |
|
156 | + * @param string $namespace |
|
157 | + * @return Localization_Locale[] |
|
158 | + */ |
|
159 | 159 | public static function getLocalesByNS(string $namespace) |
160 | 160 | { |
161 | 161 | if(isset(self::$locales[$namespace])) { |
@@ -172,35 +172,35 @@ discard block |
||
172 | 172 | ); |
173 | 173 | } |
174 | 174 | |
175 | - /** |
|
176 | - * Adds an application locale to use in the application. |
|
177 | - * |
|
178 | - * @param string $localeName |
|
179 | - * @return Localization_Locale |
|
180 | - */ |
|
175 | + /** |
|
176 | + * Adds an application locale to use in the application. |
|
177 | + * |
|
178 | + * @param string $localeName |
|
179 | + * @return Localization_Locale |
|
180 | + */ |
|
181 | 181 | public static function addAppLocale(string $localeName) : Localization_Locale |
182 | 182 | { |
183 | 183 | return self::addLocaleByNS($localeName, self::NAMESPACE_APPLICATION); |
184 | 184 | } |
185 | 185 | |
186 | - /** |
|
187 | - * Adds a content locale to use for content in the application. |
|
188 | - * |
|
189 | - * @param string $localeName |
|
190 | - * @return Localization_Locale |
|
191 | - */ |
|
186 | + /** |
|
187 | + * Adds a content locale to use for content in the application. |
|
188 | + * |
|
189 | + * @param string $localeName |
|
190 | + * @return Localization_Locale |
|
191 | + */ |
|
192 | 192 | public static function addContentLocale(string $localeName) : Localization_Locale |
193 | 193 | { |
194 | 194 | return self::addLocaleByNS($localeName, self::NAMESPACE_CONTENT); |
195 | 195 | } |
196 | 196 | |
197 | - /** |
|
198 | - * Adds a locale to the specified namespace. |
|
199 | - * |
|
200 | - * @param string $localeName |
|
201 | - * @param string $namespace |
|
202 | - * @return Localization_Locale |
|
203 | - */ |
|
197 | + /** |
|
198 | + * Adds a locale to the specified namespace. |
|
199 | + * |
|
200 | + * @param string $localeName |
|
201 | + * @param string $namespace |
|
202 | + * @return Localization_Locale |
|
203 | + */ |
|
204 | 204 | public static function addLocaleByNS(string $localeName, string $namespace) : Localization_Locale |
205 | 205 | { |
206 | 206 | if(!isset(self::$locales[$namespace])) { |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | return new $className(); |
243 | 243 | } |
244 | 244 | |
245 | - /** |
|
246 | - * Retrieves the currency of the selected app locale. |
|
247 | - * |
|
248 | - * @return Localization_Currency |
|
249 | - */ |
|
245 | + /** |
|
246 | + * Retrieves the currency of the selected app locale. |
|
247 | + * |
|
248 | + * @return Localization_Currency |
|
249 | + */ |
|
250 | 250 | public static function getAppCurrency() : Localization_Currency |
251 | 251 | { |
252 | 252 | return self::getCurrencyNS(self::NAMESPACE_APPLICATION); |
@@ -283,44 +283,44 @@ discard block |
||
283 | 283 | return self::getSelectedLocaleByNS(self::NAMESPACE_APPLICATION); |
284 | 284 | } |
285 | 285 | |
286 | - /** |
|
287 | - * Retrieves the name of the selected application locale. |
|
288 | - * |
|
289 | - * @return string |
|
290 | - */ |
|
286 | + /** |
|
287 | + * Retrieves the name of the selected application locale. |
|
288 | + * |
|
289 | + * @return string |
|
290 | + */ |
|
291 | 291 | public static function getAppLocaleName() : string |
292 | 292 | { |
293 | 293 | return self::getLocaleNameByNS(self::NAMESPACE_APPLICATION); |
294 | 294 | } |
295 | 295 | |
296 | - /** |
|
297 | - * Retrieves the names of the available application locales. |
|
298 | - * @return string[] |
|
299 | - */ |
|
296 | + /** |
|
297 | + * Retrieves the names of the available application locales. |
|
298 | + * @return string[] |
|
299 | + */ |
|
300 | 300 | public static function getAppLocaleNames() : array |
301 | 301 | { |
302 | 302 | return self::getLocaleNamesByNS(self::NAMESPACE_APPLICATION); |
303 | 303 | } |
304 | 304 | |
305 | - /** |
|
306 | - * Retrieves the selected locale name in the specified namespace. |
|
307 | - * |
|
308 | - * @param string $namespace |
|
309 | - * @throws Localization_Exception |
|
310 | - * @return string |
|
311 | - */ |
|
305 | + /** |
|
306 | + * Retrieves the selected locale name in the specified namespace. |
|
307 | + * |
|
308 | + * @param string $namespace |
|
309 | + * @throws Localization_Exception |
|
310 | + * @return string |
|
311 | + */ |
|
312 | 312 | public static function getLocaleNameByNS(string $namespace) : string |
313 | 313 | { |
314 | 314 | return self::getSelectedLocaleByNS($namespace)->getName(); |
315 | 315 | } |
316 | 316 | |
317 | - /** |
|
318 | - * Retrieves the selected locale instance for the specified namespace. |
|
319 | - * |
|
320 | - * @param string $namespace |
|
321 | - * @return Localization_Locale |
|
322 | - * @throws Localization_Exception |
|
323 | - */ |
|
317 | + /** |
|
318 | + * Retrieves the selected locale instance for the specified namespace. |
|
319 | + * |
|
320 | + * @param string $namespace |
|
321 | + * @return Localization_Locale |
|
322 | + * @throws Localization_Exception |
|
323 | + */ |
|
324 | 324 | public static function getSelectedLocaleByNS(string $namespace) : Localization_Locale |
325 | 325 | { |
326 | 326 | self::requireNamespace($namespace); |
@@ -339,24 +339,24 @@ discard block |
||
339 | 339 | ); |
340 | 340 | } |
341 | 341 | |
342 | - /** |
|
343 | - * Stores the selected locale names by namespace. |
|
344 | - * @var array<string,Localization_Locale> |
|
345 | - */ |
|
342 | + /** |
|
343 | + * Stores the selected locale names by namespace. |
|
344 | + * @var array<string,Localization_Locale> |
|
345 | + */ |
|
346 | 346 | protected static $selected = array(); |
347 | 347 | |
348 | - /** |
|
349 | - * Selects the active locale for the specified namespace. |
|
350 | - * |
|
351 | - * NOTE: Triggers the "LocaleChanged" event. |
|
352 | - * |
|
353 | - * @param string $localeName |
|
354 | - * @param string $namespace |
|
355 | - * @return Localization_Locale |
|
356 | - * @throws Localization_Exception |
|
357 | - * |
|
358 | - * @see Localization_Event_LocaleChanged |
|
359 | - */ |
|
348 | + /** |
|
349 | + * Selects the active locale for the specified namespace. |
|
350 | + * |
|
351 | + * NOTE: Triggers the "LocaleChanged" event. |
|
352 | + * |
|
353 | + * @param string $localeName |
|
354 | + * @param string $namespace |
|
355 | + * @return Localization_Locale |
|
356 | + * @throws Localization_Exception |
|
357 | + * |
|
358 | + * @see Localization_Event_LocaleChanged |
|
359 | + */ |
|
360 | 360 | public static function selectLocaleByNS(string $localeName, string $namespace) : Localization_Locale |
361 | 361 | { |
362 | 362 | self::requireNamespace($namespace); |
@@ -487,15 +487,15 @@ discard block |
||
487 | 487 | return self::selectLocaleByNS($localeName, self::NAMESPACE_APPLICATION); |
488 | 488 | } |
489 | 489 | |
490 | - /** |
|
491 | - * Retrieves an application locale by its name. |
|
492 | - * Note that the locale must have been added first. |
|
493 | - * |
|
494 | - * @param string $localeName |
|
495 | - * @throws Localization_Exception |
|
496 | - * @return Localization_Locale |
|
497 | - * @see Localization::appLocaleExists() |
|
498 | - */ |
|
490 | + /** |
|
491 | + * Retrieves an application locale by its name. |
|
492 | + * Note that the locale must have been added first. |
|
493 | + * |
|
494 | + * @param string $localeName |
|
495 | + * @throws Localization_Exception |
|
496 | + * @return Localization_Locale |
|
497 | + * @see Localization::appLocaleExists() |
|
498 | + */ |
|
499 | 499 | public static function getAppLocaleByName(string $localeName) : Localization_Locale |
500 | 500 | { |
501 | 501 | return self::getLocaleByNameNS($localeName, self::NAMESPACE_APPLICATION); |
@@ -530,10 +530,10 @@ discard block |
||
530 | 530 | return self::getLocalesByNS(self::NAMESPACE_CONTENT); |
531 | 531 | } |
532 | 532 | |
533 | - /** |
|
534 | - * Retrieves the names of all content locales that have been added. |
|
535 | - * @return string[] |
|
536 | - */ |
|
533 | + /** |
|
534 | + * Retrieves the names of all content locales that have been added. |
|
535 | + * @return string[] |
|
536 | + */ |
|
537 | 537 | public static function getContentLocaleNames() |
538 | 538 | { |
539 | 539 | return self::getLocaleNamesByNS(self::NAMESPACE_CONTENT); |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | sort($names); |
557 | 557 | |
558 | 558 | return $names; |
559 | - } |
|
559 | + } |
|
560 | 560 | |
561 | 561 | /** |
562 | 562 | * Checks by the locale name if the specified locale is |
@@ -585,14 +585,14 @@ discard block |
||
585 | 585 | return self::getLocaleByNameNS($localeName, self::NAMESPACE_CONTENT); |
586 | 586 | } |
587 | 587 | |
588 | - /** |
|
589 | - * Retrieves a locale by its name in the specified namespace. |
|
590 | - * |
|
591 | - * @param string $localeName |
|
592 | - * @param string $namespace |
|
593 | - * @throws Localization_Exception |
|
594 | - * @return Localization_Locale |
|
595 | - */ |
|
588 | + /** |
|
589 | + * Retrieves a locale by its name in the specified namespace. |
|
590 | + * |
|
591 | + * @param string $localeName |
|
592 | + * @param string $namespace |
|
593 | + * @throws Localization_Exception |
|
594 | + * @return Localization_Locale |
|
595 | + */ |
|
596 | 596 | public static function getLocaleByNameNS(string $localeName, string $namespace) : Localization_Locale |
597 | 597 | { |
598 | 598 | self::requireNamespace($namespace); |
@@ -663,10 +663,10 @@ discard block |
||
663 | 663 | return self::selectLocaleByNS($localeName, self::NAMESPACE_CONTENT); |
664 | 664 | } |
665 | 665 | |
666 | - /** |
|
667 | - * Checks whether the localization has been configured entirely. |
|
668 | - * @return bool |
|
669 | - */ |
|
666 | + /** |
|
667 | + * Checks whether the localization has been configured entirely. |
|
668 | + * @return bool |
|
669 | + */ |
|
670 | 670 | public static function isConfigured() : bool |
671 | 671 | { |
672 | 672 | return self::$configured; |
@@ -738,29 +738,29 @@ discard block |
||
738 | 738 | ); |
739 | 739 | } |
740 | 740 | |
741 | - /** |
|
742 | - * Injects a content locales selector element into the specified |
|
743 | - * HTML QuickForm2 container. |
|
744 | - * |
|
745 | - * @param string $elementName |
|
746 | - * @param HTML_QuickForm2_Container $container |
|
747 | - * @param string $label |
|
748 | - * @return HTML_QuickForm2_Element_Select |
|
749 | - */ |
|
741 | + /** |
|
742 | + * Injects a content locales selector element into the specified |
|
743 | + * HTML QuickForm2 container. |
|
744 | + * |
|
745 | + * @param string $elementName |
|
746 | + * @param HTML_QuickForm2_Container $container |
|
747 | + * @param string $label |
|
748 | + * @return HTML_QuickForm2_Element_Select |
|
749 | + */ |
|
750 | 750 | public static function injectContentLocalesSelector(string $elementName, HTML_QuickForm2_Container $container, string $label='') : HTML_QuickForm2_Element_Select |
751 | 751 | { |
752 | 752 | return self::injectLocalesSelectorNS($elementName, self::NAMESPACE_CONTENT, $container, $label); |
753 | 753 | } |
754 | 754 | |
755 | - /** |
|
756 | - * Injects an app locales selector element into the specified |
|
755 | + /** |
|
756 | + * Injects an app locales selector element into the specified |
|
757 | 757 | * HTML QuickForm2 container. |
758 | 758 | * |
759 | - * @param string $elementName |
|
760 | - * @param HTML_QuickForm2_Container $container |
|
761 | - * @param string $label |
|
762 | - * @return HTML_QuickForm2_Element_Select |
|
763 | - */ |
|
759 | + * @param string $elementName |
|
760 | + * @param HTML_QuickForm2_Container $container |
|
761 | + * @param string $label |
|
762 | + * @return HTML_QuickForm2_Element_Select |
|
763 | + */ |
|
764 | 764 | public static function injectAppLocalesSelector(string $elementName, HTML_QuickForm2_Container $container, string $label='') : HTML_QuickForm2_Element_Select |
765 | 765 | { |
766 | 766 | return self::injectLocalesSelectorNS($elementName, self::NAMESPACE_APPLICATION, $container, $label); |
@@ -796,26 +796,26 @@ discard block |
||
796 | 796 | return $select; |
797 | 797 | } |
798 | 798 | |
799 | - /** |
|
800 | - * @var Localization_Source[] |
|
801 | - */ |
|
799 | + /** |
|
800 | + * @var Localization_Source[] |
|
801 | + */ |
|
802 | 802 | protected static $sources = array(); |
803 | 803 | |
804 | - /** |
|
805 | - * @var string[] |
|
806 | - */ |
|
804 | + /** |
|
805 | + * @var string[] |
|
806 | + */ |
|
807 | 807 | protected static $excludeFolders = array(); |
808 | 808 | |
809 | - /** |
|
810 | - * @var string[] |
|
811 | - */ |
|
809 | + /** |
|
810 | + * @var string[] |
|
811 | + */ |
|
812 | 812 | protected static $excludeFiles = array(); |
813 | 813 | |
814 | - /** |
|
815 | - * Retrieves all currently available sources. |
|
816 | - * |
|
817 | - * @return Localization_Source[] |
|
818 | - */ |
|
814 | + /** |
|
815 | + * Retrieves all currently available sources. |
|
816 | + * |
|
817 | + * @return Localization_Source[] |
|
818 | + */ |
|
819 | 819 | public static function getSources() : array |
820 | 820 | { |
821 | 821 | return self::$sources; |
@@ -847,10 +847,10 @@ discard block |
||
847 | 847 | return $source; |
848 | 848 | } |
849 | 849 | |
850 | - /** |
|
851 | - * Retrieves all sources grouped by their group name. |
|
852 | - * @return array |
|
853 | - */ |
|
850 | + /** |
|
851 | + * Retrieves all sources grouped by their group name. |
|
852 | + * @return array |
|
853 | + */ |
|
854 | 854 | public static function getSourcesGrouped() |
855 | 855 | { |
856 | 856 | $sources = self::getSources(); |
@@ -871,11 +871,11 @@ discard block |
||
871 | 871 | return $grouped; |
872 | 872 | } |
873 | 873 | |
874 | - /** |
|
875 | - * Checks whether a specific source exists by its ID. |
|
876 | - * @param string $sourceID |
|
877 | - * @return boolean |
|
878 | - */ |
|
874 | + /** |
|
875 | + * Checks whether a specific source exists by its ID. |
|
876 | + * @param string $sourceID |
|
877 | + * @return boolean |
|
878 | + */ |
|
879 | 879 | public static function sourceExists(string $sourceID) : bool |
880 | 880 | { |
881 | 881 | $sources = self::getSources(); |
@@ -888,11 +888,11 @@ discard block |
||
888 | 888 | return false; |
889 | 889 | } |
890 | 890 | |
891 | - /** |
|
892 | - * Checks whether a specific source exists by its alias. |
|
893 | - * @param string $sourceAlias |
|
894 | - * @return boolean |
|
895 | - */ |
|
891 | + /** |
|
892 | + * Checks whether a specific source exists by its alias. |
|
893 | + * @param string $sourceAlias |
|
894 | + * @return boolean |
|
895 | + */ |
|
896 | 896 | public static function sourceAliasExists(string $sourceAlias) : bool |
897 | 897 | { |
898 | 898 | $sources = self::getSources(); |
@@ -905,13 +905,13 @@ discard block |
||
905 | 905 | return false; |
906 | 906 | } |
907 | 907 | |
908 | - /** |
|
909 | - * Retrieves a localization source by its ID. |
|
910 | - * |
|
911 | - * @param string $sourceID |
|
912 | - * @throws Localization_Exception |
|
913 | - * @return Localization_Source |
|
914 | - */ |
|
908 | + /** |
|
909 | + * Retrieves a localization source by its ID. |
|
910 | + * |
|
911 | + * @param string $sourceID |
|
912 | + * @throws Localization_Exception |
|
913 | + * @return Localization_Source |
|
914 | + */ |
|
915 | 915 | public static function getSourceByID(string $sourceID) : Localization_Source |
916 | 916 | { |
917 | 917 | $sources = self::getSources(); |
@@ -976,14 +976,14 @@ discard block |
||
976 | 976 | // FIXME: TODO: Add this |
977 | 977 | } |
978 | 978 | |
979 | - /** |
|
980 | - * Configures the localization for the application: |
|
981 | - * sets the location of the required files and folders. |
|
982 | - * Also updated the client library files as needed. |
|
983 | - * |
|
984 | - * @param string $storageFile Where to store the file analysis storage file. |
|
985 | - * @param string $clientLibrariesFolder Where to put the client libraries and translation files. Will be created if it does not exist. Optional: if not set, client libraries will not be created. |
|
986 | - */ |
|
979 | + /** |
|
980 | + * Configures the localization for the application: |
|
981 | + * sets the location of the required files and folders. |
|
982 | + * Also updated the client library files as needed. |
|
983 | + * |
|
984 | + * @param string $storageFile Where to store the file analysis storage file. |
|
985 | + * @param string $clientLibrariesFolder Where to put the client libraries and translation files. Will be created if it does not exist. Optional: if not set, client libraries will not be created. |
|
986 | + */ |
|
987 | 987 | public static function configure(string $storageFile, string $clientLibrariesFolder='') : void |
988 | 988 | { |
989 | 989 | self::$configured = true; |
@@ -999,17 +999,17 @@ discard block |
||
999 | 999 | } |
1000 | 1000 | } |
1001 | 1001 | |
1002 | - /** |
|
1003 | - * Sets a key that is used to verify whether the client |
|
1004 | - * libraries have to be refreshed. A common use is to set |
|
1005 | - * this to the application's version number to guarantee |
|
1006 | - * new texts are automatically used with each release. |
|
1007 | - * |
|
1008 | - * NOTE: Otherwise files are refreshed only when saving |
|
1009 | - * them in the editor UI. |
|
1010 | - * |
|
1011 | - * @param string $key |
|
1012 | - */ |
|
1002 | + /** |
|
1003 | + * Sets a key that is used to verify whether the client |
|
1004 | + * libraries have to be refreshed. A common use is to set |
|
1005 | + * this to the application's version number to guarantee |
|
1006 | + * new texts are automatically used with each release. |
|
1007 | + * |
|
1008 | + * NOTE: Otherwise files are refreshed only when saving |
|
1009 | + * them in the editor UI. |
|
1010 | + * |
|
1011 | + * @param string $key |
|
1012 | + */ |
|
1013 | 1013 | public static function setClientLibrariesCacheKey(string $key) : void |
1014 | 1014 | { |
1015 | 1015 | self::$clientCacheKey = $key; |
@@ -1020,23 +1020,23 @@ discard block |
||
1020 | 1020 | return self::$clientCacheKey; |
1021 | 1021 | } |
1022 | 1022 | |
1023 | - /** |
|
1024 | - * Sets the folder where client libraries are to be stored. |
|
1025 | - * @param string $folder |
|
1026 | - */ |
|
1023 | + /** |
|
1024 | + * Sets the folder where client libraries are to be stored. |
|
1025 | + * @param string $folder |
|
1026 | + */ |
|
1027 | 1027 | public static function setClientLibrariesFolder(string $folder) : void |
1028 | 1028 | { |
1029 | 1029 | self::$clientFolder = $folder; |
1030 | 1030 | } |
1031 | 1031 | |
1032 | - /** |
|
1033 | - * Retrieves the path to the folder in which the client |
|
1034 | - * libraries should be stored. |
|
1035 | - * |
|
1036 | - * NOTE: Can return an empty string, when this is disabled. |
|
1037 | - * |
|
1038 | - * @return string |
|
1039 | - */ |
|
1032 | + /** |
|
1033 | + * Retrieves the path to the folder in which the client |
|
1034 | + * libraries should be stored. |
|
1035 | + * |
|
1036 | + * NOTE: Can return an empty string, when this is disabled. |
|
1037 | + * |
|
1038 | + * @return string |
|
1039 | + */ |
|
1040 | 1040 | public static function getClientLibrariesFolder() : string |
1041 | 1041 | { |
1042 | 1042 | return self::$clientFolder; |
@@ -1056,13 +1056,13 @@ discard block |
||
1056 | 1056 | self::createGenerator()->writeFiles($force); |
1057 | 1057 | } |
1058 | 1058 | |
1059 | - /** |
|
1060 | - * Creates a new instance of the client generator class |
|
1061 | - * that is used to write the localization files into the |
|
1062 | - * target folder on disk. |
|
1063 | - * |
|
1064 | - * @return Localization_ClientGenerator |
|
1065 | - */ |
|
1059 | + /** |
|
1060 | + * Creates a new instance of the client generator class |
|
1061 | + * that is used to write the localization files into the |
|
1062 | + * target folder on disk. |
|
1063 | + * |
|
1064 | + * @return Localization_ClientGenerator |
|
1065 | + */ |
|
1066 | 1066 | public static function createGenerator() : Localization_ClientGenerator |
1067 | 1067 | { |
1068 | 1068 | return new Localization_ClientGenerator(); |
@@ -1127,10 +1127,10 @@ discard block |
||
1127 | 1127 | return new Localization_Editor(); |
1128 | 1128 | } |
1129 | 1129 | |
1130 | - /** |
|
1131 | - * Retrieves a list of all available source IDs. |
|
1132 | - * @return string[] |
|
1133 | - */ |
|
1130 | + /** |
|
1131 | + * Retrieves a list of all available source IDs. |
|
1132 | + * @return string[] |
|
1133 | + */ |
|
1134 | 1134 | public static function getSourceIDs() : array |
1135 | 1135 | { |
1136 | 1136 | $ids = array(); |
@@ -1157,9 +1157,9 @@ discard block |
||
1157 | 1157 | return $aliases; |
1158 | 1158 | } |
1159 | 1159 | |
1160 | - /** |
|
1161 | - * Resets all locales to the built-in locale. |
|
1162 | - */ |
|
1160 | + /** |
|
1161 | + * Resets all locales to the built-in locale. |
|
1162 | + */ |
|
1163 | 1163 | public static function reset() : void |
1164 | 1164 | { |
1165 | 1165 | self::$locales = array(); |
@@ -1191,22 +1191,22 @@ discard block |
||
1191 | 1191 | 'de_CH' |
1192 | 1192 | ); |
1193 | 1193 | |
1194 | - /** |
|
1195 | - * Retrieves a list of all supported locales. |
|
1196 | - * |
|
1197 | - * @return string[] |
|
1198 | - */ |
|
1194 | + /** |
|
1195 | + * Retrieves a list of all supported locales. |
|
1196 | + * |
|
1197 | + * @return string[] |
|
1198 | + */ |
|
1199 | 1199 | public static function getSupportedLocaleNames() : array |
1200 | 1200 | { |
1201 | 1201 | return self::$supportedLocales; |
1202 | 1202 | } |
1203 | 1203 | |
1204 | - /** |
|
1205 | - * Checks whether the specified locale is supported. |
|
1206 | - * |
|
1207 | - * @param string $localeName |
|
1208 | - * @return bool |
|
1209 | - */ |
|
1204 | + /** |
|
1205 | + * Checks whether the specified locale is supported. |
|
1206 | + * |
|
1207 | + * @param string $localeName |
|
1208 | + * @return bool |
|
1209 | + */ |
|
1210 | 1210 | public static function isLocaleSupported(string $localeName) : bool |
1211 | 1211 | { |
1212 | 1212 | return in_array($localeName, self::$supportedLocales); |
@@ -9,24 +9,24 @@ |
||
9 | 9 | |
10 | 10 | class Localization_Source_Folder extends Localization_Source |
11 | 11 | { |
12 | - /** |
|
13 | - * The folder under which all translatable files are kept. |
|
14 | - * @var string |
|
15 | - */ |
|
12 | + /** |
|
13 | + * The folder under which all translatable files are kept. |
|
14 | + * @var string |
|
15 | + */ |
|
16 | 16 | protected $sourcesFolder; |
17 | 17 | |
18 | - /** |
|
19 | - * @var string |
|
20 | - */ |
|
18 | + /** |
|
19 | + * @var string |
|
20 | + */ |
|
21 | 21 | protected $id; |
22 | 22 | |
23 | - /** |
|
24 | - * @param string $alias An alias for this source, to recognize it by. |
|
25 | - * @param string $label The human-readable label, used in the editor. |
|
26 | - * @param string $group A human-readable group label to group several sources by. Used in the editor. |
|
27 | - * @param string $storageFolder The folder in which to store the localization files. |
|
28 | - * @param string $sourcesFolder The folder in which to analyze files to find translatable strings. |
|
29 | - */ |
|
23 | + /** |
|
24 | + * @param string $alias An alias for this source, to recognize it by. |
|
25 | + * @param string $label The human-readable label, used in the editor. |
|
26 | + * @param string $group A human-readable group label to group several sources by. Used in the editor. |
|
27 | + * @param string $storageFolder The folder in which to store the localization files. |
|
28 | + * @param string $sourcesFolder The folder in which to analyze files to find translatable strings. |
|
29 | + */ |
|
30 | 30 | public function __construct(string $alias, string $label, string $group, string $storageFolder, string $sourcesFolder) |
31 | 31 | { |
32 | 32 | parent::__construct($alias, $label, $group, $storageFolder); |
@@ -6,39 +6,39 @@ |
||
6 | 6 | |
7 | 7 | abstract class Localization_Source |
8 | 8 | { |
9 | - /** |
|
10 | - * Human-readable label for the source. |
|
11 | - * @var string |
|
12 | - */ |
|
9 | + /** |
|
10 | + * Human-readable label for the source. |
|
11 | + * @var string |
|
12 | + */ |
|
13 | 13 | protected $label; |
14 | 14 | |
15 | - /** |
|
16 | - * Human-readable group name to categorize the source. |
|
17 | - * @var string |
|
18 | - */ |
|
15 | + /** |
|
16 | + * Human-readable group name to categorize the source. |
|
17 | + * @var string |
|
18 | + */ |
|
19 | 19 | protected $group; |
20 | 20 | |
21 | - /** |
|
22 | - * The folder in which the localization files are stored |
|
23 | - * @var string |
|
24 | - */ |
|
21 | + /** |
|
22 | + * The folder in which the localization files are stored |
|
23 | + * @var string |
|
24 | + */ |
|
25 | 25 | protected $storageFolder; |
26 | 26 | |
27 | - /** |
|
28 | - * @var string |
|
29 | - */ |
|
27 | + /** |
|
28 | + * @var string |
|
29 | + */ |
|
30 | 30 | protected $alias; |
31 | 31 | |
32 | - /** |
|
33 | - * Available during scanning. |
|
34 | - * @var Localization_Scanner_StringsCollection|NULL |
|
35 | - */ |
|
32 | + /** |
|
33 | + * Available during scanning. |
|
34 | + * @var Localization_Scanner_StringsCollection|NULL |
|
35 | + */ |
|
36 | 36 | protected $collection; |
37 | 37 | |
38 | - /** |
|
39 | - * Available during scanning. |
|
40 | - * @var Localization_Parser|NULL |
|
41 | - */ |
|
38 | + /** |
|
39 | + * Available during scanning. |
|
40 | + * @var Localization_Parser|NULL |
|
41 | + */ |
|
42 | 42 | protected $parser; |
43 | 43 | |
44 | 44 | public function __construct(string $alias, string $label, string $group, string $storageFolder) |
@@ -30,14 +30,14 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -57,8 +57,8 @@ discard block |
||
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 |
||
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); |
@@ -8,14 +8,14 @@ discard block |
||
8 | 8 | |
9 | 9 | abstract class Localization_Parser_Token |
10 | 10 | { |
11 | - /** |
|
12 | - * @var array|string |
|
13 | - */ |
|
11 | + /** |
|
12 | + * @var array|string |
|
13 | + */ |
|
14 | 14 | protected $definition; |
15 | 15 | |
16 | - /** |
|
17 | - * @var Localization_Parser_Token |
|
18 | - */ |
|
16 | + /** |
|
17 | + * @var Localization_Parser_Token |
|
18 | + */ |
|
19 | 19 | protected $parentToken; |
20 | 20 | |
21 | 21 | /** |
@@ -98,6 +98,6 @@ discard block |
||
98 | 98 | 'value' => $this->getValue(), |
99 | 99 | 'line' => $this->getLine(), |
100 | 100 | 'isEncapsedString' => ConvertHelper::bool2string($this->isEncapsedString()) |
101 | - ); |
|
101 | + ); |
|
102 | 102 | } |
103 | 103 | } |
@@ -23,49 +23,49 @@ discard block |
||
23 | 23 | */ |
24 | 24 | protected $parser; |
25 | 25 | |
26 | - /** |
|
27 | - * The function names that are included in the search. |
|
28 | - * @var array |
|
29 | - */ |
|
26 | + /** |
|
27 | + * The function names that are included in the search. |
|
28 | + * @var array |
|
29 | + */ |
|
30 | 30 | protected $functionNames = array(); |
31 | 31 | |
32 | - /** |
|
33 | - * The tokens definitions. |
|
34 | - * @var array |
|
35 | - */ |
|
32 | + /** |
|
33 | + * The tokens definitions. |
|
34 | + * @var array |
|
35 | + */ |
|
36 | 36 | protected $tokens = array(); |
37 | 37 | |
38 | - /** |
|
39 | - * The total amount of tokens found in the content. |
|
40 | - * @var integer |
|
41 | - */ |
|
38 | + /** |
|
39 | + * The total amount of tokens found in the content. |
|
40 | + * @var integer |
|
41 | + */ |
|
42 | 42 | protected $totalTokens = 0; |
43 | 43 | |
44 | - /** |
|
45 | - * All texts that have been collected. |
|
46 | - * @var Text[] |
|
47 | - */ |
|
44 | + /** |
|
45 | + * All texts that have been collected. |
|
46 | + * @var Text[] |
|
47 | + */ |
|
48 | 48 | protected $texts = array(); |
49 | 49 | |
50 | - /** |
|
51 | - * @var string |
|
52 | - */ |
|
50 | + /** |
|
51 | + * @var string |
|
52 | + */ |
|
53 | 53 | protected $content = ''; |
54 | 54 | |
55 | - /** |
|
56 | - * @var string|NULL |
|
57 | - */ |
|
55 | + /** |
|
56 | + * @var string|NULL |
|
57 | + */ |
|
58 | 58 | protected $id; |
59 | 59 | |
60 | - /** |
|
61 | - * @var Localization_Parser_Warning[] |
|
62 | - */ |
|
60 | + /** |
|
61 | + * @var Localization_Parser_Warning[] |
|
62 | + */ |
|
63 | 63 | protected $warnings = array(); |
64 | 64 | |
65 | - /** |
|
66 | - * The source file that was parsed (if any) |
|
67 | - * @var string |
|
68 | - */ |
|
65 | + /** |
|
66 | + * The source file that was parsed (if any) |
|
67 | + * @var string |
|
68 | + */ |
|
69 | 69 | protected $sourceFile = ''; |
70 | 70 | |
71 | 71 | public function __construct(Localization_Parser $parser) |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | |
77 | 77 | abstract protected function getTokens() : array; |
78 | 78 | |
79 | - /** |
|
80 | - * Retrieves the ID of the language. |
|
81 | - * @return string E.g. "PHP", "Javascript" |
|
82 | - */ |
|
79 | + /** |
|
80 | + * Retrieves the ID of the language. |
|
81 | + * @return string E.g. "PHP", "Javascript" |
|
82 | + */ |
|
83 | 83 | public function getID() : string |
84 | 84 | { |
85 | 85 | if(!isset($this->id)) { |
@@ -99,12 +99,12 @@ discard block |
||
99 | 99 | return $this->sourceFile; |
100 | 100 | } |
101 | 101 | |
102 | - /** |
|
103 | - * Parses the code from a file. |
|
104 | - * |
|
105 | - * @param string $path |
|
106 | - * @throws Localization_Exception |
|
107 | - */ |
|
102 | + /** |
|
103 | + * Parses the code from a file. |
|
104 | + * |
|
105 | + * @param string $path |
|
106 | + * @throws Localization_Exception |
|
107 | + */ |
|
108 | 108 | public function parseFile(string $path) : void |
109 | 109 | { |
110 | 110 | if(!file_exists($path)) |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | $this->parse(); |
142 | 142 | } |
143 | 143 | |
144 | - /** |
|
145 | - * Parses a source code string. |
|
146 | - * @param string $content |
|
147 | - */ |
|
144 | + /** |
|
145 | + * Parses a source code string. |
|
146 | + * @param string $content |
|
147 | + */ |
|
148 | 148 | public function parseString(string $content) : void |
149 | 149 | { |
150 | 150 | $this->content = $content; |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | $this->texts[] = new Text($text, $line, $explanation); |
186 | 186 | } |
187 | 187 | |
188 | - /** |
|
189 | - * Retrieves a list of all the function names that are |
|
190 | - * used as translation functions in the language. |
|
191 | - * @return array |
|
192 | - */ |
|
188 | + /** |
|
189 | + * Retrieves a list of all the function names that are |
|
190 | + * used as translation functions in the language. |
|
191 | + * @return array |
|
192 | + */ |
|
193 | 193 | public function getFunctionNames() : array |
194 | 194 | { |
195 | 195 | return $this->createToken('dummy')->getFunctionNames(); |
@@ -200,13 +200,13 @@ discard block |
||
200 | 200 | Localization::log(sprintf('%1$s parser | %2$s', $this->getID(), $message)); |
201 | 201 | } |
202 | 202 | |
203 | - /** |
|
204 | - * Adds a warning message when a text cannot be parsed correctly for some reason. |
|
205 | - * |
|
206 | - * @param Localization_Parser_Token $token |
|
207 | - * @param string $message |
|
208 | - * @return Localization_Parser_Warning |
|
209 | - */ |
|
203 | + /** |
|
204 | + * Adds a warning message when a text cannot be parsed correctly for some reason. |
|
205 | + * |
|
206 | + * @param Localization_Parser_Token $token |
|
207 | + * @param string $message |
|
208 | + * @return Localization_Parser_Warning |
|
209 | + */ |
|
210 | 210 | protected function addWarning(Localization_Parser_Token $token, string $message) : Localization_Parser_Warning |
211 | 211 | { |
212 | 212 | $warning = new Localization_Parser_Warning($this, $token, $message); |
@@ -216,34 +216,34 @@ discard block |
||
216 | 216 | return $warning; |
217 | 217 | } |
218 | 218 | |
219 | - /** |
|
220 | - * Whether any warnings were generated during parsing. |
|
221 | - * @return bool |
|
222 | - */ |
|
219 | + /** |
|
220 | + * Whether any warnings were generated during parsing. |
|
221 | + * @return bool |
|
222 | + */ |
|
223 | 223 | public function hasWarnings() : bool |
224 | 224 | { |
225 | 225 | return !empty($this->warnings); |
226 | 226 | } |
227 | 227 | |
228 | - /** |
|
229 | - * Retrieves all warnings that were generated during parsing, |
|
230 | - * if any. |
|
231 | - * |
|
232 | - * @return Localization_Parser_Warning[] |
|
233 | - */ |
|
228 | + /** |
|
229 | + * Retrieves all warnings that were generated during parsing, |
|
230 | + * if any. |
|
231 | + * |
|
232 | + * @return Localization_Parser_Warning[] |
|
233 | + */ |
|
234 | 234 | public function getWarnings() : array |
235 | 235 | { |
236 | 236 | return $this->warnings; |
237 | 237 | } |
238 | 238 | |
239 | - /** |
|
240 | - * Creates a token instance: this retrieves information on |
|
241 | - * the language token being parsed. |
|
242 | - * |
|
243 | - * @param array|string $definition The token definition. |
|
244 | - * @param Localization_Parser_Token|NULL $parentToken |
|
245 | - * @return Localization_Parser_Token |
|
246 | - */ |
|
239 | + /** |
|
240 | + * Creates a token instance: this retrieves information on |
|
241 | + * the language token being parsed. |
|
242 | + * |
|
243 | + * @param array|string $definition The token definition. |
|
244 | + * @param Localization_Parser_Token|NULL $parentToken |
|
245 | + * @return Localization_Parser_Token |
|
246 | + */ |
|
247 | 247 | protected function createToken($definition, Localization_Parser_Token $parentToken=null) : Localization_Parser_Token |
248 | 248 | { |
249 | 249 | $class = Localization_Parser_Token::class.'_'.$this->getID(); |
@@ -251,12 +251,12 @@ discard block |
||
251 | 251 | return new $class($definition, $parentToken); |
252 | 252 | } |
253 | 253 | |
254 | - /** |
|
255 | - * Parses a translation function token. |
|
256 | - * |
|
257 | - * @param int $number |
|
258 | - * @param Localization_Parser_Token $token |
|
259 | - */ |
|
254 | + /** |
|
255 | + * Parses a translation function token. |
|
256 | + * |
|
257 | + * @param int $number |
|
258 | + * @param Localization_Parser_Token $token |
|
259 | + */ |
|
260 | 260 | protected function parseToken(int $number, Localization_Parser_Token $token) : void |
261 | 261 | { |
262 | 262 | $textParts = array(); |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | const ERROR_NO_CURRENT_LOCALE_SPECIFIED = 91401; |
26 | 26 | |
27 | 27 | /** |
28 | - * The locale that was used before the change, if any. |
|
29 | - * @return Localization_Locale|NULL |
|
30 | - */ |
|
28 | + * The locale that was used before the change, if any. |
|
29 | + * @return Localization_Locale|NULL |
|
30 | + */ |
|
31 | 31 | public function getPrevious() : ?Localization_Locale |
32 | 32 | { |
33 | 33 | $arg = $this->getArgument(1); |
@@ -59,28 +59,28 @@ discard block |
||
59 | 59 | ); |
60 | 60 | } |
61 | 61 | |
62 | - /** |
|
63 | - * The namespace in which the locale change occurred. |
|
64 | - * @return string |
|
65 | - */ |
|
62 | + /** |
|
63 | + * The namespace in which the locale change occurred. |
|
64 | + * @return string |
|
65 | + */ |
|
66 | 66 | public function getNamespace() : string |
67 | 67 | { |
68 | 68 | return strval($this->getArgument(0)); |
69 | 69 | } |
70 | 70 | |
71 | - /** |
|
72 | - * Whether the change occurred for an application locale. |
|
73 | - * @return bool |
|
74 | - */ |
|
71 | + /** |
|
72 | + * Whether the change occurred for an application locale. |
|
73 | + * @return bool |
|
74 | + */ |
|
75 | 75 | public function isAppLocale() : bool |
76 | 76 | { |
77 | 77 | return $this->getNamespace() === Localization::NAMESPACE_APPLICATION; |
78 | 78 | } |
79 | 79 | |
80 | - /** |
|
81 | - * Whether the change occurred for a content locale. |
|
82 | - * @return bool |
|
83 | - */ |
|
80 | + /** |
|
81 | + * Whether the change occurred for a content locale. |
|
82 | + * @return bool |
|
83 | + */ |
|
84 | 84 | public function isContentLocale() : bool |
85 | 85 | { |
86 | 86 | return $this->getNamespace() === Localization::NAMESPACE_CONTENT; |
@@ -24,24 +24,24 @@ discard block |
||
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 |
||
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(); |