Skip to content
Snippets Groups Projects
Commit 83bf98b2 authored by Luke Leber's avatar Luke Leber
Browse files

Issue #3337705 by Luke.Leber: Peer Review

parent f0d80fe8
No related branches found
No related tags found
1 merge request!8Issue #3337705: Peer Review
......@@ -141,6 +141,7 @@ abstract class DiffPlusSettingsFormBase extends FormBase {
'#type' => 'number',
'#title' => $this->t('Indentation size'),
'#description' => $this->t('The number of spaces that nested elements are indented.'),
'#min' => 0,
'#default_value' => $default_values['raw_html_indent_size'],
];
......
......@@ -20,13 +20,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*/
class RawHtmlDiffLayout extends DiffLayoutBase {
/**
* The config factory service.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The current user.
*
......
......@@ -55,13 +55,6 @@ class VisualInlineHtml5DiffLayout extends DiffLayoutBase {
*/
protected $htmlDiff;
/**
* The config factory service.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The current user.
*
......@@ -131,6 +124,23 @@ class VisualInlineHtml5DiffLayout extends DiffLayoutBase {
return $settings;
}
/**
* Generates a single display mode option.
*
* @param string $machine_name
* The machine name of the view mode.
* @param string $label
* The human readable name of the view mode.
* @param \Drupal\Core\Entity\ContentEntityInterface $entity
* The entity being reviewed.
* @param \Drupal\Core\Entity\ContentEntityInterface $left_revision
* The left revision.
* @param \Drupal\Core\Entity\ContentEntityInterface $right_revision
* The right revision.
*
* @return array
* The display mode option.
*/
protected function getDisplayModeOption($machine_name, $label, ContentEntityInterface $entity, ContentEntityInterface $left_revision, ContentEntityInterface $right_revision) {
return [
'title' => $label,
......@@ -143,6 +153,21 @@ class VisualInlineHtml5DiffLayout extends DiffLayoutBase {
];
}
/**
* Generates an array of display mode options.
*
* @param \Drupal\Core\Entity\ContentEntityInterface $entity
* The entity being reviewed.
* @param \Drupal\Core\Entity\ContentEntityInterface $left_revision
* The left revision.
* @param \Drupal\Core\Entity\ContentEntityInterface $right_revision
* The right revision.
* @param string $default_view_mode
* The machine name of the default view mode.
*
* @return array
* The display mode options.
*/
protected function getDisplayModeOptions(ContentEntityInterface $entity, ContentEntityInterface $left_revision, ContentEntityInterface $right_revision, $default_view_mode) {
// Get all view modes for entity type.
......@@ -151,8 +176,8 @@ class VisualInlineHtml5DiffLayout extends DiffLayoutBase {
$options = [
$default_view_mode => [
'title' => $view_modes[$default_view_mode],
'url' => PluginRevisionController::diffRoute($entity,
'title' => $view_modes[$default_view_mode],
'url' => PluginRevisionController::diffRoute($entity,
$left_revision->getRevisionId(),
$right_revision->getRevisionId(),
$this->getPluginId(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment