You are here

public function FunctionCalls::build in Drupal 7 to 8/9 Module Upgrader 8

Overrides IndexerBase::build

File

src/Plugin/DMU/Indexer/FunctionCalls.php, line 23

Class

FunctionCalls
Plugin annotation @Indexer( id = "function_call", description = @Translation("Indexes all function calls in a target module."), exclude = { "t" } )

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Indexer

Code

public function build() {

  /** @var \Symfony\Component\Finder\SplFileInfo $file */
  foreach ($this->target
    ->getFinder() as $file) {
    $path = $file
      ->getPathname();
    $this->target
      ->open($path)
      ->find(Filter::isInstanceOf('\\Pharborist\\Functions\\FunctionCallNode'))
      ->not(function (FunctionCallNode $function_call) {
      return in_array($function_call
        ->getName()
        ->getText(), $this->pluginDefinition['exclude']);
    })
      ->each([
      $this,
      'add',
    ]);
  }
}