瀏覽代碼

[Locale] code conventions changes (static keyword before visibility keyword)

Eriksen Costa 14 年之前
父節點
當前提交
78485356a9

+ 6 - 6
src/Symfony/Component/Locale/Locale.php

@@ -38,7 +38,7 @@ class Locale extends \Locale
      * @return array              The country names with their codes as keys
      * @throws RuntimeException   When the resource bundles cannot be loaded
      */
-    public static function getDisplayCountries($locale)
+    static public function getDisplayCountries($locale)
     {
         if (!isset(self::$countries[$locale])) {
             $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/region');
@@ -73,7 +73,7 @@ class Locale extends \Locale
      * @return array              The country codes
      * @throws RuntimeException   When the resource bundles cannot be loaded
      */
-    public static function getCountries()
+    static public function getCountries()
     {
         return array_keys(self::getDisplayCountries(self::getDefault()));
     }
@@ -85,7 +85,7 @@ class Locale extends \Locale
      * @return array              The language names with their codes as keys
      * @throws RuntimeException   When the resource bundles cannot be loaded
      */
-    public static function getDisplayLanguages($locale)
+    static public function getDisplayLanguages($locale)
     {
         if (!isset(self::$languages[$locale])) {
             $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/lang');
@@ -118,7 +118,7 @@ class Locale extends \Locale
      * @return array              The language codes
      * @throws RuntimeException   When the resource bundles cannot be loaded
      */
-    public static function getLanguages()
+    static public function getLanguages()
     {
         return array_keys(self::getDisplayLanguages(self::getDefault()));
     }
@@ -130,7 +130,7 @@ class Locale extends \Locale
      * @return array              The locale names with their codes as keys
      * @throws RuntimeException   When the resource bundles cannot be loaded
      */
-    public static function getDisplayLocales($locale)
+    static public function getDisplayLocales($locale)
     {
         if (!isset(self::$locales[$locale])) {
             $bundle = new \ResourceBundle($locale, __DIR__.'/Resources/data/names');
@@ -160,7 +160,7 @@ class Locale extends \Locale
      * @return array              The locale codes
      * @throws RuntimeException   When the resource bundles cannot be loaded
      */
-    public static function getLocales()
+    static public function getLocales()
     {
         return array_keys(self::getDisplayLocales(self::getDefault()));
     }

+ 27 - 27
src/Symfony/Component/Locale/Stub/StubLocale.php

@@ -73,7 +73,7 @@ class StubLocale
      * @return array                     The country names with their codes as keys
      * @throws InvalidArgumentException  When the locale is different than 'en'
      */
-    public static function getDisplayCountries($locale = 'en')
+    static public function getDisplayCountries($locale = 'en')
     {
         return self::getStubData($locale, 'countries', 'region');
     }
@@ -83,7 +83,7 @@ class StubLocale
      *
      * @return array  The country codes
      */
-    public static function getCountries()
+    static public function getCountries()
     {
         return array_keys(self::getDisplayCountries(self::getDefault()));
     }
@@ -95,7 +95,7 @@ class StubLocale
      * @return array                     The language names with their codes as keys
      * @throws InvalidArgumentException  When the locale is different than 'en'
      */
-    public static function getDisplayLanguages($locale)
+    static public function getDisplayLanguages($locale)
     {
         return self::getStubData($locale, 'languages', 'lang');
     }
@@ -105,7 +105,7 @@ class StubLocale
      *
      * @return array  The language codes
      */
-    public static function getLanguages()
+    static public function getLanguages()
     {
         return array_keys(self::getDisplayLanguages(self::getDefault()));
     }
@@ -117,7 +117,7 @@ class StubLocale
      * @return array                     The locale names with their codes as keys
      * @throws InvalidArgumentException  When the locale is different than 'en'
      */
-    public static function getDisplayLocales($locale)
+    static public function getDisplayLocales($locale)
     {
         return self::getStubData($locale, 'locales', 'names');
     }
@@ -127,7 +127,7 @@ class StubLocale
      *
      * @return array  The locale codes
      */
-    public static function getLocales()
+    static public function getLocales()
     {
         return array_keys(self::getDisplayLocales(self::getDefault()));
     }
@@ -137,7 +137,7 @@ class StubLocale
      *
      * @return array  The currencies data
      */
-    public static function getCurrenciesData($locale)
+    static public function getCurrenciesData($locale)
     {
         return self::getStubData($locale, 'currencies', 'curr');
     }
@@ -149,7 +149,7 @@ class StubLocale
      * @return array                     The currencies names with their codes as keys
      * @throws InvalidArgumentException  When the locale is different than 'en'
      */
-    public static function getDisplayCurrencies($locale)
+    static public function getDisplayCurrencies($locale)
     {
         $currencies = self::getCurrenciesData($locale);
 
@@ -169,7 +169,7 @@ class StubLocale
      *
      * @return array  The currencies codes
      */
-    public static function getCurrencies()
+    static public function getCurrencies()
     {
         return array_keys(self::getCurrenciesData(self::getDefault()));
     }
@@ -182,7 +182,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.acceptfromhttp.php
      * @throws MethodNotImplementedException
      */
-    public static function acceptFromHttp($header)
+    static public function acceptFromHttp($header)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -195,7 +195,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.composelocale.php
      * @throws MethodNotImplementedException
      */
-    public static function composeLocale(array $subtags)
+    static public function composeLocale(array $subtags)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -209,7 +209,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.filtermatches.php
      * @throws MethodNotImplementedException
      */
-    public static function filterMatches($langtag, $locale, $canonicalize = false)
+    static public function filterMatches($langtag, $locale, $canonicalize = false)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -222,7 +222,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getallvariants.php
      * @throws MethodNotImplementedException
      */
-    public static function getAllVariants($locale)
+    static public function getAllVariants($locale)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -234,7 +234,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getdefault.php
      * @throws MethodNotImplementedException
      */
-    public static function getDefault()
+    static public function getDefault()
     {
         return 'en';
     }
@@ -248,7 +248,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getdisplaylanguage.php
      * @throws MethodNotImplementedException
      */
-    public static function getDisplayLanguage($locale, $inLocale = null)
+    static public function getDisplayLanguage($locale, $inLocale = null)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -262,7 +262,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getdisplayname.php
      * @throws MethodNotImplementedException
      */
-    public static function getDisplayName($locale, $inLocale = null)
+    static public function getDisplayName($locale, $inLocale = null)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -276,7 +276,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getdisplayregion.php
      * @throws MethodNotImplementedException
      */
-    public static function getDisplayRegion($locale, $inLocale = null)
+    static public function getDisplayRegion($locale, $inLocale = null)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -290,7 +290,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getdisplayscript.php
      * @throws MethodNotImplementedException
      */
-    public static function getDisplayScript($locale, $inLocale = null)
+    static public function getDisplayScript($locale, $inLocale = null)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -304,7 +304,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getdisplayvariant.php
      * @throws MethodNotImplementedException
      */
-    public static function getDisplayVariant($locale, $inLocale = null)
+    static public function getDisplayVariant($locale, $inLocale = null)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -317,7 +317,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getkeywords.php
      * @throws MethodNotImplementedException
      */
-    public static function getKeywords($locale)
+    static public function getKeywords($locale)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -330,7 +330,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getprimarylanguage.php
      * @throws MethodNotImplementedException
      */
-    public static function getPrimaryLanguage($locale)
+    static public function getPrimaryLanguage($locale)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -343,7 +343,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getregion.php
      * @throws MethodNotImplementedException
      */
-    public static function getRegion($locale)
+    static public function getRegion($locale)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -356,7 +356,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.getscript.php
      * @throws MethodNotImplementedException
      */
-    public static function getScript($locale)
+    static public function getScript($locale)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -371,7 +371,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.lookup.php
      * @throws RuntimeException       When the intl extension is not loaded
      */
-    public static function lookup(array $langtag, $locale, $canonicalize = false, $default = null)
+    static public function lookup(array $langtag, $locale, $canonicalize = false, $default = null)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -384,7 +384,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.parselocale.php
      * @throws MethodNotImplementedException
      */
-    public static function parseLocale($locale)
+    static public function parseLocale($locale)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -397,7 +397,7 @@ class StubLocale
      * @see    http://www.php.net/manual/en/locale.parselocale.php
      * @throws MethodNotImplementedException
      */
-    public static function setDefault($locale)
+    static public function setDefault($locale)
     {
         throw new MethodNotImplementedException(__METHOD__);
     }
@@ -411,7 +411,7 @@ class StubLocale
      * @return array
      * @throws InvalidArgumentException  When the locale is different than 'en'
      */
-    private static function getStubData($locale, $cacheVariable, $stubDataDir)
+    static private function getStubData($locale, $cacheVariable, $stubDataDir)
     {
         if ('en' != $locale) {
             $message = 'Only the \'en\' locale is supported. '.NotImplementedException::INTL_INSTALL_MESSAGE;

+ 6 - 6
src/Symfony/Component/Locale/Stub/StubNumberFormatter.php

@@ -141,7 +141,7 @@ class StubNumberFormatter
      * The supported styles to the constructor $styles argument
      * @var array
      */
-    private static $supportedStyles = array(
+    static private $supportedStyles = array(
         'CURRENCY' => self::CURRENCY,
         'DECIMAL'  => self::DECIMAL
     );
@@ -150,7 +150,7 @@ class StubNumberFormatter
      * Supported attributes to the setAttribute() $attr argument
      * @var array
      */
-    private static $supportedAttributes = array(
+    static private $supportedAttributes = array(
         'FRACTION_DIGITS' => self::FRACTION_DIGITS,
         'GROUPING_USED'   => self::GROUPING_USED,
         'ROUNDING_MODE'   => self::ROUNDING_MODE
@@ -163,7 +163,7 @@ class StubNumberFormatter
      *
      * @var array
      */
-    private static $roundingModes = array(
+    static private $roundingModes = array(
         'ROUND_HALFEVEN' => self::ROUND_HALFEVEN,
         'ROUND_HALFDOWN' => self::ROUND_HALFDOWN,
         'ROUND_HALFUP'   => self::ROUND_HALFUP
@@ -176,7 +176,7 @@ class StubNumberFormatter
      * @see http://www.php.net/manual/en/function.round.php
      * @var array
      */
-    private static $phpRoundingMap = array(
+    static private $phpRoundingMap = array(
         self::ROUND_HALFDOWN => \PHP_ROUND_HALF_DOWN,
         self::ROUND_HALFEVEN => \PHP_ROUND_HALF_EVEN,
         self::ROUND_HALFUP   => \PHP_ROUND_HALF_UP
@@ -186,7 +186,7 @@ class StubNumberFormatter
      * The maximum values of the integer type in 32 bit platforms.
      * @var array
      */
-    private static $intRange = array(
+    static private $intRange = array(
         'positive' => 2147483647,
         'negative' => -2147483648
     );
@@ -248,7 +248,7 @@ class StubNumberFormatter
      * @throws MethodArgumentValueNotImplementedException  When the $style is not supported
      * @throws MethodArgumentNotImplementedException       When the pattern value is different than null
      */
-    public static function create($locale = 'en', $style = null, $pattern = null)
+    static public function create($locale = 'en', $style = null, $pattern = null)
     {
         return new self($locale, $style, $pattern);
     }