|
3 | 3 | namespace Drupal\os2forms_dawa\Plugin\os2web\DataLookup;
|
4 | 4 |
|
5 | 5 | use Drupal\Component\Utility\NestedArray;
|
| 6 | +use Drupal\Core\File\FileSystem; |
6 | 7 | use Drupal\Core\Form\FormStateInterface;
|
7 | 8 | use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
|
| 9 | +use Drupal\key\KeyRepository; |
| 10 | +use Drupal\key\KeyRepositoryInterface; |
8 | 11 | use Drupal\os2forms_dawa\Entity\DatafordelerMatrikula;
|
9 | 12 | use Drupal\os2web_audit\Service\Logger;
|
10 | 13 | use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupBase;
|
|
21 | 24 | */
|
22 | 25 | class DatafordelerDataLookup extends DataLookupBase implements DatafordelerDataLookupInterface, ContainerFactoryPluginInterface {
|
23 | 26 |
|
24 |
| - /** |
25 |
| - * The HTTP client to fetch the feed data with. |
26 |
| - * |
27 |
| - * @var \GuzzleHttp\ClientInterface |
28 |
| - */ |
29 |
| - protected $httpClient; |
30 |
| - |
31 | 27 | /**
|
32 | 28 | * {@inheritdoc}
|
33 | 29 | */
|
34 | 30 | public function __construct(
|
35 | 31 | array $configuration,
|
36 | 32 | $plugin_id,
|
37 | 33 | $plugin_definition,
|
38 |
| - ClientInterface $httpClient, |
| 34 | + protected ClientInterface $httpClient, |
39 | 35 | Logger $auditLogger,
|
| 36 | + KeyRepositoryInterface $keyRepository, |
| 37 | + FileSystem $fileSystem, |
40 | 38 | ) {
|
41 |
| - $this->httpClient = $httpClient; |
42 |
| - parent::__construct($configuration, $plugin_id, $plugin_definition, $auditLogger); |
| 39 | + parent::__construct($configuration, $plugin_id, $plugin_definition, $auditLogger, $keyRepository, $fileSystem); |
43 | 40 | }
|
44 | 41 |
|
45 | 42 | /**
|
46 | 43 | * {@inheritdoc}
|
47 | 44 | */
|
48 | 45 | public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
|
| 46 | + /** @var Logger $auditLogger */ |
| 47 | + $auditLogger = $container->get('os2web_audit.logger'); |
| 48 | + /** @var \Drupal\key\KeyRepositoryInterface $keyRepository */ |
| 49 | + $keyRepository = $container->get('key.repository'); |
| 50 | + /** @var \Drupal\Core\File\FileSystem $fileSystem */ |
| 51 | + $fileSystem = $container->get('file_system'); |
| 52 | + |
49 | 53 | return new static(
|
50 | 54 | $configuration,
|
51 | 55 | $plugin_id,
|
52 | 56 | $plugin_definition,
|
53 | 57 | $container->get('http_client'),
|
54 |
| - $container->get('os2web_audit.logger'), |
| 58 | + $auditLogger, |
| 59 | + $keyRepository, |
| 60 | + $fileSystem, |
55 | 61 | );
|
56 | 62 | }
|
57 | 63 |
|
|
0 commit comments