5 use Drupal\Core\Diff\DiffFormatter as CoreDiffFormatterBase;
6 use Drupal\Core\Config\ConfigFactoryInterface;
9 * Diff formatter which returns output that can be rendered to a table.
11 class DiffFormatter extends CoreDiffFormatterBase {
14 * Creates a DiffFormatter to render diffs in a table.
16 * We need to extend the constructor of the diff formatter used by the
17 * core config system in order to provide our own settings.
19 * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
22 public function __construct(ConfigFactoryInterface $config_factory) {
23 parent::__construct($config_factory);
25 $config = $config_factory->get('diff.settings');
26 $this->leading_context_lines = $config->get('general_settings.context_lines_leading');
27 $this->trailing_context_lines = $config->get('general_settings.context_lines_trailing');