public function VisualInlineDiffLayout::__construct in Diff 8
Constructs a VisualInlineDiffLayout object.
Parameters
array $configuration: A configuration array containing information about the plugin instance.
string $plugin_id: The plugin_id for the plugin instance.
mixed $plugin_definition: The plugin implementation definition.
\Drupal\Core\Config\ConfigFactoryInterface $config: The configuration factory object.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
\Drupal\diff\DiffEntityParser $entity_parser: The entity parser.
\Drupal\Core\DateTime\DateFormatter $date: The date service.
\Drupal\Core\Render\RendererInterface $renderer: The renderer.
\Drupal\diff\DiffEntityComparison $entity_comparison: The diff entity comparison service.
\HtmlDiffAdvancedInterface $html_diff: The html diff service.
\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.
\Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository: The entity display repository.
Overrides DiffLayoutBase::__construct
File
- src/
Plugin/ diff/ Layout/ VisualInlineDiffLayout.php, line 94
Class
- VisualInlineDiffLayout
- Provides Visual Inline diff layout.
Namespace
Drupal\diff\Plugin\diff\LayoutCode
public function __construct(array $configuration, $plugin_id, $plugin_definition, ConfigFactoryInterface $config, EntityTypeManagerInterface $entity_type_manager, DiffEntityParser $entity_parser, DateFormatter $date, RendererInterface $renderer, DiffEntityComparison $entity_comparison, HtmlDiffAdvancedInterface $html_diff, RequestStack $request_stack, EntityDisplayRepositoryInterface $entity_display_repository) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $config, $entity_type_manager, $entity_parser, $date);
$this->renderer = $renderer;
$this->entityComparison = $entity_comparison;
$storage = PhpStorageFactory::get('html_purifier_serializer');
if (!$storage
->exists('cache.php')) {
$storage
->save('cache.php', 'dummy');
}
$html_diff
->getConfig()
->setPurifierCacheLocation(dirname($storage
->getFullPath('cache.php')));
$this->htmlDiff = $html_diff;
$this->requestStack = $request_stack;
$this->entityDisplayRepository = $entity_display_repository;
}