@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | public function getCurrency() : CountryCurrency |
| 26 | 26 | { |
| 27 | - if(!isset($this->currency)) { |
|
| 27 | + if (!isset($this->currency)) { |
|
| 28 | 28 | $this->currency = new CountryCurrency( |
| 29 | 29 | Localization::createCurrencies()->getByID($this->getCurrencyISO()), |
| 30 | 30 | $this |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | |
| 76 | 76 | public function choose() : CannedCountries |
| 77 | 77 | { |
| 78 | - if(!isset($this->canned)) { |
|
| 78 | + if (!isset($this->canned)) { |
|
| 79 | 79 | $this->canned = new CannedCountries(); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | return $this->currency->isNamePreferred(); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - public function getStructuralTemplate(?CountryInterface $country=null): string |
|
| 70 | + public function getStructuralTemplate(?CountryInterface $country = null): string |
|
| 71 | 71 | { |
| 72 | 72 | return $this->currency->getStructuralTemplate($this->country); |
| 73 | 73 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | return true; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - return preg_match($this->getRegex(), (string)$number) !== false; |
|
| 87 | + return preg_match($this->getRegex(), (string) $number) !== false; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | protected $regex = '/\A([0-9%1$s]+)\z|([0-9%1$s]+),-\z|([0-9%1$s]+)[%2$s]([0-9]+)\z/s'; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $thousands = implode('', $parts); |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - return new CurrencyNumberInfo((int)$thousands, (int)$decimals); |
|
| 189 | + return new CurrencyNumberInfo((int) $thousands, (int) $decimals); |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |
@@ -195,17 +195,17 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | public function normalizeNumber($number) : string |
| 197 | 197 | { |
| 198 | - if($number === '' || $number === null) { |
|
| 198 | + if ($number === '' || $number === null) { |
|
| 199 | 199 | return ''; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - $normalized = str_replace(' ', '', (string)$number); |
|
| 202 | + $normalized = str_replace(' ', '', (string) $number); |
|
| 203 | 203 | $dSep = $this->getDecimalsSeparator(); |
| 204 | 204 | $tSep = $this->getThousandsSeparator(); |
| 205 | 205 | |
| 206 | 206 | // Handle the case where both classical separators are used, |
| 207 | 207 | // independently of the country's specific separators. |
| 208 | - if(strpos($normalized, '.') !== false && strpos($normalized, ',') !== false) { |
|
| 208 | + if (strpos($normalized, '.') !== false && strpos($normalized, ',') !== false) { |
|
| 209 | 209 | $normalized = str_replace(array('.', ','), '.', $normalized); |
| 210 | 210 | $parts = explode('.', $normalized); |
| 211 | 211 | $decimals = array_pop($parts); |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | public function formatNumber($number, int $decimalPositions = 2) : string |
| 246 | 246 | { |
| 247 | 247 | return number_format( |
| 248 | - (float)$number, |
|
| 248 | + (float) $number, |
|
| 249 | 249 | $decimalPositions, |
| 250 | 250 | $this->getDecimalsSeparator(), |
| 251 | 251 | $this->getThousandsSeparator() |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | return $this->country->getNumberDecimalsSeparator(); |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | - public function makeReadable($number, int $decimalPositions = 2, bool $addSymbol=true) : string |
|
| 265 | + public function makeReadable($number, int $decimalPositions = 2, bool $addSymbol = true) : string |
|
| 266 | 266 | { |
| 267 | 267 | if ($number === null || $number === '') { |
| 268 | 268 | return ''; |
@@ -275,12 +275,12 @@ discard block |
||
| 275 | 275 | $decimalPositions |
| 276 | 276 | ); |
| 277 | 277 | |
| 278 | - if(!$addSymbol) { |
|
| 278 | + if (!$addSymbol) { |
|
| 279 | 279 | return $number; |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | $sign = ''; |
| 283 | - if($parsed->isNegative()) { |
|
| 283 | + if ($parsed->isNegative()) { |
|
| 284 | 284 | $sign = '-'; |
| 285 | 285 | } |
| 286 | 286 | |
@@ -299,6 +299,6 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | public function __toString() |
| 301 | 301 | { |
| 302 | - return (string)$this->currency; |
|
| 302 | + return (string) $this->currency; |
|
| 303 | 303 | } |
| 304 | 304 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | |
| 65 | 65 | public function choose() : CannedCurrencies |
| 66 | 66 | { |
| 67 | - if(!isset($this->canned)) { |
|
| 67 | + if (!isset($this->canned)) { |
|
| 68 | 68 | $this->canned = new CannedCurrencies(); |
| 69 | 69 | } |
| 70 | 70 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | public function getFloat() : float |
| 52 | 52 | { |
| 53 | - return (float)($this->getString()); |
|
| 53 | + return (float) ($this->getString()); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | /** |
@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | return 0; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - return strlen((string)$this->decimals); |
|
| 84 | + return strlen((string) $this->decimals); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | public function getString() : string |
| 88 | 88 | { |
| 89 | - return $this->number . '.' . $this->decimals; |
|
| 89 | + return $this->number.'.'.$this->decimals; |
|
| 90 | 90 | } |
| 91 | 91 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | * Add the country to guarantee the matching formatting, otherwise the default formatting is returned. |
| 53 | 53 | * @return string |
| 54 | 54 | */ |
| 55 | - public function getStructuralTemplate(?CountryInterface $country=null) : string; |
|
| 55 | + public function getStructuralTemplate(?CountryInterface $country = null) : string; |
|
| 56 | 56 | |
| 57 | 57 | /** |
| 58 | 58 | * Whether the symbol is typically shown at the beginning of the amount. |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | $countries = array(); |
| 51 | 51 | $iso = $this->getISO(); |
| 52 | 52 | |
| 53 | - foreach(Localization::createCountries()->getAll() as $country) { |
|
| 54 | - if($country->getCurrencyISO() === $iso) { |
|
| 53 | + foreach (Localization::createCountries()->getAll() as $country) { |
|
| 54 | + if ($country->getCurrencyISO() === $iso) { |
|
| 55 | 55 | $countries[] = $country; |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | public function getPreferredSymbol(): string |
| 86 | 86 | { |
| 87 | - if($this->isNamePreferred()) { |
|
| 87 | + if ($this->isNamePreferred()) { |
|
| 88 | 88 | return $this->getISO(); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | */ |
| 130 | 130 | public static function init() : void |
| 131 | 131 | { |
| 132 | - if(self::$initDone) { |
|
| 132 | + if (self::$initDone) { |
|
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public static function getLocalesByNS(string $namespace) |
| 175 | 175 | { |
| 176 | - if(isset(self::$locales[$namespace])) { |
|
| 176 | + if (isset(self::$locales[$namespace])) { |
|
| 177 | 177 | return array_values(self::$locales[$namespace]); |
| 178 | 178 | } |
| 179 | 179 | |
@@ -218,11 +218,11 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | public static function addLocaleByNS(string $localeName, string $namespace) : Localization_Locale |
| 220 | 220 | { |
| 221 | - if(!isset(self::$locales[$namespace])) { |
|
| 221 | + if (!isset(self::$locales[$namespace])) { |
|
| 222 | 222 | self::$locales[$namespace] = array(); |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - if(!isset(self::$locales[$namespace][$localeName])) |
|
| 225 | + if (!isset(self::$locales[$namespace][$localeName])) |
|
| 226 | 226 | { |
| 227 | 227 | self::$locales[$namespace][$localeName] = self::createLocale($localeName); |
| 228 | 228 | |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | public static function createCountries() : CountryCollection |
| 283 | 283 | { |
| 284 | - if(!isset(self::$countries)) { |
|
| 284 | + if (!isset(self::$countries)) { |
|
| 285 | 285 | self::$countries = CountryCollection::getInstance(); |
| 286 | 286 | } |
| 287 | 287 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | public static function createCurrencies() : CurrencyCollection |
| 300 | 300 | { |
| 301 | - if(!isset(self::$currencies)) { |
|
| 301 | + if (!isset(self::$currencies)) { |
|
| 302 | 302 | self::$currencies = CurrencyCollection::getInstance(); |
| 303 | 303 | } |
| 304 | 304 | |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | { |
| 412 | 412 | self::requireNamespace($namespace); |
| 413 | 413 | |
| 414 | - if(isset(self::$selected[$namespace])) { |
|
| 414 | + if (isset(self::$selected[$namespace])) { |
|
| 415 | 415 | return self::$selected[$namespace]; |
| 416 | 416 | } |
| 417 | 417 | |
@@ -450,9 +450,9 @@ discard block |
||
| 450 | 450 | $locale = self::addLocaleByNS($localeName, $namespace); |
| 451 | 451 | $previous = null; |
| 452 | 452 | |
| 453 | - if(isset(self::$selected[$namespace])) |
|
| 453 | + if (isset(self::$selected[$namespace])) |
|
| 454 | 454 | { |
| 455 | - if(self::$selected[$namespace]->getName() === $localeName) { |
|
| 455 | + if (self::$selected[$namespace]->getName() === $localeName) { |
|
| 456 | 456 | return $locale; |
| 457 | 457 | } |
| 458 | 458 | |
@@ -492,11 +492,11 @@ discard block |
||
| 492 | 492 | new $class($argsList) |
| 493 | 493 | ); |
| 494 | 494 | |
| 495 | - if(!isset(self::$listeners[$name])) { |
|
| 495 | + if (!isset(self::$listeners[$name])) { |
|
| 496 | 496 | return $event; |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | - foreach(self::$listeners[$name] as $listener) |
|
| 499 | + foreach (self::$listeners[$name] as $listener) |
|
| 500 | 500 | { |
| 501 | 501 | $callArgs = $listener['args']; |
| 502 | 502 | array_unshift($callArgs, $event); |
@@ -518,9 +518,9 @@ discard block |
||
| 518 | 518 | * @throws Localization_Exception |
| 519 | 519 | * @see Localization::ERROR_UNKNOWN_EVENT_NAME |
| 520 | 520 | */ |
| 521 | - public static function addEventListener(string $eventName, $callback, array $args=array()) : int |
|
| 521 | + public static function addEventListener(string $eventName, $callback, array $args = array()) : int |
|
| 522 | 522 | { |
| 523 | - if(!isset(self::$listeners[$eventName])) { |
|
| 523 | + if (!isset(self::$listeners[$eventName])) { |
|
| 524 | 524 | self::$listeners[$eventName] = array(); |
| 525 | 525 | } |
| 526 | 526 | |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | 'AppLocalize' |
| 544 | 544 | ); |
| 545 | 545 | |
| 546 | - if(class_exists($className)) { |
|
| 546 | + if (class_exists($className)) { |
|
| 547 | 547 | return $className; |
| 548 | 548 | } |
| 549 | 549 | |
@@ -567,17 +567,17 @@ discard block |
||
| 567 | 567 | * @throws Localization_Exception |
| 568 | 568 | * @see LocaleChanged |
| 569 | 569 | */ |
| 570 | - public static function onLocaleChanged($callback, array $args=array()) : int |
|
| 570 | + public static function onLocaleChanged($callback, array $args = array()) : int |
|
| 571 | 571 | { |
| 572 | 572 | return self::addEventListener(self::EVENT_LOCALE_CHANGED, $callback, $args); |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | - public static function onClientFolderChanged(callable $callback, array $args=array()) : int |
|
| 575 | + public static function onClientFolderChanged(callable $callback, array $args = array()) : int |
|
| 576 | 576 | { |
| 577 | 577 | return self::addEventListener(self::EVENT_CLIENT_FOLDER_CHANGED, $callback, $args); |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | - public static function onCacheKeyChanged(callable $callback, array $args=array()) : int |
|
| 580 | + public static function onCacheKeyChanged(callable $callback, array $args = array()) : int |
|
| 581 | 581 | { |
| 582 | 582 | return self::addEventListener(self::EVENT_CACHE_KEY_CHANGED, $callback, $args); |
| 583 | 583 | } |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | { |
| 705 | 705 | self::requireNamespace($namespace); |
| 706 | 706 | |
| 707 | - if(isset(self::$locales[$namespace]) && isset(self::$locales[$namespace][$localeName])) { |
|
| 707 | + if (isset(self::$locales[$namespace]) && isset(self::$locales[$namespace][$localeName])) { |
|
| 708 | 708 | return self::$locales[$namespace][$localeName]; |
| 709 | 709 | } |
| 710 | 710 | |
@@ -783,9 +783,9 @@ discard block |
||
| 783 | 783 | * @param Localization_Locale|null $locale |
| 784 | 784 | * @return Localization_Translator |
| 785 | 785 | */ |
| 786 | - public static function getTranslator(?Localization_Locale $locale=null) : Localization_Translator |
|
| 786 | + public static function getTranslator(?Localization_Locale $locale = null) : Localization_Translator |
|
| 787 | 787 | { |
| 788 | - if($locale !== null) |
|
| 788 | + if ($locale !== null) |
|
| 789 | 789 | { |
| 790 | 790 | $obj = new Localization_Translator(); |
| 791 | 791 | $obj->addSources(self::getSources()); |
@@ -793,7 +793,7 @@ discard block |
||
| 793 | 793 | return $obj; |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | - if(!isset(self::$translator)) |
|
| 796 | + if (!isset(self::$translator)) |
|
| 797 | 797 | { |
| 798 | 798 | $obj = new Localization_Translator(); |
| 799 | 799 | $obj->addSources(self::getSources()); |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | { |
| 819 | 819 | self::requireNamespace($namespace); |
| 820 | 820 | |
| 821 | - if(isset(self::$locales[$namespace])) { |
|
| 821 | + if (isset(self::$locales[$namespace])) { |
|
| 822 | 822 | return count(self::$locales[$namespace]); |
| 823 | 823 | } |
| 824 | 824 | |
@@ -831,7 +831,7 @@ discard block |
||
| 831 | 831 | */ |
| 832 | 832 | protected static function requireNamespace(string $namespace) : void |
| 833 | 833 | { |
| 834 | - if(isset(self::$locales[$namespace])) { |
|
| 834 | + if (isset(self::$locales[$namespace])) { |
|
| 835 | 835 | return; |
| 836 | 836 | } |
| 837 | 837 | |
@@ -854,7 +854,7 @@ discard block |
||
| 854 | 854 | * @param string $label |
| 855 | 855 | * @return HTML_QuickForm2_Element_Select |
| 856 | 856 | */ |
| 857 | - public static function injectContentLocalesSelector(string $elementName, HTML_QuickForm2_Container $container, string $label='') : HTML_QuickForm2_Element_Select |
|
| 857 | + public static function injectContentLocalesSelector(string $elementName, HTML_QuickForm2_Container $container, string $label = '') : HTML_QuickForm2_Element_Select |
|
| 858 | 858 | { |
| 859 | 859 | return self::injectLocalesSelectorNS($elementName, self::NAMESPACE_CONTENT, $container, $label); |
| 860 | 860 | } |
@@ -868,7 +868,7 @@ discard block |
||
| 868 | 868 | * @param string $label |
| 869 | 869 | * @return HTML_QuickForm2_Element_Select |
| 870 | 870 | */ |
| 871 | - public static function injectAppLocalesSelector(string $elementName, HTML_QuickForm2_Container $container, string $label='') : HTML_QuickForm2_Element_Select |
|
| 871 | + public static function injectAppLocalesSelector(string $elementName, HTML_QuickForm2_Container $container, string $label = '') : HTML_QuickForm2_Element_Select |
|
| 872 | 872 | { |
| 873 | 873 | return self::injectLocalesSelectorNS($elementName, self::NAMESPACE_APPLICATION, $container, $label); |
| 874 | 874 | } |
@@ -885,9 +885,9 @@ discard block |
||
| 885 | 885 | * @return HTML_QuickForm2_Element_Select |
| 886 | 886 | * @throws Localization_Exception |
| 887 | 887 | */ |
| 888 | - public static function injectLocalesSelectorNS(string $elementName, string $namespace, HTML_QuickForm2_Container $container, string $label='') : HTML_QuickForm2_Element_Select |
|
| 888 | + public static function injectLocalesSelectorNS(string $elementName, string $namespace, HTML_QuickForm2_Container $container, string $label = '') : HTML_QuickForm2_Element_Select |
|
| 889 | 889 | { |
| 890 | - if(empty($label)) { |
|
| 890 | + if (empty($label)) { |
|
| 891 | 891 | $label = t('Language'); |
| 892 | 892 | } |
| 893 | 893 | |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | |
| 897 | 897 | $locales = self::getLocalesByNS($namespace); |
| 898 | 898 | |
| 899 | - foreach($locales as $locale) { |
|
| 899 | + foreach ($locales as $locale) { |
|
| 900 | 900 | $select->addOption($locale->getLabel(), $locale->getName()); |
| 901 | 901 | } |
| 902 | 902 | |
@@ -930,14 +930,14 @@ discard block |
||
| 930 | 930 | |
| 931 | 931 | public static function addExcludeFolder(string $folderName) : void |
| 932 | 932 | { |
| 933 | - if(!in_array($folderName, self::$excludeFolders)) { |
|
| 933 | + if (!in_array($folderName, self::$excludeFolders)) { |
|
| 934 | 934 | self::$excludeFolders[] = $folderName; |
| 935 | 935 | } |
| 936 | 936 | } |
| 937 | 937 | |
| 938 | 938 | public static function addExcludeFile(string $fileName) : void |
| 939 | 939 | { |
| 940 | - if(!in_array($fileName, self::$excludeFiles)) { |
|
| 940 | + if (!in_array($fileName, self::$excludeFiles)) { |
|
| 941 | 941 | self::$excludeFiles[] = $fileName; |
| 942 | 942 | } |
| 943 | 943 | } |
@@ -964,11 +964,11 @@ discard block |
||
| 964 | 964 | |
| 965 | 965 | $grouped = array(); |
| 966 | 966 | |
| 967 | - foreach($sources as $source) |
|
| 967 | + foreach ($sources as $source) |
|
| 968 | 968 | { |
| 969 | 969 | $group = $source->getGroup(); |
| 970 | 970 | |
| 971 | - if(!isset($grouped[$group])) { |
|
| 971 | + if (!isset($grouped[$group])) { |
|
| 972 | 972 | $grouped[$group] = array(); |
| 973 | 973 | } |
| 974 | 974 | |
@@ -986,8 +986,8 @@ discard block |
||
| 986 | 986 | public static function sourceExists(string $sourceID) : bool |
| 987 | 987 | { |
| 988 | 988 | $sources = self::getSources(); |
| 989 | - foreach($sources as $source) { |
|
| 990 | - if($source->getID() == $sourceID) { |
|
| 989 | + foreach ($sources as $source) { |
|
| 990 | + if ($source->getID() == $sourceID) { |
|
| 991 | 991 | return true; |
| 992 | 992 | } |
| 993 | 993 | } |
@@ -1003,8 +1003,8 @@ discard block |
||
| 1003 | 1003 | public static function sourceAliasExists(string $sourceAlias) : bool |
| 1004 | 1004 | { |
| 1005 | 1005 | $sources = self::getSources(); |
| 1006 | - foreach($sources as $source) { |
|
| 1007 | - if($source->getAlias() == $sourceAlias) { |
|
| 1006 | + foreach ($sources as $source) { |
|
| 1007 | + if ($source->getAlias() == $sourceAlias) { |
|
| 1008 | 1008 | return true; |
| 1009 | 1009 | } |
| 1010 | 1010 | } |
@@ -1022,8 +1022,8 @@ discard block |
||
| 1022 | 1022 | public static function getSourceByID(string $sourceID) : Localization_Source |
| 1023 | 1023 | { |
| 1024 | 1024 | $sources = self::getSources(); |
| 1025 | - foreach($sources as $source) { |
|
| 1026 | - if($source->getID() == $sourceID) { |
|
| 1025 | + foreach ($sources as $source) { |
|
| 1026 | + if ($source->getID() == $sourceID) { |
|
| 1027 | 1027 | return $source; |
| 1028 | 1028 | } |
| 1029 | 1029 | } |
@@ -1048,8 +1048,8 @@ discard block |
||
| 1048 | 1048 | public static function getSourceByAlias(string $sourceAlias) : Localization_Source |
| 1049 | 1049 | { |
| 1050 | 1050 | $sources = self::getSources(); |
| 1051 | - foreach($sources as $source) { |
|
| 1052 | - if($source->getAlias() == $sourceAlias) { |
|
| 1051 | + foreach ($sources as $source) { |
|
| 1052 | + if ($source->getAlias() == $sourceAlias) { |
|
| 1053 | 1053 | return $source; |
| 1054 | 1054 | } |
| 1055 | 1055 | } |
@@ -1093,7 +1093,7 @@ discard block |
||
| 1093 | 1093 | * @throws FileHelper_Exception |
| 1094 | 1094 | * @throws Localization_Exception |
| 1095 | 1095 | */ |
| 1096 | - public static function configure(string $storageFile, string $clientLibrariesFolder='') : void |
|
| 1096 | + public static function configure(string $storageFile, string $clientLibrariesFolder = '') : void |
|
| 1097 | 1097 | { |
| 1098 | 1098 | self::$configured = true; |
| 1099 | 1099 | |
@@ -1102,7 +1102,7 @@ discard block |
||
| 1102 | 1102 | |
| 1103 | 1103 | // only write the client libraries to disk if the folder |
| 1104 | 1104 | // has been specified. |
| 1105 | - if(!empty($clientLibrariesFolder)) |
|
| 1105 | + if (!empty($clientLibrariesFolder)) |
|
| 1106 | 1106 | { |
| 1107 | 1107 | self::writeClientFiles(); |
| 1108 | 1108 | } |
@@ -1121,7 +1121,7 @@ discard block |
||
| 1121 | 1121 | */ |
| 1122 | 1122 | public static function setClientLibrariesCacheKey(string $key) : void |
| 1123 | 1123 | { |
| 1124 | - if($key !== self::$clientCacheKey) { |
|
| 1124 | + if ($key !== self::$clientCacheKey) { |
|
| 1125 | 1125 | self::$clientCacheKey = $key; |
| 1126 | 1126 | self::triggerEvent(self::EVENT_CACHE_KEY_CHANGED, array($key)); |
| 1127 | 1127 | } |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | */ |
| 1139 | 1139 | public static function setClientLibrariesFolder(string $folder) : void |
| 1140 | 1140 | { |
| 1141 | - if($folder !== self::$clientFolder) { |
|
| 1141 | + if ($folder !== self::$clientFolder) { |
|
| 1142 | 1142 | self::$clientFolder = $folder; |
| 1143 | 1143 | self::triggerEvent(self::EVENT_CLIENT_FOLDER_CHANGED, array($folder)); |
| 1144 | 1144 | } |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | * @throws Localization_Exception|FileHelper_Exception |
| 1167 | 1167 | * @see Localization_ClientGenerator |
| 1168 | 1168 | */ |
| 1169 | - public static function writeClientFiles(bool $force=false) : void |
|
| 1169 | + public static function writeClientFiles(bool $force = false) : void |
|
| 1170 | 1170 | { |
| 1171 | 1171 | self::createGenerator()->writeFiles(); |
| 1172 | 1172 | } |
@@ -1182,7 +1182,7 @@ discard block |
||
| 1182 | 1182 | */ |
| 1183 | 1183 | public static function createGenerator() : Localization_ClientGenerator |
| 1184 | 1184 | { |
| 1185 | - if(!isset(self::$generator)) { |
|
| 1185 | + if (!isset(self::$generator)) { |
|
| 1186 | 1186 | self::$generator = new Localization_ClientGenerator(); |
| 1187 | 1187 | } |
| 1188 | 1188 | |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | */ |
| 1206 | 1206 | protected static function requireConfiguration() : void |
| 1207 | 1207 | { |
| 1208 | - if(!self::$configured) |
|
| 1208 | + if (!self::$configured) |
|
| 1209 | 1209 | { |
| 1210 | 1210 | throw new Localization_Exception( |
| 1211 | 1211 | 'The localization configuration is incomplete.', |
@@ -1214,7 +1214,7 @@ discard block |
||
| 1214 | 1214 | ); |
| 1215 | 1215 | } |
| 1216 | 1216 | |
| 1217 | - if(empty(self::$storageFile)) |
|
| 1217 | + if (empty(self::$storageFile)) |
|
| 1218 | 1218 | { |
| 1219 | 1219 | throw new Localization_Exception( |
| 1220 | 1220 | 'No localization storage file set', |
@@ -1223,7 +1223,7 @@ discard block |
||
| 1223 | 1223 | ); |
| 1224 | 1224 | } |
| 1225 | 1225 | |
| 1226 | - if(empty(self::$sources)) |
|
| 1226 | + if (empty(self::$sources)) |
|
| 1227 | 1227 | { |
| 1228 | 1228 | throw new Localization_Exception( |
| 1229 | 1229 | 'No source folders have been defined.', |
@@ -1256,7 +1256,7 @@ discard block |
||
| 1256 | 1256 | { |
| 1257 | 1257 | $ids = array(); |
| 1258 | 1258 | |
| 1259 | - foreach(self::$sources as $source) { |
|
| 1259 | + foreach (self::$sources as $source) { |
|
| 1260 | 1260 | $ids[] = $source->getID(); |
| 1261 | 1261 | } |
| 1262 | 1262 | |
@@ -1271,7 +1271,7 @@ discard block |
||
| 1271 | 1271 | { |
| 1272 | 1272 | $aliases = array(); |
| 1273 | 1273 | |
| 1274 | - foreach(self::$sources as $source) { |
|
| 1274 | + foreach (self::$sources as $source) { |
|
| 1275 | 1275 | $aliases[] = $source->getAlias(); |
| 1276 | 1276 | } |
| 1277 | 1277 | |
@@ -1307,7 +1307,7 @@ discard block |
||
| 1307 | 1307 | */ |
| 1308 | 1308 | public static function getSupportedLocaleNames() : array |
| 1309 | 1309 | { |
| 1310 | - if(empty(self::$supportedLocales)) |
|
| 1310 | + if (empty(self::$supportedLocales)) |
|
| 1311 | 1311 | { |
| 1312 | 1312 | self::$supportedLocales = FileHelper::createFileFinder(__DIR__.'/Localization/Locale') |
| 1313 | 1313 | ->getPHPClassNames(); |
@@ -1331,13 +1331,13 @@ discard block |
||
| 1331 | 1331 | |
| 1332 | 1332 | public static function getVersion() : string |
| 1333 | 1333 | { |
| 1334 | - if(isset(self::$version)) { |
|
| 1334 | + if (isset(self::$version)) { |
|
| 1335 | 1335 | return self::$version; |
| 1336 | 1336 | } |
| 1337 | 1337 | |
| 1338 | 1338 | $versionFile = FileInfo::factory(__DIR__.'/../version.txt'); |
| 1339 | 1339 | |
| 1340 | - if($versionFile->exists()) { |
|
| 1340 | + if ($versionFile->exists()) { |
|
| 1341 | 1341 | self::$version = $versionFile->getContents(); |
| 1342 | 1342 | return self::$version; |
| 1343 | 1343 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | return false; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public function getStructuralTemplate(?CountryInterface $country=null): string |
|
| 44 | + public function getStructuralTemplate(?CountryInterface $country = null): string |
|
| 45 | 45 | { |
| 46 | 46 | return '-{amount} {symbol}'; |
| 47 | 47 | } |