From 73d8c23a3a57b3a170b845c9cfac656689a7d71d Mon Sep 17 00:00:00 2001 From: Mikkel Ricky Date: Mon, 2 Nov 2026 13:11:13 +0100 Subject: [PATCH] Cleaned up code --- .github/workflows/javascript.yaml | 2 +- .github/workflows/module.yaml | 2 +- modules/os2forms_test_playwright/src/VcrOperator.php | 6 ++++++ phpstan.neon | 2 ++ src/Helper/WebformHelperF2.php | 2 +- tests/Playwright/tests/user-manual-images.spec.ts | 1 - 6 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/javascript.yaml b/.github/workflows/javascript.yaml index 82a1317..48ebbef 100644 --- a/.github/workflows/javascript.yaml +++ b/.github/workflows/javascript.yaml @@ -16,7 +16,7 @@ name: JavaScript on: pull_request: paths: &paths - - "tests/**/*.{js,ts}" + - "tests/**/*.ts" - "docker-compose.yml" push: branches: diff --git a/.github/workflows/module.yaml b/.github/workflows/module.yaml index 1bed84f..10b106c 100644 --- a/.github/workflows/module.yaml +++ b/.github/workflows/module.yaml @@ -53,7 +53,7 @@ jobs: - uses: go-task/setup-task@v2 - name: Install Drupal site - run: task drupal:site:install + run: task drupal:site:install --yes - name: Extract translations run: task translations:extract diff --git a/modules/os2forms_test_playwright/src/VcrOperator.php b/modules/os2forms_test_playwright/src/VcrOperator.php index 482c663..4596032 100644 --- a/modules/os2forms_test_playwright/src/VcrOperator.php +++ b/modules/os2forms_test_playwright/src/VcrOperator.php @@ -33,6 +33,9 @@ public function __construct( * * @param array $configuration * The configuration. + * + * @return array + * The complete and validated configuration. */ public function configure(array $configuration): array { $conf = $this->state->get(self::CONFIGURATION); @@ -147,6 +150,9 @@ public static function getSubscribedEvents(): array { /** * Validate configuration. + * + * @return array + * The complete and validated configuration. */ private function validateConfiguration(): array { $configuration = $this->state->get(self::CONFIGURATION); diff --git a/phpstan.neon b/phpstan.neon index 0e8f037..46b2452 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -7,6 +7,8 @@ parameters: - message: '#Method Drupal\\os2forms_f2\\.+\(\) return type has no value type specified in iterable type array.#' - message: '#Method Drupal\\os2forms_f2\\.+\(\) has parameter \$.+ with no value type specified in iterable type array.#' - message: '#Function .+\(\) return type has no value type specified in iterable type array.#' + - message: '#Call to an undefined method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::addListener\(\).#' + path: modules/os2forms_test_playwright/src/VcrOperator.php # Local Variables: # mode: yaml diff --git a/src/Helper/WebformHelperF2.php b/src/Helper/WebformHelperF2.php index 6a70868..c88113e 100644 --- a/src/Helper/WebformHelperF2.php +++ b/src/Helper/WebformHelperF2.php @@ -131,7 +131,7 @@ public function createJob(WebformSubmissionInterface $webformSubmission, Webform $queue->enqueueJob($job); $context['@queue'] = $queue->id(); $this->notice('F2 job (archive on @archive_target) added to the queue @queue.', $context + [ - '@archive_target' => $handlerSettings->archive?->archiveTarget?->value ?? '', + '@archive_target' => $handlerSettings->archive->archiveTarget->value, ]); return $job; diff --git a/tests/Playwright/tests/user-manual-images.spec.ts b/tests/Playwright/tests/user-manual-images.spec.ts index 251a7b0..629d224 100644 --- a/tests/Playwright/tests/user-manual-images.spec.ts +++ b/tests/Playwright/tests/user-manual-images.spec.ts @@ -391,7 +391,6 @@ screenshooting ${selector} await vcrEject(); }); - test("webform submission", async ({ page }) => { const context = "webform-submission"; const locale = "da";