diff --git a/CHANGELOG.md b/CHANGELOG.md index 26daa49..5be351c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] +- Updated `os2web/os2web_audit` version +- Updated `os2web/os2web_datalookup` version + ## [3.16.2] 2024-10-31 - Applied coding standards diff --git a/composer.json b/composer.json index 660852d..ed6ac49 100644 --- a/composer.json +++ b/composer.json @@ -68,8 +68,8 @@ "http-interop/http-factory-guzzle": "^1.0.0", "itk-dev/beskedfordeler-drupal": "^1.0", "itk-dev/serviceplatformen": "^1.5", - "os2web/os2web_audit": "^0.1", - "os2web/os2web_datalookup": "^1.5", + "os2web/os2web_audit": "^0.1.1", + "os2web/os2web_datalookup": "^2.0", "os2web/os2web_nemlogin": "^1.0", "php-http/guzzle7-adapter": "^1.0", "phpoffice/phpword": "^0.18.2", diff --git a/modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DatafordelerDataLookup.php b/modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DatafordelerDataLookup.php index 2083fb1..ba69951 100644 --- a/modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DatafordelerDataLookup.php +++ b/modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DatafordelerDataLookup.php @@ -6,6 +6,7 @@ use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\os2forms_dawa\Entity\DatafordelerMatrikula; +use Drupal\os2web_audit\Service\Logger; use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupBase; use GuzzleHttp\ClientInterface; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -30,9 +31,15 @@ class DatafordelerDataLookup extends DataLookupBase implements DatafordelerDataL /** * {@inheritdoc} */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, ClientInterface $httpClient) { + public function __construct( + array $configuration, + $plugin_id, + $plugin_definition, + ClientInterface $httpClient, + Logger $auditLogger, + ) { $this->httpClient = $httpClient; - parent::__construct($configuration, $plugin_id, $plugin_definition); + parent::__construct($configuration, $plugin_id, $plugin_definition, $auditLogger); } /** @@ -44,6 +51,7 @@ public static function create(ContainerInterface $container, array $configuratio $plugin_id, $plugin_definition, $container->get('http_client'), + $container->get('os2web_audit.logger'), ); } @@ -102,7 +110,7 @@ public function getMatrikulaEntries(string $matrikulaId) : array { /** * {@inheritdoc} */ - public function defaultConfiguration() { + public function defaultConfiguration(): array { return [ 'username' => '', 'password' => '', diff --git a/modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DawaDataLookup.php b/modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DawaDataLookup.php index 871ed6a..7e90eb7 100644 --- a/modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DawaDataLookup.php +++ b/modules/os2forms_dawa/src/Plugin/os2web/DataLookup/DawaDataLookup.php @@ -46,7 +46,7 @@ public function getMatrikulaAutocompletePath() { /** * {@inheritdoc} */ - public function defaultConfiguration() { + public function defaultConfiguration(): array { return [ 'address_autocomplete_path' => 'https://dawa.aws.dk/adresser/autocomplete', 'address_api_path' => 'https://dawa.aws.dk/adresser', diff --git a/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php b/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php index 9d3d3a8..07b81ab 100644 --- a/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php +++ b/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php @@ -8,8 +8,8 @@ use Drupal\os2web_datalookup\LookupResult\CompanyLookupResult; use Drupal\os2web_datalookup\LookupResult\CprLookupResult; use Drupal\os2web_datalookup\Plugin\DataLookupManager; -use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCompany; -use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr; +use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCompanyInterface; +use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCprInterface; use Drupal\webform\WebformSubmissionInterface; use ItkDev\Serviceplatformen\Service\SF1601\SF1601; use ItkDev\Serviceplatformen\Service\SF1601\Serializer; @@ -99,7 +99,7 @@ public function log($level, $message, array $context = []): void { */ public function lookupCpr(string $cpr): CprLookupResult { $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cpr_lookup'); - if (!($instance instanceof DataLookupInterfaceCpr)) { + if (!($instance instanceof DataLookupCprInterface)) { throw new RuntimeException('Cannot get CPR data lookup instance'); } $lookupResult = $instance->lookup($cpr); @@ -115,7 +115,7 @@ public function lookupCpr(string $cpr): CprLookupResult { */ public function lookupCvr(string $cvr): CompanyLookupResult { $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cvr_lookup'); - if (!($instance instanceof DataLookupInterfaceCompany)) { + if (!($instance instanceof DataLookupCompanyInterface)) { throw new RuntimeException('Cannot get CVR data lookup instance'); } $lookupResult = $instance->lookup($cvr); diff --git a/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php b/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php index fa0a058..3c2c724 100644 --- a/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php +++ b/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php @@ -14,8 +14,8 @@ use Drupal\os2forms_digital_post\Plugin\AdvancedQueue\JobType\SendDigitalPostSF1601; use Drupal\os2forms_digital_post\Plugin\WebformHandler\WebformHandlerSF1601; use Drupal\os2web_datalookup\Plugin\DataLookupManager; -use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCompany; -use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr; +use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCompanyInterface; +use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCprInterface; use Drupal\webform\WebformSubmissionInterface; use Drupal\webform\WebformSubmissionStorageInterface; use ItkDev\Serviceplatformen\Service\SF1601\SF1601; @@ -127,7 +127,7 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h if (preg_match('/^\d{8}$/', $recipientIdentifier)) { $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cvr_lookup'); - if (!($instance instanceof DataLookupInterfaceCompany)) { + if (!($instance instanceof DataLookupCompanyInterface)) { throw new RuntimeException('Cannot get CVR data lookup instance'); } $lookupResult = $instance->lookup($recipientIdentifier); @@ -138,7 +138,7 @@ public function sendDigitalPost(WebformSubmissionInterface $submission, array $h } else { $instance = $this->dataLookupManager->createDefaultInstanceByGroup('cpr_lookup'); - if (!($instance instanceof DataLookupInterfaceCpr)) { + if (!($instance instanceof DataLookupCprInterface)) { throw new RuntimeException('Cannot get CPR data lookup instance'); } $lookupResult = $instance->lookup($recipientIdentifier); diff --git a/modules/os2forms_nemid/src/Element/MitidChildrenSelectAjaxBehaviour.php b/modules/os2forms_nemid/src/Element/MitidChildrenSelectAjaxBehaviour.php index d57e973..e88c218 100644 --- a/modules/os2forms_nemid/src/Element/MitidChildrenSelectAjaxBehaviour.php +++ b/modules/os2forms_nemid/src/Element/MitidChildrenSelectAjaxBehaviour.php @@ -39,7 +39,7 @@ public static function mitidChildrenSelectAjax(array &$form, FormStateInterface /** @var \Drupal\os2web_datalookup\Plugin\DataLookupManager $os2web_datalookup_plugins */ $os2web_datalookup_plugins = \Drupal::service('plugin.manager.os2web_datalookup'); - /** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr $cprPlugin */ + /** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCprInterface $cprPlugin */ $cprPlugin = $os2web_datalookup_plugins->createDefaultInstanceByGroup('cpr_lookup'); if ($cprPlugin->isReady()) { diff --git a/modules/os2forms_nemid/src/Service/FormsHelper.php b/modules/os2forms_nemid/src/Service/FormsHelper.php index 0fd6255..a2c435c 100644 --- a/modules/os2forms_nemid/src/Service/FormsHelper.php +++ b/modules/os2forms_nemid/src/Service/FormsHelper.php @@ -182,7 +182,7 @@ public function lookupPersonData(FormStateInterface $form_state) { } if ($cpr) { - /** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr $cprPlugin */ + /** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCprInterface $cprPlugin */ $cprPlugin = $this->dataLookManager->createDefaultInstanceByGroup('cpr_lookup'); if ($cprPlugin->isReady()) { @@ -284,7 +284,7 @@ private function lookupCompanyData(FormStateInterface $form_state) { // Performing the lookup. if ($cvr) { - /** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCompany $cvrPlugin */ + /** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCompanyInterface $cvrPlugin */ $cvrPlugin = $this->dataLookManager->createDefaultInstanceByGroup('cvr_lookup'); if ($cvrPlugin->isReady()) { @@ -292,7 +292,7 @@ private function lookupCompanyData(FormStateInterface $form_state) { } } elseif ($pNumber) { - /** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCompany $pNumberPlugin */ + /** @var \Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupCompanyInterface $pNumberPlugin */ $pNumberPlugin = $this->dataLookManager->createDefaultInstanceByGroup('pnumber_lookup'); if ($pNumberPlugin->isReady()) {