Report.php in Drupal 7 to 8/9 Module Upgrader 8
File
src/Report.php
View source
<?php
namespace Drupal\drupalmoduleupgrader;
class Report implements ReportInterface {
protected $issues = [];
public function addIssue(IssueInterface $issue) {
$id = spl_object_hash($issue);
$this->issues[$id] = $issue;
return $this;
}
public function getIssues($tag = NULL) {
$issues = array_values($this->issues);
if ($tag) {
$issues = array_filter($issues, function (IssueInterface $issue) use ($tag) {
return $issue
->hasTag($tag);
});
}
return $issues;
}
public function enumerateTag($tag) {
$enum = array_map(function (IssueInterface $issue) use ($tag) {
return $issue
->getTag($tag);
}, $this
->getIssues($tag));
return array_unique($enum);
}
}
Classes
Name |
Description |
Report |
Basic implementation of an analyzer report. |