You are here

protected function Generic::isReassigned in Drupal 7 to 8/9 Module Upgrader 8

Returns if the parameter is fully reassigned anywhere in the function.

Parameters

\Pharborist\Functions\ParameterNode $parameter: The parameter to check.

Return value

bool

1 call to Generic::isReassigned()
Generic::rewrite in src/Plugin/DMU/Rewriter/Generic.php
Parametrically rewrites the function containing the given parameter.

File

src/Plugin/DMU/Rewriter/Generic.php, line 232

Class

Generic
Plugin annotation @Rewriter( id = "_rewriter", deriver = "\Drupal\drupalmoduleupgrader\Plugin\DMU\Rewriter\GenericDeriver" )

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Rewriter

Code

protected function isReassigned(ParameterNode $parameter) {
  return (bool) $parameter
    ->getFunction()
    ->find(Filter::isInstanceOf('\\Pharborist\\Variables\\VariableNode'))
    ->filter(function (VariableNode $variable) use ($parameter) {
    return $variable
      ->getName() == $parameter
      ->getName();
  })
    ->filter($this->isAssigned)
    ->count();
}