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? |
Answered by
samsonasik
May 27, 2023
Replies: 2 comments
|
Do you use PHP 8.2? It must be in https://php.watch/versions/8.2/utf8_encode-utf8_decode-deprecated |
0 replies
|
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 |
0 replies
Answer selected by
samsonasik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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