You are here

class NodeAssignmentFilter in Drupal 7 to 8/9 Module Upgrader 8

Hierarchy

Expanded class hierarchy of NodeAssignmentFilter

2 files declare their use of NodeAssignmentFilter
Generic.php in src/Plugin/DMU/Rewriter/Generic.php
NodeAssignmentFilterTest.php in tests/src/Unit/Utility/Filter/NodeAssignmentFilterTest.php

File

src/Utility/Filter/NodeAssignmentFilter.php, line 8

Namespace

Drupal\drupalmoduleupgrader\Utility\Filter
View source
class NodeAssignmentFilter {

  /**
   * Tests if the given node is on the left side of an assignment.
   *
   * @param \Pharborist\Node $node
   *   The node to test.
   *
   * @return bool
   */
  public function __invoke(Node $node) {

    /** @var \Pharborist\Operators\AssignNode $assignment */
    $assignment = $node
      ->closest(Filter::isInstanceOf('\\Pharborist\\Operators\\AssignNode'));
    return $assignment ? $assignment
      ->getLeftOperand() === $node : FALSE;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
NodeAssignmentFilter::__invoke public function Tests if the given node is on the left side of an assignment.