You are here

public function Report::getIssues in Drupal 7 to 8/9 Module Upgrader 8

Returns all issues collected so far, optionally filtered by a tag.

Parameters

string|null $tag: (optional) A tag name. If set, only issues which have this tag will be returned (regardless of the tag's value in each issue -- it's up to the calling code to do any further filtering).

Return value

IssueInterface[]

Overrides ReportInterface::getIssues

1 call to Report::getIssues()
Report::enumerateTag in src/Report.php

File

src/Report.php, line 27

Class

Report
Basic implementation of an analyzer report.

Namespace

Drupal\drupalmoduleupgrader

Code

public function getIssues($tag = NULL) {

  // We call array_values() here to reset the keys.
  $issues = array_values($this->issues);
  if ($tag) {
    $issues = array_filter($issues, function (IssueInterface $issue) use ($tag) {
      return $issue
        ->hasTag($tag);
    });
  }
  return $issues;
}