Skip to content

Commit 2067958

Browse files
authored
Merge pull request #4 from Spooky063/fix/dependency-inversion
fix dependency inversion principle
2 parents 7652535 + c4b7671 commit 2067958

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

drupal_gdpr.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ name: GDPR
33
type: module
44
description: Gives basic GDPR features
55
core: 8.x
6-
version: 8.x-1.0
6+
version: 8.x-1.0.1

src/Controller/GDPRController.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
use Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException;
66
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
77
use Drupal\Core\Controller\ControllerBase;
8-
use Drupal\Core\Entity\EntityFieldManager;
8+
use Drupal\Core\Entity\EntityFieldManagerInterface;
99
use Drupal\Core\File\FileSystem;
10+
use Drupal\Core\File\FileSystemInterface;
1011
use Drupal\drupal_gdpr\Form\CSVExportSettingsForm;
1112
use Drupal\user\Entity\User;
1213
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -20,13 +21,13 @@ class GDPRController extends ControllerBase
2021
{
2122
const CSV_EXPORTS_FOLDER = 'public://gdpr/csv_exports';
2223

23-
/** @var EntityFieldManager */
24+
/** @var EntityFieldManagerInterface */
2425
protected $entityFieldManager;
2526

26-
/** @var FileSystem */
27+
/** @var FileSystemInterface */
2728
private $fileSystem;
2829

29-
public function __construct(EntityFieldManager $entityFieldManager, FileSystem $fileSystem)
30+
public function __construct(EntityFieldManagerInterface $entityFieldManager, FileSystemInterface $fileSystem)
3031
{
3132
$this->entityFieldManager = $entityFieldManager;
3233
$this->fileSystem = $fileSystem;

src/Form/CSVExportSettingsForm.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
use Drupal\Component\Plugin\Exception\PluginNotFoundException;
66
use Drupal\Core\Config\ConfigFactoryInterface;
7-
use Drupal\Core\Entity\EntityFieldManager;
8-
use Drupal\Core\Entity\EntityTypeBundleInfo;
9-
use Drupal\Core\Entity\EntityTypeManager;
7+
use Drupal\Core\Entity\EntityFieldManagerInterface;
8+
use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
9+
use Drupal\Core\Entity\EntityTypeManagerInterface;
1010
use Drupal\Core\Form\ConfigFormBase;
1111
use Drupal\Core\Form\FormStateInterface;
1212
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -28,17 +28,17 @@ class CSVExportSettingsForm extends ConfigFormBase
2828
const USER_FIELDS = 'user_fields';
2929
const USER_FIELDSET = 'user_fieldset';
3030

31-
/** @var EntityFieldManager */
31+
/** @var EntityFieldManagerInterface */
3232
protected $entityFieldManager;
3333

34-
/** @var EntityTypeBundleInfo */
34+
/** @var EntityTypeBundleInfoInterface */
3535
protected $entityTypeBundleInfo;
3636

37-
/** @var EntityTypeManager */
37+
/** @var EntityTypeManagerInterface */
3838
protected $entityTypeManager;
3939

4040
/** {@inheritdoc} */
41-
public function __construct(ConfigFactoryInterface $config_factory, EntityFieldManager $entityFieldManager, EntityTypeBundleInfo $entityTypeBundleInfo, EntityTypeManager $entityTypeManager)
41+
public function __construct(ConfigFactoryInterface $config_factory, EntityFieldManagerInterface $entityFieldManager, EntityTypeBundleInfoInterface $entityTypeBundleInfo, EntityTypeManagerInterface $entityTypeManager)
4242
{
4343
parent::__construct($config_factory);
4444
$this->entityFieldManager = $entityFieldManager;

0 commit comments

Comments
 (0)