Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply coding standards #99

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +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)
NemLogin autologout pop-up styling.
- [#99](https://github.com/OS2Forms/os2forms/pull/99)
Fix coding standards.

## [3.14.1] 2024-01-16

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand All @@ -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']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/os2forms_digital_post/src/Form/SettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class BeskedfordelerHelper {
public function __construct(
private readonly Connection $database,
private readonly MeMoHelper $meMoHelper,
LoggerInterface $logger) {
LoggerInterface $logger,
) {
$this->setLogger($logger);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class CertificateLocatorHelper {
* {@inheritdoc}
*/
public function __construct(
private readonly Settings $settings
private readonly Settings $settings,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion modules/os2forms_digital_post/src/Model/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MaestroNotificationController extends ControllerBase {
*/
public function __construct(
private readonly WebformSubmissionStorageInterface $webformSubmissionStorage,
private readonly MaestroHelper $maestroHelper
private readonly MaestroHelper $maestroHelper,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion modules/os2forms_forloeb/src/Form/SettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
12 changes: 6 additions & 6 deletions modules/os2forms_forloeb/src/MaestroHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -148,7 +148,7 @@ private function handleSubmissionNotification(
string $notificationType,
WebformSubmissionInterface $submission,
array $templateTask,
int $maestroQueueID
int $maestroQueueID,
): ?Job {
$context = [
'webform_submission' => $submission,
Expand Down Expand Up @@ -225,7 +225,7 @@ private function sendNotification(
string $notificationType,
WebformSubmissionInterface $submission,
array $templateTask,
int $maestroQueueID
int $maestroQueueID,
) {
$context = [
'webform_submission' => $submission,
Expand Down Expand Up @@ -309,7 +309,7 @@ private function sendNotificationEmail(
string $subject,
string $body,
WebformSubmissionInterface $submission,
string $notificationType
string $notificationType,
): void {
try {
$message = [
Expand Down Expand Up @@ -376,7 +376,7 @@ private function sendNotificationDigitalPost(
string $taskUrl,
string $actionLabel,
WebformSubmissionInterface $submission,
string $notificationType
string $notificationType,
): void {
try {
$document = new Document(
Expand Down Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/WebformHandler/SaveToFileWebformHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading