Skip to content

Commit f066415

Browse files
Enable "native_constant_invocation" CS rule
1 parent 11f8ba8 commit f066415

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

Collator/Collator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ public static function create($locale)
109109
public function asort(&$array, $sortFlag = self::SORT_REGULAR)
110110
{
111111
$intlToPlainFlagMap = [
112-
self::SORT_REGULAR => SORT_REGULAR,
113-
self::SORT_NUMERIC => SORT_NUMERIC,
114-
self::SORT_STRING => SORT_STRING,
112+
self::SORT_REGULAR => \SORT_REGULAR,
113+
self::SORT_NUMERIC => \SORT_NUMERIC,
114+
self::SORT_STRING => \SORT_STRING,
115115
];
116116

117117
$plainSortFlag = isset($intlToPlainFlagMap[$sortFlag]) ? $intlToPlainFlagMap[$sortFlag] : self::SORT_REGULAR;

Data/Bundle/Writer/JsonBundleWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function write($path, $locale, $data)
3535
}
3636
});
3737

38-
$contents = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE)."\n";
38+
$contents = json_encode($data, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE)."\n";
3939

4040
file_put_contents($path.'/'.$locale.'.json', $contents);
4141
}

Data/Util/LocaleScanner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class LocaleScanner
4242
*/
4343
public function scanLocales($sourceDir)
4444
{
45-
$locales = glob($sourceDir.'/*.txt', GLOB_NOSORT);
45+
$locales = glob($sourceDir.'/*.txt', \GLOB_NOSORT);
4646

4747
// Remove file extension and sort
4848
array_walk($locales, function (&$locale) { $locale = basename($locale, '.txt'); });

DateFormatter/DateFormat/Transformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ abstract public function extractDateOptions($matched, $length);
6060
*/
6161
protected function padLeft($value, $length)
6262
{
63-
return str_pad($value, $length, '0', STR_PAD_LEFT);
63+
return str_pad($value, $length, '0', \STR_PAD_LEFT);
6464
}
6565
}

Intl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public static function getIcuVersion()
195195
if (!self::isExtensionLoaded()) {
196196
self::$icuVersion = self::getIcuStubVersion();
197197
} elseif (\defined('INTL_ICU_VERSION')) {
198-
self::$icuVersion = INTL_ICU_VERSION;
198+
self::$icuVersion = \INTL_ICU_VERSION;
199199
} else {
200200
try {
201201
$reflector = new \ReflectionExtension('intl');

NumberFormatter/NumberFormatter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ class NumberFormatter
201201
* @see https://php.net/round
202202
*/
203203
private static $phpRoundingMap = [
204-
self::ROUND_HALFDOWN => PHP_ROUND_HALF_DOWN,
205-
self::ROUND_HALFEVEN => PHP_ROUND_HALF_EVEN,
206-
self::ROUND_HALFUP => PHP_ROUND_HALF_UP,
204+
self::ROUND_HALFDOWN => \PHP_ROUND_HALF_DOWN,
205+
self::ROUND_HALFEVEN => \PHP_ROUND_HALF_EVEN,
206+
self::ROUND_HALFUP => \PHP_ROUND_HALF_UP,
207207
];
208208

209209
/**
@@ -357,7 +357,7 @@ public function format($value, $type = self::TYPE_DEFAULT)
357357

358358
// The original NumberFormatter does not support this format type
359359
if (self::TYPE_CURRENCY === $type) {
360-
trigger_error(__METHOD__.'(): Unsupported format type '.$type, E_USER_WARNING);
360+
trigger_error(__METHOD__.'(): Unsupported format type '.$type, \E_USER_WARNING);
361361

362362
return false;
363363
}
@@ -513,7 +513,7 @@ public function parse($value, $type = self::TYPE_DOUBLE, &$position = 0)
513513
$type = (int) $type;
514514

515515
if (self::TYPE_DEFAULT === $type || self::TYPE_CURRENCY === $type) {
516-
trigger_error(__METHOD__.'(): Unsupported format type '.$type, E_USER_WARNING);
516+
trigger_error(__METHOD__.'(): Unsupported format type '.$type, \E_USER_WARNING);
517517

518518
return false;
519519
}

Resources/bin/common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function get_icu_version_from_genrb($genrb)
6868
return $matches[1];
6969
}
7070

71-
error_reporting(E_ALL);
71+
error_reporting(\E_ALL);
7272

7373
set_error_handler(function ($type, $msg, $file, $line) {
7474
throw new \ErrorException($msg, 0, $type, $file, $line);

0 commit comments

Comments
 (0)