From be8f28bcafc760c87dbded061b7dd35cfa6549e8 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 7 Oct 2024 09:30:48 +0200 Subject: [PATCH 1/3] Apply coding standards --- composer.json | 3 ++- .../Plugin/WebformElement/AutocompleteElement.php | 2 +- .../Plugin/WebformElement/DawaElementAddress.php | 2 +- .../WebformElement/DawaElementAddressMatrikula.php | 2 +- .../src/Plugin/WebformElement/DawaElementBase.php | 2 +- .../src/Plugin/WebformElement/DawaElementBlock.php | 2 +- .../Plugin/WebformElement/DawaElementMatrikula.php | 2 +- .../src/Helper/DigitalPostHelper.php | 11 +++++++++-- .../os2forms_digital_post/src/Helper/MeMoHelper.php | 2 +- .../src/Helper/SF1461Helper.php | 2 +- .../src/Helper/WebformHelperSF1601.php | 13 ++++++++++--- .../AdvancedQueue/JobType/SendDigitalPostSF1601.php | 2 +- .../src/WebformOs2FormsEncryptSubmissionStorage.php | 2 +- .../Plugin/AdvancedQueue/JobType/FbsCreateUser.php | 6 +++--- .../src/Plugin/WebformHandler/FbsWebformHandler.php | 4 ++-- modules/os2forms_forloeb/src/MaestroHelper.php | 8 ++++---- .../JobType/SendMeastroNotification.php | 2 +- .../EngineTasks/MaestroWebformInheritTask.php | 2 +- .../EngineTasks/MaestroWebformMultipleTask.php | 2 +- .../Plugin/WebformElement/NemidChildrenRadios.php | 2 +- .../Plugin/WebformElement/NemidChildrenSelect.php | 2 +- .../src/Plugin/WebformElement/NemidNemloginLink.php | 2 +- .../src/Helper/Helper.php | 2 +- src/Plugin/WebformElement/Os2formsPersonLookup.php | 2 +- 24 files changed, 48 insertions(+), 33 deletions(-) diff --git a/composer.json b/composer.json index 96fc1b9d..b2ccef7e 100644 --- a/composer.json +++ b/composer.json @@ -149,7 +149,8 @@ "phpstan/extension-installer": true, "simplesamlphp/composer-module-installer": true, "vaimo/composer-patches": true, - "zaporylie/composer-drupal-optimizations": true + "zaporylie/composer-drupal-optimizations": true, + "mglaman/composer-drupal-lenient": true } } } diff --git a/modules/os2forms_autocomplete/src/Plugin/WebformElement/AutocompleteElement.php b/modules/os2forms_autocomplete/src/Plugin/WebformElement/AutocompleteElement.php index 56411df8..71985177 100644 --- a/modules/os2forms_autocomplete/src/Plugin/WebformElement/AutocompleteElement.php +++ b/modules/os2forms_autocomplete/src/Plugin/WebformElement/AutocompleteElement.php @@ -38,7 +38,7 @@ protected function defineDefaultProperties() { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { parent::prepare($element, $webform_submission); if (isset($element['#webform_key'])) { diff --git a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementAddress.php b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementAddress.php index ac7ae6a6..93f809da 100644 --- a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementAddress.php +++ b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementAddress.php @@ -31,7 +31,7 @@ public function getDefaultProperties() { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { parent::prepare($element, $webform_submission); $element['#autocomplete_route_parameters']['remove_place_name'] = $element['#remove_place_name'] ?? FALSE; diff --git a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementAddressMatrikula.php b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementAddressMatrikula.php index 6394bd5b..5d211db0 100644 --- a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementAddressMatrikula.php +++ b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementAddressMatrikula.php @@ -36,7 +36,7 @@ public function getDefaultProperties() { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { parent::prepare($element, $webform_submission); $element['#webform_composite_elements']['address']['#remove_place_name'] = TRUE; diff --git a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementBase.php b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementBase.php index 0e4de82e..e0877871 100644 --- a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementBase.php +++ b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementBase.php @@ -25,7 +25,7 @@ public function getDefaultProperties() { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { parent::prepare($element, $webform_submission); $element['#autocomplete_route_name'] = 'os2forms_dawa.element.autocomplete'; diff --git a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementBlock.php b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementBlock.php index 70ed5f90..cb0b832f 100644 --- a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementBlock.php +++ b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementBlock.php @@ -30,7 +30,7 @@ public function getDefaultProperties() { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { parent::prepare($element, $webform_submission); $element['#autocomplete_route_parameters']['remove_code'] = $element['#remove_code'] ?? FALSE; diff --git a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementMatrikula.php b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementMatrikula.php index 4714b21d..34654769 100644 --- a/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementMatrikula.php +++ b/modules/os2forms_dawa/src/Plugin/WebformElement/DawaElementMatrikula.php @@ -31,7 +31,7 @@ public function getDefaultProperties() { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { parent::prepare($element, $webform_submission); $element['#autocomplete_route_parameters']['remove_code'] = $element['#remove_code'] ?? FALSE; diff --git a/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php b/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php index c51f0dee..c0683e5e 100644 --- a/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php +++ b/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php @@ -11,8 +11,8 @@ use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCompany; use Drupal\os2web_datalookup\Plugin\os2web\DataLookup\DataLookupInterfaceCpr; use Drupal\webform\WebformSubmissionInterface; -use ItkDev\Serviceplatformen\Service\SF1601\Serializer; use ItkDev\Serviceplatformen\Service\SF1601\SF1601; +use ItkDev\Serviceplatformen\Service\SF1601\Serializer; use Oio\Fjernprint\ForsendelseI; use Psr\Log\LoggerInterface; use Psr\Log\LoggerTrait; @@ -55,7 +55,7 @@ public function __construct( * * @phpstan-return array */ - public function sendDigitalPost(string $type, Message $message, ?ForsendelseI $forsendelse, WebformSubmissionInterface $submission = NULL): array { + public function sendDigitalPost(string $type, Message $message, ?ForsendelseI $forsendelse, ?WebformSubmissionInterface $submission = NULL): array { $senderSettings = $this->settings->getSender(); $options = [ 'test_mode' => (bool) $this->settings->getTestMode(), @@ -76,6 +76,13 @@ public function sendDigitalPost(string $type, Message $message, ?ForsendelseI $f /** * {@inheritdoc} + * + * @param mixed $level + * The level. + * @param string $message + * The message. + * @param array $context + * The context. */ public function log($level, $message, array $context = []): void { $this->logger->log($level, $message, $context); diff --git a/modules/os2forms_digital_post/src/Helper/MeMoHelper.php b/modules/os2forms_digital_post/src/Helper/MeMoHelper.php index 769dcad9..3ec8b7ed 100644 --- a/modules/os2forms_digital_post/src/Helper/MeMoHelper.php +++ b/modules/os2forms_digital_post/src/Helper/MeMoHelper.php @@ -19,8 +19,8 @@ use Drupal\os2web_datalookup\LookupResult\CompanyLookupResult; use Drupal\os2web_datalookup\LookupResult\CprLookupResult; use Drupal\webform\WebformSubmissionInterface; -use ItkDev\Serviceplatformen\Service\SF1601\Serializer; use ItkDev\Serviceplatformen\Service\SF1601\SF1601; +use ItkDev\Serviceplatformen\Service\SF1601\Serializer; /** * MeMo helper. diff --git a/modules/os2forms_digital_post/src/Helper/SF1461Helper.php b/modules/os2forms_digital_post/src/Helper/SF1461Helper.php index 171abe1e..adc8a670 100644 --- a/modules/os2forms_digital_post/src/Helper/SF1461Helper.php +++ b/modules/os2forms_digital_post/src/Helper/SF1461Helper.php @@ -15,7 +15,7 @@ class SF1461Helper { * See "BeskedFåTilsendt" on * https://digitaliseringskataloget.dk/integration/sf1461. */ - public function buildResponseDocument(int $statusCode, string $errorMessage = NULL): \DOMDocument { + public function buildResponseDocument(int $statusCode, ?string $errorMessage = NULL): \DOMDocument { $xml = <<<'XML' diff --git a/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php b/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php index f3054f8b..11a21512 100644 --- a/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php +++ b/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php @@ -2,12 +2,12 @@ namespace Drupal\os2forms_digital_post\Helper; -use Drupal\advancedqueue\Entity\QueueInterface; -use Drupal\advancedqueue\Job; -use Drupal\advancedqueue\JobResult; use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Logger\LoggerChannelInterface; +use Drupal\advancedqueue\Entity\QueueInterface; +use Drupal\advancedqueue\Job; +use Drupal\advancedqueue\JobResult; use Drupal\os2forms_digital_post\Exception\InvalidRecipientIdentifierElementException; use Drupal\os2forms_digital_post\Exception\RuntimeException; use Drupal\os2forms_digital_post\Exception\SubmissionNotFoundException; @@ -199,6 +199,13 @@ private function loadQueue(): QueueInterface { /** * {@inheritdoc} + * + * @param mixed $level + * The level. + * @param string $message + * The message. + * @param array $context + * The context. */ public function log($level, $message, array $context = []): void { $this->logger->log($level, $message, $context); diff --git a/modules/os2forms_digital_post/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php b/modules/os2forms_digital_post/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php index 3e9cd0a0..3952d333 100644 --- a/modules/os2forms_digital_post/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php +++ b/modules/os2forms_digital_post/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php @@ -2,10 +2,10 @@ namespace Drupal\os2forms_digital_post\Plugin\AdvancedQueue\JobType; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\advancedqueue\Job; use Drupal\advancedqueue\JobResult; use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\os2forms_digital_post\Helper\WebformHelperSF1601; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/modules/os2forms_encrypt/src/WebformOs2FormsEncryptSubmissionStorage.php b/modules/os2forms_encrypt/src/WebformOs2FormsEncryptSubmissionStorage.php index 4416f4ff..d23ee152 100644 --- a/modules/os2forms_encrypt/src/WebformOs2FormsEncryptSubmissionStorage.php +++ b/modules/os2forms_encrypt/src/WebformOs2FormsEncryptSubmissionStorage.php @@ -35,7 +35,7 @@ class WebformOs2FormsEncryptSubmissionStorage extends WebformEncryptSubmissionSt * * @see Drupal\webform\WebformSubmissionStorage::getColumns */ - public function getColumns(WebformInterface $webform = NULL, EntityInterface $source_entity = NULL, AccountInterface $account = NULL, $include_elements = TRUE) { + public function getColumns(?WebformInterface $webform = NULL, ?EntityInterface $source_entity = NULL, ?AccountInterface $account = NULL, $include_elements = TRUE) { if (!\Drupal::moduleHandler()->moduleExists('webform_revisions')) { return parent::getColumns($webform, $source_entity, $account, $include_elements); } diff --git a/modules/os2forms_fbs_handler/src/Plugin/AdvancedQueue/JobType/FbsCreateUser.php b/modules/os2forms_fbs_handler/src/Plugin/AdvancedQueue/JobType/FbsCreateUser.php index 2ed0908c..daf34793 100644 --- a/modules/os2forms_fbs_handler/src/Plugin/AdvancedQueue/JobType/FbsCreateUser.php +++ b/modules/os2forms_fbs_handler/src/Plugin/AdvancedQueue/JobType/FbsCreateUser.php @@ -2,12 +2,12 @@ namespace Drupal\os2forms_fbs_handler\Plugin\AdvancedQueue\JobType; -use Drupal\advancedqueue\Job; -use Drupal\advancedqueue\JobResult; -use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\advancedqueue\Job; +use Drupal\advancedqueue\JobResult; +use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase; use Drupal\os2forms_fbs_handler\Client\FBS; use Drupal\os2forms_fbs_handler\Client\Model\Guardian; use Drupal\os2forms_fbs_handler\Client\Model\Patron; diff --git a/modules/os2forms_fbs_handler/src/Plugin/WebformHandler/FbsWebformHandler.php b/modules/os2forms_fbs_handler/src/Plugin/WebformHandler/FbsWebformHandler.php index 2eaf0465..25625145 100644 --- a/modules/os2forms_fbs_handler/src/Plugin/WebformHandler/FbsWebformHandler.php +++ b/modules/os2forms_fbs_handler/src/Plugin/WebformHandler/FbsWebformHandler.php @@ -2,14 +2,14 @@ namespace Drupal\os2forms_fbs_handler\Plugin\WebformHandler; -use Drupal\advancedqueue\Entity\Queue; -use Drupal\advancedqueue\Job; use Drupal\Core\Config\ConfigFactoryInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Logger\LoggerChannelFactoryInterface; use Drupal\Core\Logger\LoggerChannelInterface; use Drupal\Core\Render\RendererInterface; +use Drupal\advancedqueue\Entity\Queue; +use Drupal\advancedqueue\Job; use Drupal\os2forms_fbs_handler\Plugin\AdvancedQueue\JobType\FbsCreateUser; use Drupal\webform\Plugin\WebformHandlerBase; use Drupal\webform\WebformSubmissionConditionsValidatorInterface; diff --git a/modules/os2forms_forloeb/src/MaestroHelper.php b/modules/os2forms_forloeb/src/MaestroHelper.php index f4d045b3..d2dd0c52 100644 --- a/modules/os2forms_forloeb/src/MaestroHelper.php +++ b/modules/os2forms_forloeb/src/MaestroHelper.php @@ -4,9 +4,6 @@ use DigitalPost\MeMo\Action; use DigitalPost\MeMo\EntryPoint; -use Drupal\advancedqueue\Entity\QueueInterface; -use Drupal\advancedqueue\Job; -use Drupal\advancedqueue\JobResult; use Drupal\Component\Render\MarkupInterface; use Drupal\Component\Utility\NestedArray; use Drupal\Core\Config\ConfigFactoryInterface; @@ -19,6 +16,9 @@ use Drupal\Core\Render\Markup; use Drupal\Core\Site\Settings; use Drupal\Core\Url; +use Drupal\advancedqueue\Entity\QueueInterface; +use Drupal\advancedqueue\Job; +use Drupal\advancedqueue\JobResult; use Drupal\entity_print\Plugin\EntityPrintPluginManagerInterface; use Drupal\maestro\Engine\MaestroEngine; use Drupal\maestro\Utility\TaskHandler; @@ -456,7 +456,7 @@ private function sendNotificationDigitalPost( * * @see self::renderHtml() */ - public function renderNotification(WebformSubmissionInterface $submission, string $handlerId, string $notificationType, array $templateTask, int $maestroQueueID, string $contentType = NULL): array { + public function renderNotification(WebformSubmissionInterface $submission, string $handlerId, string $notificationType, array $templateTask, int $maestroQueueID, ?string $contentType = NULL): array { $handler = $submission->getWebform()->getHandler($handlerId); $settings = $handler->getSettings(); diff --git a/modules/os2forms_forloeb/src/Plugin/AdvancedQueue/JobType/SendMeastroNotification.php b/modules/os2forms_forloeb/src/Plugin/AdvancedQueue/JobType/SendMeastroNotification.php index 7c236f61..1cf267de 100644 --- a/modules/os2forms_forloeb/src/Plugin/AdvancedQueue/JobType/SendMeastroNotification.php +++ b/modules/os2forms_forloeb/src/Plugin/AdvancedQueue/JobType/SendMeastroNotification.php @@ -2,10 +2,10 @@ namespace Drupal\os2forms_forloeb\Plugin\AdvancedQueue\JobType; +use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\advancedqueue\Job; use Drupal\advancedqueue\JobResult; use Drupal\advancedqueue\Plugin\AdvancedQueue\JobType\JobTypeBase; -use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\os2forms_forloeb\MaestroHelper; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformInheritTask.php b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformInheritTask.php index 8bd0040e..9544cee5 100644 --- a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformInheritTask.php +++ b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformInheritTask.php @@ -30,7 +30,7 @@ class MaestroWebformInheritTask extends MaestroWebformTask { * [1] - is the queue ID * The processID and queueID properties are defined in the MaestroTaskTrait. */ - public function __construct(array $configuration = NULL) { + public function __construct(?array $configuration = NULL) { if (is_array($configuration)) { $this->processID = $configuration[0]; $this->queueID = $configuration[1]; diff --git a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformMultipleTask.php b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformMultipleTask.php index 22c26a71..71a31155 100644 --- a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformMultipleTask.php +++ b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformMultipleTask.php @@ -27,7 +27,7 @@ class MaestroWebformMultipleTask extends MaestroWebformTask { * [1] - is the queue ID * The processID and queueID properties are defined in the MaestroTaskTrait. */ - public function __construct(array $configuration = NULL) { + public function __construct(?array $configuration = NULL) { if (is_array($configuration)) { $this->processID = $configuration[0]; $this->queueID = $configuration[1]; diff --git a/modules/os2forms_nemid/src/Plugin/WebformElement/NemidChildrenRadios.php b/modules/os2forms_nemid/src/Plugin/WebformElement/NemidChildrenRadios.php index fb88f35f..0e287fd1 100644 --- a/modules/os2forms_nemid/src/Plugin/WebformElement/NemidChildrenRadios.php +++ b/modules/os2forms_nemid/src/Plugin/WebformElement/NemidChildrenRadios.php @@ -61,7 +61,7 @@ public function getElementSelectorSourceValues(array $element) { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { // Setting empty options to avoid errors during load. $element['#options'] = []; parent::prepare($element, $webform_submission); diff --git a/modules/os2forms_nemid/src/Plugin/WebformElement/NemidChildrenSelect.php b/modules/os2forms_nemid/src/Plugin/WebformElement/NemidChildrenSelect.php index eb12d834..9d2e0497 100644 --- a/modules/os2forms_nemid/src/Plugin/WebformElement/NemidChildrenSelect.php +++ b/modules/os2forms_nemid/src/Plugin/WebformElement/NemidChildrenSelect.php @@ -61,7 +61,7 @@ public function getElementSelectorSourceValues(array $element) { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { // Setting empty options to avoid errors during load. $element['#options'] = []; parent::prepare($element, $webform_submission); diff --git a/modules/os2forms_nemid/src/Plugin/WebformElement/NemidNemloginLink.php b/modules/os2forms_nemid/src/Plugin/WebformElement/NemidNemloginLink.php index 48fffbf9..a41d7121 100644 --- a/modules/os2forms_nemid/src/Plugin/WebformElement/NemidNemloginLink.php +++ b/modules/os2forms_nemid/src/Plugin/WebformElement/NemidNemloginLink.php @@ -42,7 +42,7 @@ public function getTranslatableProperties() { /** * {@inheritdoc} */ - public function prepare(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + public function prepare(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { parent::prepare($element, $webform_submission); $element['#attributes']['class'][] = 'nemlogin-button-link'; diff --git a/modules/os2forms_permissions_by_term/src/Helper/Helper.php b/modules/os2forms_permissions_by_term/src/Helper/Helper.php index 47c6d306..d7ff395a 100644 --- a/modules/os2forms_permissions_by_term/src/Helper/Helper.php +++ b/modules/os2forms_permissions_by_term/src/Helper/Helper.php @@ -264,7 +264,7 @@ public function fieldWidgetWebformEntityReferenceFormAlter(array &$elements) { * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException */ - private function filterWebformSelectOptions(array $options, array &$result = [], string $parent = NULL) { + private function filterWebformSelectOptions(array $options, array &$result = [], ?string $parent = NULL) { foreach ($options as $key => $option) { if ($option instanceof FieldFilteredMarkup) { $webform = $this->entityTypeManager->getStorage('webform')->load($key); diff --git a/src/Plugin/WebformElement/Os2formsPersonLookup.php b/src/Plugin/WebformElement/Os2formsPersonLookup.php index b3bee21e..54ad0b94 100644 --- a/src/Plugin/WebformElement/Os2formsPersonLookup.php +++ b/src/Plugin/WebformElement/Os2formsPersonLookup.php @@ -46,7 +46,7 @@ protected function defineDefaultProperties() { /** * {@inheritdoc} */ - protected function prepareElementValidateCallbacks(array &$element, WebformSubmissionInterface $webform_submission = NULL) { + protected function prepareElementValidateCallbacks(array &$element, ?WebformSubmissionInterface $webform_submission = NULL) { parent::prepareElementValidateCallbacks($element, $webform_submission); $element['#element_validate'][] = [get_class($this), 'validatePerson']; From 8d7d4f85cf5d6e4d65135b75c8fbd6a474a0f8cc Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 7 Oct 2024 09:35:15 +0200 Subject: [PATCH 2/3] Further coding standards --- CHANGELOG.md | 1 + modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php | 2 ++ .../os2forms_digital_post/src/Helper/WebformHelperSF1601.php | 2 ++ 3 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e5f9ef3..6ab8f812 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] - [OS-119] Keeping value of CPR clean, not adding address protection text +- Applied coding standards ## [3.16.0] 2024-08-27 diff --git a/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php b/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php index c0683e5e..9d3d3a87 100644 --- a/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php +++ b/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php @@ -83,6 +83,8 @@ public function sendDigitalPost(string $type, Message $message, ?ForsendelseI $f * The message. * @param array $context * The context. + * + * @phpstan-param array $context */ public function log($level, $message, array $context = []): void { $this->logger->log($level, $message, $context); diff --git a/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php b/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php index 11a21512..fa0a0584 100644 --- a/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php +++ b/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php @@ -206,6 +206,8 @@ private function loadQueue(): QueueInterface { * The message. * @param array $context * The context. + * + * @phpstan-param array $context */ public function log($level, $message, array $context = []): void { $this->logger->log($level, $message, $context); From 2c60a4b2a32ec4b778d59a7717578f85be008a90 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 7 Oct 2024 09:40:18 +0200 Subject: [PATCH 3/3] Add missing link to CHANGELOG --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ab8f812..9003889e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ before starting to add changes. Use example [placed in the end of the page](#exa - [OS-119] Keeping value of CPR clean, not adding address protection text - Applied coding standards -## [3.16.0] 2024-08-27 +## [3.16.0-beta1] 2024-08-27 [#110](https://github.com/OS2Forms/os2forms/pull/110) @@ -281,7 +281,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa - Security in case of vulnerabilities. ``` -[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.15.8...HEAD +[Unreleased]: https://github.com/OS2Forms/os2forms/compare/3.16.0-beta1...HEAD +[3.16.0-beta1]: https://github.com/OS2Forms/os2forms/compare/3.15.8...3.16.0-beta1 [3.15.8]: https://github.com/OS2Forms/os2forms/compare/3.15.7...3.15.8 [3.15.7]: https://github.com/OS2Forms/os2forms/compare/3.15.6...3.15.7 [3.15.6]: https://github.com/OS2Forms/os2forms/compare/3.15.5...3.15.6