1 --- src/Controller/HackedDiffController.php
2 +++ src/Controller/HackedDiffController.php
5 namespace Drupal\hacked\Controller;
7 -use Drupal\diff\EntityComparisonBase;
8 +use Drupal\Core\Controller\ControllerBase;
9 +use Drupal\diff\DiffEntityComparison;
10 use Drupal\hacked\hackedFileHasher;
11 use Drupal\hacked\hackedProject;
12 +use Symfony\Component\DependencyInjection\ContainerInterface;
15 * Controller routines for hacked routes.
17 -class HackedDiffController extends EntityComparisonBase {
18 +class HackedDiffController extends ControllerBase {
21 + * Wrapper object for writing/reading configuration from diff.plugins.yml
26 + * The diff entity comparison service.
28 + protected $entityComparison;
31 + * Constructs a HackedDiffController object.
33 + * @param DiffEntityComparison $entity_comparison
34 + * DiffEntityComparison service.
36 + public function __construct(DiffEntityComparison $entity_comparison) {
37 + $this->config = $this->config('diff.settings');
38 + $this->entityComparison = $entity_comparison;
44 + public static function create(ContainerInterface $container) {
46 + $container->get('diff.entity_comparison')
51 * Shows a diff report for a specific file in a project.
52 @@ -50,7 +82,7 @@ class HackedDiffController extends EntityComparisonBase {
55 '#header' => [t('Original'), '', t('Current'), ''],
56 - '#rows' => $this->getRows($hasher->fetch_lines($original_file), $hasher->fetch_lines($installed_file), TRUE),
57 + '#rows' => $this->entityComparison->getRows($hasher->fetch_lines($original_file), $hasher->fetch_lines($installed_file), TRUE),
60 // Add the CSS for the diff.
61 @@ -86,4 +118,4 @@ class HackedDiffController extends EntityComparisonBase {