You are here

protected function Notify::setComment in Drupal 7 to 8/9 Module Upgrader 8

1 call to Notify::setComment()
Notify::execute in src/Plugin/DMU/Fixer/Notify.php
Executes the plugin.

File

src/Plugin/DMU/Fixer/Notify.php, line 45

Class

Notify
Plugin annotation @Fixer( id = "notify" )

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Fixer

Code

protected function setComment(NodeInterface $node, $comment_text) {
  if ($this
    ->supportsDocComments($node)) {

    /** @var \Pharborist\DocCommentTrait $node */
    $node
      ->setDocComment(DocCommentNode::create($comment_text));
  }
  else {
    LineCommentBlockNode::create($comment_text)
      ->insertBefore($node
      ->getStatement());
  }
}