class Report in Drupal 7 to 8/9 Module Upgrader 8
Basic implementation of an analyzer report.
Hierarchy
- class \Drupal\drupalmoduleupgrader\Report implements ReportInterface
Expanded class hierarchy of Report
3 files declare their use of Report
- drupalmoduleupgrader.drush.inc in ./
drupalmoduleupgrader.drush.inc - Declarations for Drush.
- DrupalmoduleupgraderCommands.php in src/
Commands/ DrupalmoduleupgraderCommands.php - ReportTest.php in tests/
src/ Unit/ ReportTest.php
1 string reference to 'Report'
- drupalmoduleupgrader_theme in ./
drupalmoduleupgrader.module - Implements hook_theme().
File
- src/
Report.php, line 8
Namespace
Drupal\drupalmoduleupgraderView source
class Report implements ReportInterface {
/**
* @var \Drupal\drupalmoduleupgrader\IssueInterface[]
*/
protected $issues = [];
/**
* {@inheritdoc}
*/
public function addIssue(IssueInterface $issue) {
$id = spl_object_hash($issue);
$this->issues[$id] = $issue;
return $this;
}
/**
* {@inheritdoc}
*/
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;
}
public function enumerateTag($tag) {
$enum = array_map(function (IssueInterface $issue) use ($tag) {
return $issue
->getTag($tag);
}, $this
->getIssues($tag));
return array_unique($enum);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Report:: |
protected | property | ||
Report:: |
public | function |
Adds an issue to this module. Overrides ReportInterface:: |
|
Report:: |
public | function | ||
Report:: |
public | function |
Returns all issues collected so far, optionally filtered by a tag. Overrides ReportInterface:: |