You are here

private function FixerBase::collectTraits in Drupal 7 to 8/9 Module Upgrader 8

1 call to FixerBase::collectTraits()
FixerBase::usesTrait in src/FixerBase.php
Returns if a node uses a specific trait anywhere in its lineage.

File

src/FixerBase.php, line 48

Class

FixerBase
Base class for fixers, containing a lot of helpful utilities.

Namespace

Drupal\drupalmoduleupgrader

Code

private function collectTraits($class, array &$all_traits = []) {
  $traits = class_uses($class);
  foreach ($traits as $trait) {
    $this
      ->collectTraits($trait, $traits);
  }
  $all_traits += $traits;
}