You are here

public function Disable::execute in Drupal 7 to 8/9 Module Upgrader 8

Executes the plugin.

Overrides Notify::execute

File

src/Plugin/DMU/Fixer/Disable.php, line 17

Class

Disable
Plugin annotation @Fixer( id = "disable" )

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer

Code

public function execute() {
  parent::execute();
  foreach ($this
    ->getObjects() as $node) {
    if ($node
      ->hasRoot()) {
      $statement = $node
        ->getStatement();
      $statement
        ->replaceWith($statement
        ->toComment());
    }
  }
  $this->target
    ->save();
}