From 7517de8006e62e313adf6d4142903ecf09d760b5 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Wed, 24 Apr 2024 11:10:27 +0200 Subject: [PATCH 1/2] Apply coding standards --- CHANGELOG.md | 1 + .../Drush/Commands/DigitalPostTestCommands.php | 17 ++++++++++------- .../BeskedfordelerEventSubscriber.php | 3 ++- .../src/Form/SettingsForm.php | 2 +- .../src/Helper/AbstractMessageHelper.php | 2 +- .../src/Helper/BeskedfordelerHelper.php | 3 ++- .../src/Helper/CertificateLocatorHelper.php | 2 +- .../src/Helper/DigitalPostHelper.php | 2 +- .../src/Helper/WebformHelperSF1601.php | 2 +- .../src/Model/Document.php | 2 +- .../JobType/SendDigitalPostSF1601.php | 2 +- .../MaestroNotificationController.php | 2 +- .../os2forms_forloeb/src/Form/SettingsForm.php | 2 +- modules/os2forms_forloeb/src/MaestroHelper.php | 12 ++++++------ .../JobType/SendMeastroNotification.php | 2 +- .../NemloginRedirectSubscriber.php | 3 ++- .../WebformHandler/SaveToFileWebformHandler.php | 2 +- 17 files changed, 34 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c7370c..1b1b2a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ before starting to add changes. Use example [placed in the end of the page](#exa - [#84](https://github.com/OS2Forms/os2forms/pull/84) Added digital post test command. - [#96](https://github.com/OS2Forms/os2forms/pull/96) +- Fix ## [3.14.1] 2024-01-16 diff --git a/modules/os2forms_digital_post/src/Drush/Commands/DigitalPostTestCommands.php b/modules/os2forms_digital_post/src/Drush/Commands/DigitalPostTestCommands.php index 653783f..8db7f4f 100644 --- a/modules/os2forms_digital_post/src/Drush/Commands/DigitalPostTestCommands.php +++ b/modules/os2forms_digital_post/src/Drush/Commands/DigitalPostTestCommands.php @@ -26,7 +26,7 @@ public function __construct( private readonly DigitalPostHelper $digitalPostHelper, private readonly Token $token, private readonly EntityPrintPluginManagerInterface $entityPrintPluginManager, - private readonly Settings $digitalPostSettings + private readonly Settings $digitalPostSettings, ) { } @@ -53,12 +53,15 @@ public function __construct( * @command os2forms-digital-post:test:send * @usage os2forms-digital-post:test:send --help */ - public function send(array $recipients, array $options = [ - 'subject' => 'os2forms_digital_post', - 'message' => 'This is a test message from os2forms_digital_post sent on [current-date:html_datetime].', - 'digital-post-type' => SF1601::TYPE_AUTOMATISK_VALG, - 'dump-digital-post-settings' => FALSE, - ]): void { + public function send( + array $recipients, + array $options = [ + 'subject' => 'os2forms_digital_post', + 'message' => 'This is a test message from os2forms_digital_post sent on [current-date:html_datetime].', + 'digital-post-type' => SF1601::TYPE_AUTOMATISK_VALG, + 'dump-digital-post-settings' => FALSE, + ], + ): void { $io = new SymfonyStyle($this->input(), $this->output()); if ($options['dump-digital-post-settings']) { diff --git a/modules/os2forms_digital_post/src/EventSubscriber/BeskedfordelerEventSubscriber.php b/modules/os2forms_digital_post/src/EventSubscriber/BeskedfordelerEventSubscriber.php index 0ebbc4e..cbef5ad 100644 --- a/modules/os2forms_digital_post/src/EventSubscriber/BeskedfordelerEventSubscriber.php +++ b/modules/os2forms_digital_post/src/EventSubscriber/BeskedfordelerEventSubscriber.php @@ -23,7 +23,8 @@ public function __construct( private readonly BeskedfordelerHelper $beskedfordelerHelper, private readonly MessageHelper $messageHelper, private readonly WebformHelperSF1601 $webformHelper, - LoggerInterface $logger) { + LoggerInterface $logger, + ) { parent::__construct($logger); } diff --git a/modules/os2forms_digital_post/src/Form/SettingsForm.php b/modules/os2forms_digital_post/src/Form/SettingsForm.php index 0d96859..ad0fd96 100644 --- a/modules/os2forms_digital_post/src/Form/SettingsForm.php +++ b/modules/os2forms_digital_post/src/Form/SettingsForm.php @@ -32,7 +32,7 @@ final class SettingsForm extends FormBase { public function __construct( private readonly Settings $settings, private readonly CertificateLocatorHelper $certificateLocatorHelper, - EntityTypeManagerInterface $entityTypeManager + EntityTypeManagerInterface $entityTypeManager, ) { $this->queueStorage = $entityTypeManager->getStorage('advancedqueue_queue'); } diff --git a/modules/os2forms_digital_post/src/Helper/AbstractMessageHelper.php b/modules/os2forms_digital_post/src/Helper/AbstractMessageHelper.php index 100bac4..d9fb96a 100644 --- a/modules/os2forms_digital_post/src/Helper/AbstractMessageHelper.php +++ b/modules/os2forms_digital_post/src/Helper/AbstractMessageHelper.php @@ -24,7 +24,7 @@ abstract class AbstractMessageHelper { public function __construct( readonly protected Settings $settings, readonly protected ElementInfoManager $elementInfoManager, - readonly protected WebformTokenManagerInterface $webformTokenManager + readonly protected WebformTokenManagerInterface $webformTokenManager, ) { } diff --git a/modules/os2forms_digital_post/src/Helper/BeskedfordelerHelper.php b/modules/os2forms_digital_post/src/Helper/BeskedfordelerHelper.php index e24b509..5b93da5 100644 --- a/modules/os2forms_digital_post/src/Helper/BeskedfordelerHelper.php +++ b/modules/os2forms_digital_post/src/Helper/BeskedfordelerHelper.php @@ -24,7 +24,8 @@ class BeskedfordelerHelper { public function __construct( private readonly Connection $database, private readonly MeMoHelper $meMoHelper, - LoggerInterface $logger) { + LoggerInterface $logger, + ) { $this->setLogger($logger); } diff --git a/modules/os2forms_digital_post/src/Helper/CertificateLocatorHelper.php b/modules/os2forms_digital_post/src/Helper/CertificateLocatorHelper.php index 1e5d9f1..7c4d411 100644 --- a/modules/os2forms_digital_post/src/Helper/CertificateLocatorHelper.php +++ b/modules/os2forms_digital_post/src/Helper/CertificateLocatorHelper.php @@ -23,7 +23,7 @@ class CertificateLocatorHelper { * {@inheritdoc} */ public function __construct( - private readonly Settings $settings + private readonly Settings $settings, ) { } diff --git a/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php b/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php index 78972ef..c51f0de 100644 --- a/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php +++ b/modules/os2forms_digital_post/src/Helper/DigitalPostHelper.php @@ -34,7 +34,7 @@ public function __construct( private readonly ForsendelseHelper $forsendelseHelper, private readonly BeskedfordelerHelper $beskedfordelerHelper, private readonly LoggerChannelInterface $logger, - private readonly LoggerChannelInterface $submissionLogger + private readonly LoggerChannelInterface $submissionLogger, ) { } diff --git a/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php b/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php index 4fb8676..f3054f8 100644 --- a/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php +++ b/modules/os2forms_digital_post/src/Helper/WebformHelperSF1601.php @@ -57,7 +57,7 @@ public function __construct( private readonly BeskedfordelerHelper $beskedfordelerHelper, private readonly LoggerChannelInterface $logger, private readonly LoggerChannelInterface $submissionLogger, - private readonly DigitalPostHelper $digitalPostHelper + private readonly DigitalPostHelper $digitalPostHelper, ) { $this->webformSubmissionStorage = $entityTypeManager->getStorage('webform_submission'); $this->queueStorage = $entityTypeManager->getStorage('advancedqueue_queue'); diff --git a/modules/os2forms_digital_post/src/Model/Document.php b/modules/os2forms_digital_post/src/Model/Document.php index 42768ad..d34c5a5 100644 --- a/modules/os2forms_digital_post/src/Model/Document.php +++ b/modules/os2forms_digital_post/src/Model/Document.php @@ -17,7 +17,7 @@ public function __construct( readonly public string $content, readonly public string $mimeType, readonly public string $filename, - readonly public string $language = self::LANGUAGE_DEFAULT + readonly public string $language = self::LANGUAGE_DEFAULT, ) { } 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 6e10480..3e9cd0a 100644 --- a/modules/os2forms_digital_post/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php +++ b/modules/os2forms_digital_post/src/Plugin/AdvancedQueue/JobType/SendDigitalPostSF1601.php @@ -50,7 +50,7 @@ public function __construct( array $configuration, $plugin_id, $plugin_definition, - WebformHelperSF1601 $helper + WebformHelperSF1601 $helper, ) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->helper = $helper; diff --git a/modules/os2forms_forloeb/src/Controller/MaestroNotificationController.php b/modules/os2forms_forloeb/src/Controller/MaestroNotificationController.php index 989607a..e60a51f 100644 --- a/modules/os2forms_forloeb/src/Controller/MaestroNotificationController.php +++ b/modules/os2forms_forloeb/src/Controller/MaestroNotificationController.php @@ -23,7 +23,7 @@ class MaestroNotificationController extends ControllerBase { */ public function __construct( private readonly WebformSubmissionStorageInterface $webformSubmissionStorage, - private readonly MaestroHelper $maestroHelper + private readonly MaestroHelper $maestroHelper, ) { } diff --git a/modules/os2forms_forloeb/src/Form/SettingsForm.php b/modules/os2forms_forloeb/src/Form/SettingsForm.php index d6f1eb8..deb91bb 100644 --- a/modules/os2forms_forloeb/src/Form/SettingsForm.php +++ b/modules/os2forms_forloeb/src/Form/SettingsForm.php @@ -30,7 +30,7 @@ public function __construct( ConfigFactoryInterface $configFactory, private readonly RoleStorageInterface $roleStorage, private readonly EntityStorageInterface $queueStorage, - private readonly ModuleExtensionList $moduleHandler + private readonly ModuleExtensionList $moduleHandler, ) { parent::__construct($configFactory); } diff --git a/modules/os2forms_forloeb/src/MaestroHelper.php b/modules/os2forms_forloeb/src/MaestroHelper.php index dfa65ca..0323fa1 100644 --- a/modules/os2forms_forloeb/src/MaestroHelper.php +++ b/modules/os2forms_forloeb/src/MaestroHelper.php @@ -80,7 +80,7 @@ public function __construct( private readonly EntityPrintPluginManagerInterface $entityPrintPluginManager, private readonly DigitalPostHelper $digitalPostHelper, private readonly LoggerChannelInterface $logger, - private readonly LoggerChannelInterface $submissionLogger + private readonly LoggerChannelInterface $submissionLogger, ) { $this->config = $configFactory->get(SettingsForm::SETTINGS); $this->webformSubmissionStorage = $entityTypeManager->getStorage('webform_submission'); @@ -148,7 +148,7 @@ private function handleSubmissionNotification( string $notificationType, WebformSubmissionInterface $submission, array $templateTask, - int $maestroQueueID + int $maestroQueueID, ): ?Job { $context = [ 'webform_submission' => $submission, @@ -225,7 +225,7 @@ private function sendNotification( string $notificationType, WebformSubmissionInterface $submission, array $templateTask, - int $maestroQueueID + int $maestroQueueID, ) { $context = [ 'webform_submission' => $submission, @@ -309,7 +309,7 @@ private function sendNotificationEmail( string $subject, string $body, WebformSubmissionInterface $submission, - string $notificationType + string $notificationType, ): void { try { $message = [ @@ -376,7 +376,7 @@ private function sendNotificationDigitalPost( string $taskUrl, string $actionLabel, WebformSubmissionInterface $submission, - string $notificationType + string $notificationType, ): void { try { $document = new Document( @@ -593,7 +593,7 @@ private function renderHtml( array $content, string $taskUrl, string $actionLabel, - WebformSubmissionInterface $submission + WebformSubmissionInterface $submission, ): string|MarkupInterface { $template = $this->config->get('templates')['notification_' . $type] ?? NULL; if (file_exists($template)) { diff --git a/modules/os2forms_forloeb/src/Plugin/AdvancedQueue/JobType/SendMeastroNotification.php b/modules/os2forms_forloeb/src/Plugin/AdvancedQueue/JobType/SendMeastroNotification.php index 8968e03..7c236f6 100644 --- a/modules/os2forms_forloeb/src/Plugin/AdvancedQueue/JobType/SendMeastroNotification.php +++ b/modules/os2forms_forloeb/src/Plugin/AdvancedQueue/JobType/SendMeastroNotification.php @@ -40,7 +40,7 @@ public function __construct( array $configuration, $plugin_id, $plugin_definition, - private readonly MaestroHelper $helper + private readonly MaestroHelper $helper, ) { parent::__construct($configuration, $plugin_id, $plugin_definition); } diff --git a/modules/os2forms_nemid/src/EventSubscriber/NemloginRedirectSubscriber.php b/modules/os2forms_nemid/src/EventSubscriber/NemloginRedirectSubscriber.php index 6297a07..bbc734e 100644 --- a/modules/os2forms_nemid/src/EventSubscriber/NemloginRedirectSubscriber.php +++ b/modules/os2forms_nemid/src/EventSubscriber/NemloginRedirectSubscriber.php @@ -88,7 +88,8 @@ public function __construct( EntityFieldManagerInterface $entity_field_manager, ConfigFactoryInterface $config_factory, MessengerInterface $messenger, - KillSwitch $page_cache_kill_switch) { + KillSwitch $page_cache_kill_switch, + ) { $this->nemloginAuthProvider = $nemloginAuthProvider; $this->account = $account; $this->entityFieldManager = $entity_field_manager; diff --git a/src/Plugin/WebformHandler/SaveToFileWebformHandler.php b/src/Plugin/WebformHandler/SaveToFileWebformHandler.php index fcb783f..58910d1 100644 --- a/src/Plugin/WebformHandler/SaveToFileWebformHandler.php +++ b/src/Plugin/WebformHandler/SaveToFileWebformHandler.php @@ -764,7 +764,7 @@ protected function handleError($state, $message, $file_path, $file_type) { */ protected function buildTokenTreeElement( array $token_types = ['webform', 'webform_submission'], - $description = NULL + $description = NULL, ) { $description = $description ?: $this->t('Use [webform_submission:values:ELEMENT_KEY:raw] to get plain text values.'); return parent::buildTokenTreeElement($token_types, $description); From 558fa8429d853d957639a6ed15e5bcd5c148546e Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Wed, 24 Apr 2024 11:15:02 +0200 Subject: [PATCH 2/2] Updated CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b1b2a2..e6cd32d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,9 @@ before starting to add changes. Use example [placed in the end of the page](#exa - [#84](https://github.com/OS2Forms/os2forms/pull/84) Added digital post test command. - [#96](https://github.com/OS2Forms/os2forms/pull/96) -- Fix + NemLogin autologout pop-up styling. +- [#99](https://github.com/OS2Forms/os2forms/pull/99) + Fix coding standards. ## [3.14.1] 2024-01-16