Utf8DecodeEncodeToMbConvertEncodingRector doesn't change anything #7954
-
I'm not sure if I have some misconfiguration on my side.
See https://getrector.com/demo/3ff9cb0b-b2cb-4065-a457-72bfce134c68 What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Do you use PHP 8.2? It must be in https://php.watch/versions/8.2/utf8_encode-utf8_decode-deprecated |
Beta Was this translation helpful? Give feedback.
-
You need to define php version feature if the composer.json doesn't define php 8.2 <?php
use Rector\Config\RectorConfig;
use Rector\Php82\Rector\FuncCall\Utf8DecodeEncodeToMbConvertEncodingRector;
use Rector\Core\ValueObject\PhpVersionFeature;
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->phpVersion(PhpVersionFeature::DEPRECATE_UTF8_DECODE_ENCODE_FUNCTION);
$rectorConfig->rule(Utf8DecodeEncodeToMbConvertEncodingRector::class);
}; Ref https://getrector.com/demo/b375e3bb-5680-480c-8594-de7e55ebae0c |
Beta Was this translation helpful? Give feedback.
You need to define php version feature if the composer.json doesn't define php 8.2
Ref https://getrector.com/demo/b375e3bb-5680-480c-8594-de7e55ebae0c