Skip to content

Commit 083d062

Browse files
SlamdunkSpacePossum
authored andcommitted
mb_*: rely on ReflectionFunction::isInternal to detect correct list of functions to fix
1 parent 3fea39f commit 083d062

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Fixer/Alias/MbStrFunctionsFixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct()
5555
$this->functions = array_filter(
5656
self::$functionsMap,
5757
static function (array $mapping) {
58-
return \function_exists($mapping['alternativeName']);
58+
return \function_exists($mapping['alternativeName']) && (new \ReflectionFunction($mapping['alternativeName']))->isInternal();
5959
}
6060
);
6161
}

tests/Fixer/Alias/MbStrFunctionsFixerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function strtolower($a);
6363
],
6464
];
6565

66-
if (\function_exists('mb_str_split')) {
66+
if (\PHP_VERSION_ID >= 70400) {
6767
$cases[] = [
6868
'<?php $a = mb_str_split($a);',
6969
'<?php $a = str_split($a);',

0 commit comments

Comments
 (0)