3 namespace Drupal\drupalmoduleupgrader;
6 * Basic implementation of an analyzer report.
8 class Report implements ReportInterface {
11 * @var \Drupal\drupalmoduleupgrader\IssueInterface[]
13 protected $issues = [];
18 public function addIssue(IssueInterface $issue) {
19 $id = spl_object_hash($issue);
20 $this->issues[$id] = $issue;
27 public function getIssues($tag = NULL) {
28 // We call array_values() here to reset the keys.
29 $issues = array_values($this->issues);
32 $issues = array_filter($issues, function(IssueInterface $issue) use ($tag) {
33 return $issue->hasTag($tag);
40 public function enumerateTag($tag) {
41 $enum = array_map(function(IssueInterface $issue) use ($tag) { return $issue->getTag($tag); }, $this->getIssues($tag));
42 return array_unique($enum);