Skip to content

Commit

Permalink
mb_*: rely on ReflectionFunction::isInternal to detect correct list o…
Browse files Browse the repository at this point in the history
…f functions to fix
  • Loading branch information
Slamdunk authored and SpacePossum committed Oct 9, 2019
1 parent 3fea39f commit 083d062
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Fixer/Alias/MbStrFunctionsFixer.php
Expand Up @@ -55,7 +55,7 @@ public function __construct()
$this->functions = array_filter(
self::$functionsMap,
static function (array $mapping) {
return \function_exists($mapping['alternativeName']);
return \function_exists($mapping['alternativeName']) && (new \ReflectionFunction($mapping['alternativeName']))->isInternal();
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixer/Alias/MbStrFunctionsFixerTest.php
Expand Up @@ -63,7 +63,7 @@ public function strtolower($a);
],
];

if (\function_exists('mb_str_split')) {
if (\PHP_VERSION_ID >= 70400) {
$cases[] = [
'<?php $a = mb_str_split($a);',
'<?php $a = str_split($a);',
Expand Down

0 comments on commit 083d062

Please sign in to comment.