You are here

public function DiffFormatter::__construct in Entity Share 8.3

Creates a DiffFormatter to render diffs in a table.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

Overrides DiffFormatter::__construct

File

modules/entity_share_diff/src/Diff/DiffFormatter.php, line 28

Class

DiffFormatter
Diff formatter which renders a table, with structured padding in HTML.

Namespace

Drupal\entity_share_diff\Diff

Code

public function __construct(ConfigFactoryInterface $config_factory) {
  parent::__construct($config_factory);
  $config = $config_factory
    ->get('entity_share_diff.settings');
  $context_settings = $config
    ->get('context');
  if ($context_settings) {
    $this->leading_context_lines = $context_settings['lines_leading'];
    $this->leading_context_lines = $context_settings['lines_trailing'];
  }
}