Skip to content

chore(phpcs): clear procest's PHPCS baseline (phpcbf + manual)#421

Merged
rubenvdlinde merged 14 commits into
developmentfrom
chore/phpcbf-eslint-stylelint-baseline
May 12, 2026
Merged

chore(phpcs): clear procest's PHPCS baseline (phpcbf + manual)#421
rubenvdlinde merged 14 commits into
developmentfrom
chore/phpcbf-eslint-stylelint-baseline

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

@rubenvdlinde rubenvdlinde commented May 12, 2026

Clears procest's entire pre-existing PHPCS error baseline (was ~829 errors) so the "PHP Quality (phpcs)" CI gate passes (composer phpcs exits 1 = warnings-only).

Two commits:

  1. phpcbf auto-fix — 602 mechanical violations across 75 files (alignment, whitespace, //end comments, braces). No logic changes.
  2. Manual fixes — the ~227 errors phpcbf can't touch, across 37 files:
    • "All arguments in calls to internal code must use named parameters" → positional calls to procest's own classes converted to named-arg form (Entity __call setters left positional)
    • "Inline IF statements are not allowed" → ternary statements/assignments rewritten to if/else, behaviour-preserving
    • missing @return/@param PHPDoc tags added; short-description capitalisation; implicit-true → === true; over-long lines wrapped

php -l clean on every changed file. ~709 warnings remain (mostly @spec PHPDoc-tag warnings) — intentionally out of scope; the CI tolerates warnings.

Note: procest's other CI checks (eslint, stylelint, Playwright E2E) are still red — those are separate pre-existing baselines, not addressed here. And the OR-side PHPUnit/Newman fresh-install issue (openregister#1492) is independent.

Merge order: recommend merging this before the other open procest PRs (#410-#420, #417, #419) so they rebase onto the reformatted lib/ rather than conflicting.

Part of the fleet production-readiness quality pass.

`composer phpcs:fix` (PHPCBF) auto-corrects 602 sniff violations across 75
files in `lib/` — alignment, trailing whitespace, missing `//end` comments,
brace placement, etc. Pure mechanical reformat; no logic changes.

This shrinks procest's pre-existing PHPCS baseline from ~829 errors to 227.
The remaining 227 are NOT auto-fixable and need manual work — a separate
focused pass:
  - ~132 × "All arguments in calls to internal code must use named arguments"
  - ~43 × "Inline IF statements are not allowed" (ternary → if/else)
  - ~52 × missing `@return` / parameter PHPDoc tags + a few misc

The procest "PHP Quality (phpcs)" CI gate fails on any error, so it stays
red until the remaining 227 are cleared too — but this is the right first
step (the 602 auto-fixes would otherwise have to be re-done by hand).

Recommend merging this before the other open procest PRs (#410-#420) so
they rebase onto the reformatted lib/ rather than conflicting with a later
sweep.
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 9d26c87

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit ⏭️
Newman ⏭️
Playwright

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 07:52 UTC

Download the full PDF report from the workflow artifacts.

…f, PHPDoc)

Completes the PHPCS baseline cleanup started in the previous commit
(phpcbf auto-fixes). This commit hand-fixes the ~227 errors phpcbf can't
touch, across 37 files in lib/:
  - "All arguments in calls to internal code must use named parameters" —
    converted positional calls to procest's own classes/constructors to
    named-argument form (e.g. `$x->extractObject($event)` →
    `$x->extractObject(event: $event)`). Entity __call setters/getters left
    positional (named args break the `$args[0]` resolution).
  - "Inline IF statements are not allowed" — ternary statements/assignments
    rewritten to if/else, behaviour-preserving.
  - Missing @return / @param PHPDoc tags added; short-description
    capitalisation; implicit-true comparisons made explicit (=== true);
    over-long lines wrapped.

`composer phpcs` now exits 1 (warnings only, no errors) — the "PHP Quality
(phpcs)" CI gate passes. ~709 warnings remain (mostly `@spec` PHPDoc-tag
warnings) — intentionally out of scope; the CI tolerates warnings.

No logic changes. `php -l` clean on all 37 changed files.
@rubenvdlinde rubenvdlinde changed the title chore(phpcs): auto-fix 602 PHPCS violations via phpcbf (baseline reduction) chore(phpcs): clear procest's PHPCS baseline (phpcbf + manual) May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 08b7b07

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit ⏭️
Newman ⏭️
Playwright

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 08:53 UTC

Download the full PDF report from the workflow artifacts.

Continues the procest quality cleanup (after the phpcs commits):

**stylelint** — added the missing peer deps of `@nextcloud/stylelint-config`
(which the config `extends`): `stylelint-config-recommended-scss@^13.1.0`,
`stylelint-config-recommended-vue@^1.6.1`, `postcss-html@^1.8.1` (matches
decidesk's set). `npm run stylelint` now runs and reports **0 errors** — the
"Vue Quality (stylelint)" gate was failing purely on the missing-config-module
error, not on actual style violations.

**eslint** — `npm run lint -- --fix` auto-fixed 5; the remaining 9 errors
fixed by hand:
  - `bezwaar.js` — removed unused `settingsStore` var + its now-unused import
  - `MyWork.vue` — `<template v-else-if="!loading">` → `v-if` (the v-else-if
    duplicated the preceding `<ParafeerInbox v-if="!loading">` condition →
    the grouped sections could never render; `vue/no-dupe-v-else-if`)
  - `DurationPicker.vue` — dropped unused `formatDuration` import
  - `CaseTransferDialog.vue` / `CreateShareDialog.vue` — moved `<template
    #actions>` out of the wrapping `<div>` to be a direct child of `<NcDialog>`
    (named slots must be owned by the component, not a nested div;
    `vue/valid-v-slot`)
  - `EmailComposer.vue` — `{{ '{{' + v + '}}' }}` → `{{ '{' + '{' + v + '}'
    + '}' }}` (a literal `}}` inside a `{{ }}` interpolation made Vue's
    template parser see the interpolation close early → "Unterminated string
    constant"; splitting the braces avoids it, renders identically)
  - `WorkflowCanvas.vue` — `v-model:nodes`/`v-model:edges` (Vue-3 named
    v-model) → `:nodes.sync`/`:edges.sync` (Vue-2 equivalent). This file is
    dormant anyway (see below).
`npm run lint` now exits 0 (errors=0; 14 warnings remain — `@nextcloud/no-deprecations`
on `OC.currentUser` etc. — tolerated).

**build** — `customComponents.js` no longer imports `VisualWorkflowEditor`
(→ `WorkflowCanvas` → `@vue-flow/{core,controls,background}` v1.x, which are
Vue-3-only and were breaking `npm run build` with 272 errors). The workflow
component files stay in `src/components/workflow/` but dormant; re-wire when
@vue-flow is replaced with a Vue-2-compatible flow lib. (Same fix as #417.)
`npm run build` now compiles with 0 errors; `procest-main.js` parses clean.

Together with the phpcs commits on this branch, procest's phpcs / eslint /
stylelint / build CI checks are all green. Still red: Playwright E2E and the
PHPUnit/Newman jobs (the latter fail on the OR-side `oc_openregister_objects`
fresh-install issue — openregister#1492 — not a procest problem).
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 7b11d2f

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit ⏭️
Newman ⏭️
Playwright

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 09:44 UTC

Download the full PDF report from the workflow artifacts.

…ase/voorstel seed objects

- templates/index.php + settings/admin.php only loaded the -main / -settings
  entry, not the -shared-vendor / -shared-nc-vue chunks the webpack
  splitChunks config emits — so the app failed to boot in the browser
  (blank page, all E2E tests red). Load the shared chunks first, matching
  the dashboard-widget loaders.
- procest_register.json seed config referenced voorstel-collegeadvies-0042/
  0055 (parafeeractie) and zaak-* slugs (adviesAanvraag) that were never
  seeded, so OpenRegister rejected them as non-UUID and aborted the whole
  config import. Add the 5 case + 2 voorstel objects those records point to.
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 7b11d2f

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit ⏭️
Newman ⏭️
Playwright

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 10:05 UTC

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 60a62a6

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 10:19 UTC

Download the full PDF report from the workflow artifacts.

The PHPUnit bootstrap required tests/Unit/Stubs/DoctrineStubs.php (which
declares a stub global OC class) before requiring server/lib/base.php.
With no Nextcloud present (local dev) that is fine; in CI the real server
is checked out, so base.php then redeclares OC -> 'Cannot declare class OC,
because the name is already in use'. Load base.php first; the stub file's
class_exists()/interface_exists() guards make it a no-op when the real
classes are already present.
…ation

With coverage enabled, phpunit.xml's beStrictAboutCoverageMetadata + failOnRisky
flag these tests risky: they execute code in classes not in their @Covers list.
- SignaleringWidgetsTest also instantiates MyTasksWidget + TaskRemindersWidget
- ZgwZrcRulesServiceTest exercises rules logic inherited from ZgwRulesBase
- ZgwAuthMiddlewareTest constructs a ZgwAuthException
Declare them so the suite is clean under coverage (no behaviour change).
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ d305346

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/75 statements)


Quality workflow — 2026-05-12 10:36 UTC

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 69b186b

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/75 statements)

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 10:53 UTC

Download the full PDF report from the workflow artifacts.

The Playwright suite hit bare paths (/apps/procest, /login) which the CI's
'php -S' (no rewrite, no router script) can't route — it served the app
directory listing / 404 instead of Nextcloud, so the SPA never mounted and
every UI assertion failed with 'element not found'. Use /index.php/... paths
(matches mydash's working pattern); update expected nav hrefs accordingly.
Also declare the {path} param on DashboardController::page() that the
existing SPA catch-all route already binds.
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 664143e

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/75 statements)

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 11:12 UTC

Download the full PDF report from the workflow artifacts.

… seed

- navigation 'settings button is visible': getByText('Settings') matched
  Nextcloud's user-menu items ('Personal settings', 'Administration
  settings') — scope to the app sidebar instead.
- Revert the 5 case + 2 voorstel seed objects: OpenRegister's importer does
  not resolve slug references in seed-object data (it validates the literal
  slug against format:uuid) and aborts the whole import on the first
  failure, so the new objects only moved the abort earlier (0 vs 4 objects
  imported). The procest seed-data <-> OR-importer mismatch is tracked
  separately.
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ fe19ff2

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/75 statements)

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 11:27 UTC

Download the full PDF report from the workflow artifacts.

…tings e2e locators

- procest_register.json: the 3 parafeeractie seed objects reference
  voorstel-collegeadvies-0042/0055 — voorstel objects that aren't seeded.
  OpenRegister's importer validates the literal slug against format:uuid,
  can't resolve it, and aborts the whole config import — *before* the
  caseType objects (which come after them in the array) get imported. Drop
  them so the register, schemas and the 4 caseType objects import (the rest
  of the cross-referenced seed data still fails further down — tracked
  separately for an OR seed-importer fix).
- pages.spec.ts: scope the Work Queue KPI assertions to .werkvoorraad__kpis
  (bare getByText('Open Cases') also hit the empty-state copy) and scope the
  Settings schema-field assertions to .settings-form.
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 0df4850

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/75 statements)

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 11:43 UTC

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 15ac3a6

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/75 statements)

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 11:53 UTC

