'Upgrade php 5 to php 7 using rector

I'm going to upgrade an application from PHP 5 to PHP 7 using Rector. The problem is that rector not upgrading all the code. For example, session_is_registered is a deprecated function in PHP 7 but rector doesn't change it or display any information about it.

<?php

class MyClass{
  function is_registered($name)
  {
    if (session_is_registered($name))
      return true;
    else
      return false;
  }
} 
?>

Rector.php

<?php

declare(strict_types=1);

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Core\ValueObject\PhpVersion;
use Rector\Set\ValueObject\SetList;

return static function (RectorConfig $rectorConfig): void {
    $rectorConfig->paths([
        __DIR__ . '/src'
    ]);

    // register a single rule
    //$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
    $rectorConfig->phpVersion(PhpVersion::PHP_72);

    // define sets of rules
        $rectorConfig->sets([
            LevelSetList::UP_TO_PHP_72,
            SetList::CODE_QUALITY
        ]);

};

When I run vendor/bin/rector process myfile.php I get [OK] Rector is done! while I get an error when I run the application on the browser Fatal error: Uncaught Error: Call to undefined function session_is_registered() in



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source