class Issue in Drupal 7 to 8/9 Module Upgrader 8
Hierarchy
- class \Drupal\drupalmoduleupgrader\Issue implements IssueInterface
Expanded class hierarchy of Issue
3 files declare their use of Issue
- InfoFile.php in src/Plugin/ DMU/ Analyzer/ InfoFile.php 
- IssueTest.php in tests/src/ Unit/ IssueTest.php 
- ReportTest.php in tests/src/ Unit/ ReportTest.php 
1 string reference to 'Issue'
- drupalmoduleupgrader_theme in ./drupalmoduleupgrader.module 
- Implements hook_theme().
File
- src/Issue.php, line 9 
Namespace
Drupal\drupalmoduleupgraderView source
class Issue implements IssueInterface {
  /**
   * @var TargetInterface
   */
  protected $target;
  /**
   * @var string
   */
  protected $title;
  /**
   * @var string
   */
  protected $summary;
  /**
   * @var array
   */
  protected $documentation = [];
  /**
   * @var array
   */
  protected $violations = [];
  /**
   * @var AnalyzerInterface[]
   */
  protected $detectors = [];
  /**
   * @var mixed[]
   */
  protected $tags = [];
  /**
   * @var array[]
   */
  protected $fixes = [];
  /**
   * @var \cebe\markdown\Markdown
   */
  protected $parser;
  public function __construct(Target $target, $title, $summary = NULL) {
    $this->target = $target;
    $this
      ->setTitle($title);
    if (isset($summary)) {
      $this
        ->setSummary($summary);
    }
    $this->parser = new Markdown();
    $this->parser->html5 = TRUE;
  }
  /**
   * {@inheritdoc}
   */
  public function getTitle() {
    return $this->parser
      ->parseParagraph($this->title);
  }
  /**
   * {@inheritdoc}
   */
  public function setTitle($title) {
    $this->title = (string) $title;
    return $this;
  }
  /**
   * {@inheritdoc}
   */
  public function getSummary() {
    return $this->parser
      ->parse($this->summary);
  }
  /**
   * {@inheritdoc}
   */
  public function setSummary($summary) {
    $this->summary = (string) $summary;
    return $this;
  }
  /**
   * {@inheritdoc}
   */
  public function addDocumentation($url, $title) {
    $this->documentation[] = [
      'url' => $url,
      'title' => $this->parser
        ->parseParagraph($title),
    ];
    return $this;
  }
  /**
   * {@inheritdoc}
   */
  public function getDocumentation() {
    return $this->documentation;
  }
  /**
   * {@inheritdoc}
   */
  public function addAffectedFile($file, AnalyzerInterface $detector) {
    if (empty($this->violations[$file])) {
      $this->violations[$file] = [];
    }
    $this
      ->addDetector($detector);
    return $this;
  }
  /**
   * {@inheritdoc}
   */
  public function addViolation(Node $node, AnalyzerInterface $detector) {
    $file = $node
      ->getFilename();
    if ($file) {
      $this->violations[$file][] = [
        'line_number' => $node
          ->getLineNumber(),
      ];
    }
    else {
      throw new \DomainException('Cannot record an issue violation from a detached node.');
    }
    $this
      ->addDetector($detector);
    return $this;
  }
  /**
   * {@inheritdoc}
   */
  public function getViolations() {
    $return_violations = [];
    foreach ($this->violations as $file => $file_violations) {
      if ($file_violations) {
        foreach ($file_violations as $violation) {
          $violation['file'] = $file;
          $return_violations[] = $violation;
        }
      }
      else {
        $return_violations[] = [
          'file' => $file,
        ];
      }
    }
    return $return_violations;
  }
  /**
   * {@inheritdoc}
   */
  public function getDetectors() {
    return array_unique($this->detectors);
  }
  /**
   * {@inheritdoc}
   */
  public function hasTag($tag) {
    return array_key_exists($tag, $this->tags);
  }
  /**
   * {@inheritdoc}
   */
  public function getTag($tag) {
    return $this->tags[$tag];
  }
  /**
   * {@inheritdoc}
   */
  public function setTag($tag, $value) {
    $this->tags[$tag] = $value;
    return $this;
  }
  /**
   * {@inheritdoc}
   */
  public function clearTag($tag) {
    unset($this->tags[$tag]);
    return $this;
  }
  /**
   * {@inheritdoc}
   */
  public function getFixes() {
    return $this->fixes;
  }
  /**
   * {@inheritdoc}
   */
  public function addFix($fixer_id, array $configuration = []) {
    $this->fixes[] = array_merge($configuration, [
      '_plugin_id' => $fixer_id,
    ]);
    $this
      ->setTag('fixable', TRUE);
    return $this;
  }
  /**
   * Stores a reference to an issue detector, if we don't already know about it,
   * for use by getDetectors().
   *
   * @param AnalyzerInterface $detector
   */
  protected function addDetector(AnalyzerInterface $detector) {
    if ($detector instanceof PluginInspectionInterface) {
      $this->detectors[] = $detector
        ->getPluginId();
    }
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| Issue:: | protected | property | ||
| Issue:: | protected | property | ||
| Issue:: | protected | property | ||
| Issue:: | protected | property | ||
| Issue:: | protected | property | ||
| Issue:: | protected | property | ||
| Issue:: | protected | property | ||
| Issue:: | protected | property | ||
| Issue:: | protected | property | ||
| Issue:: | public | function | Marks a particular file as being affected by this issue. Overrides IssueInterface:: | |
| Issue:: | protected | function | Stores a reference to an issue detector, if we don't already know about it, for use by getDetectors(). | |
| Issue:: | public | function | Adds a piece of documentation relevant to the issue. Overrides IssueInterface:: | |
| Issue:: | public | function | Adds a fix for this issue. Overrides IssueInterface:: | |
| Issue:: | public | function | Flags a single violation of this issue in a particular syntax node. Overrides IssueInterface:: | |
| Issue:: | public | function | Clears all values for a tag. Overrides IssueInterface:: | |
| Issue:: | public | function | Returns the fully qualified names of every plugin which detected violations,
as set by addAffectedFile() and addViolation(). Overrides IssueInterface:: | |
| Issue:: | public | function | Returns all documentation as an array of arrays, each containing 'url'
and 'title' keys. Overrides IssueInterface:: | |
| Issue:: | public | function | Gets all fixes queued for this issue. Each fix will be an array with at
least a _plugin_id element, containing the plugin ID of the fixer to use.
Everything else will be given to the fixer as configuration. Overrides IssueInterface:: | |
| Issue:: | public | function | Returns the issue summary. Overrides IssueInterface:: | |
| Issue:: | public | function | Returns the value set for a tag. The tag value can be anything; the
meaning of the value depends on the tag. Overrides IssueInterface:: | |
| Issue:: | public | function | Returns the title of the issue. Overrides IssueInterface:: | |
| Issue:: | public | function | Returns all violations as an array of arrays, each of which has a 'file' key
(required), and an optional 'line_number' key. Overrides IssueInterface:: | |
| Issue:: | public | function | Returns if a tag is set on the issue. Overrides IssueInterface:: | |
| Issue:: | public | function | Sets the issue summary. Overrides IssueInterface:: | |
| Issue:: | public | function | Sets the value for a tag. Any existing value for the tag will be
blown away. Overrides IssueInterface:: | |
| Issue:: | public | function | Sets the title of the issue. Overrides IssueInterface:: | |
| Issue:: | public | function | 