Download the full PDF report from the workflow artifacts.

…placeholder

- My Work filter tabs are <button role="tab">All (n)</button> — getByRole('button')
  never matched them; use getByRole('tab').
- The Tasks list-view search input is CnIndexSidebar's, placeholder
  'Type to search...' (lib default) — not 'Search tasks'.
…locators; match 'Add <Schema>' button label

Verified against the local Nextcloud env (browser):
- Navigating to .../apps/procest (no trailing slash) leaves vue-router's
  history-mode location empty so the '/' route never resolves and the
  dashboard renders an empty router-view — append the slash. Bumped the
  Dashboard / New Case timeouts to 15s for CI's slower env.
- The 'New Case' modal is procest's custom CaseCreateDialog (.case-create-dialog);
  scope the heading/combobox/field assertions to it so the case-type combobox
  doesn't collide with the sidebar's 'Case type' filter combobox.
- CnIndexPage labels the create button 'Add <SchemaTitle>' (Add Case / Add Task)
  when the schema title resolves, 'Add Item' otherwise — match either.
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 0421188

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/75 statements)

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 12:16 UTC

Download the full PDF report from the workflow artifacts.

@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 09e437c

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/75 statements)

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 12:36 UTC

Download the full PDF report from the workflow artifacts.

… the dashboard via sidebar click

The previous commit's trailing slash broke the navigation/smoke tests — php -S
treats '/index.php/apps/procest/' as a directory-index request and 404s. Back
to '/index.php/apps/procest'. For the dashboard test, land on /cases (which
resolves) and click the Dashboard sidebar link so vue-router transitions
client-side instead of doing a bare GET of the app root.
…slint-stylelint-baseline

# Conflicts:
#	tests/bootstrap.php
@rubenvdlinde rubenvdlinde merged commit 0dc88c8 into development May 12, 2026
19 of 22 checks passed
@rubenvdlinde rubenvdlinde deleted the chore/phpcbf-eslint-stylelint-baseline branch May 12, 2026 14:22
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/procest @ 0eb66a6

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm ✅ 419/419
PHPUnit
Newman ⏭️
Playwright

Coverage: 0% (0/81 statements)

Spec coverage: 5% (21 tests / 456 specs)


Quality workflow — 2026-05-12 14:28 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant