The /e modifier is no longer supported, use preg_replace_callback instead
class SomeClass
{
public function run()
{
- $comment = preg_replace('~\b(\w)(\w+)~e', '"$1".strtolower("$2")', $comment);
+ $comment = preg_replace_callback('~\b(\w)(\w+)~', function ($matches) {
+ return($matches[1].strtolower($matches[2]));
+ }, $comment);
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Php55\Rector\FuncCall\PregReplaceEModifierRector;
return RectorConfig::configure()
->withRules([
PregReplaceEModifierRector::class,
]);