class DiffFormatter in Diff 8
Diff formatter which returns output that can be rendered to a table.
Hierarchy
- class \Drupal\Component\Diff\DiffFormatter- class \Drupal\Core\Diff\DiffFormatter- class \Drupal\diff\DiffFormatter
 
 
- class \Drupal\Core\Diff\DiffFormatter
Expanded class hierarchy of DiffFormatter
1 string reference to 'DiffFormatter'
1 service uses DiffFormatter
File
- src/DiffFormatter.php, line 11 
Namespace
Drupal\diffView source
class DiffFormatter extends CoreDiffFormatterBase {
  /**
   * Creates a DiffFormatter to render diffs in a table.
   *
   * We need to extend the constructor of the diff formatter used by the
   * core config system in order to provide our own settings.
   *
   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
   *   The config factory.
   */
  public function __construct(ConfigFactoryInterface $config_factory) {
    parent::__construct($config_factory);
    $config = $config_factory
      ->get('diff.settings');
    $this->leading_context_lines = $config
      ->get('general_settings.context_lines_leading');
    $this->trailing_context_lines = $config
      ->get('general_settings.context_lines_trailing');
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| DiffFormatter:: | public | property | Number of leading context "lines" to preserve. | |
| DiffFormatter:: | protected | property | The line stats. | |
| DiffFormatter:: | protected | property | The diff represented as an array of rows. | |
| DiffFormatter:: | public | property | Should a block header be shown? | |
| DiffFormatter:: | public | property | Number of trailing context "lines" to preserve. | |
| DiffFormatter:: | protected | function | Creates an added line. | |
| DiffFormatter:: | protected | function | Creates a context line. | |
| DiffFormatter:: | protected | function | Creates a deleted line. | |
| DiffFormatter:: | protected | function | Creates an empty line. | |
| DiffFormatter:: | public | function | Format a diff. | |
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | protected | function | ||
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | protected | function | ||
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | protected | function | Overrides DiffFormatter:: | |
| DiffFormatter:: | public | function | Creates a DiffFormatter to render diffs in a table. Overrides DiffFormatter:: | 
