Skip to content

chore: sync canonical root configs + mechanical phpmd cleanup#849

Merged
rubenvdlinde merged 1 commit into
developmentfrom
chore/sync-canonical-root-configs
May 21, 2026
Merged

chore: sync canonical root configs + mechanical phpmd cleanup#849
rubenvdlinde merged 1 commit into
developmentfrom
chore/sync-canonical-root-configs

Conversation

@rubenvdlinde
Copy link
Copy Markdown
Contributor

Summary

Phase 2 fleet root-config consolidation for openconnector. Pattern from shillinq#300 (merged) and decidesk#243 (merged). Canonical lives in nextcloud-app-template.

openconnector is uniquely a "phpstan turned on for the first time" PR in this rollout — see the large baseline below.

Changes

Canonical configs synced

  • phpcs.xml (cosmetic name → OpenConnector; ~30 silent <severity>0</severity> PEAR overrides gone)
  • phpmd.xml (cosmetic name → OpenConnector)
  • psalm.xml (replaces a 20-line stub with the full 127-line canonical ruleset)
  • phpstan.neon, phpstan-bootstrap.php, phpstan-baseline.neon (new — phpstan was previously not running here at all)
  • phpcs-custom-sniffs/CustomSniffs/Sniffs/Commenting/SpecTagSniff.php (new)

Composer fleet-consistency fix

  • composer.json config.platform.php: "8.3""8.2". The rest of the fleet pins 8.1, but openconnector requires 8.2+ via php-soap/ext-soap-engine8.2 is the lowest realistic floor that lets composer install work on the standard dev/CI hosts. composer.lock regenerated; side-effect rolls azjezz/psl off its 4.3.0 8.3-only typed-class-constant syntax.

Mechanical PHPMD cleanups

  • PdokConnector::suggest/free: $q$query (5 sites). Controller route bindings deliberately left as $q because Nextcloud binds query params by parameter name.
  • PdokConnector::orLookup/writeThrough: $or$objectService.
  • IBabsConnectorService::pushVoorstel: removed UnusedLocalVariable $organisatieId from placeholder body.
  • ExportService::export: added unreachable return new JSONResponse() after #[NoReturn] $this->download() (JetBrains attribute not natively understood by phpstan).

Auto-fix

phpcbf fixed 575 violations across 64 files (brace placement, spacing, comment style — categories the removed PEAR overrides were masking).

Gate counts

Gate Before (initial) After Notes
PHPCS 5 406 err / 806 warn 4 756 err / 798 warn ignore_warnings_on_exit=1 — warnings logged not failed
PHPMD 22 lines 17 lines 5 mechanical fixes; remainder is architectural
PSALM 520 issues 150 err + 520 other Canonical ruleset landed cold
PHPSTAN 820 errors 0 (with 818 baseline) First time phpstan ran here

Tracking issue

Burndown of the absorbed lint debt: #848

Test plan

  • ./vendor/bin/phpcs --standard=phpcs.xml --report=summary — runs, 4 756/798 logged
  • ./vendor/bin/phpstan analyse --memory-limit=2G --no-progress[OK] No errors
  • ./vendor/bin/psalm --threads=1 --no-cache --show-info=false --no-progress — completes, count noted in tracking issue
  • ./vendor/bin/phpmd lib text phpmd.xml — 17 lines, categories listed in tracking issue
  • CI gates (phpcs / phpstan / psalm / phpmd) will green or noisy-but-non-failing per ruleset config

🤖 Generated with Claude Code

Phase 2 fleet root-config consolidation. Pattern from shillinq#300 and decidesk#243.

Canonical files synced from nextcloud-app-template:
- phpcs.xml (cosmetic name → OpenConnector)
- phpmd.xml (cosmetic name → OpenConnector)
- psalm.xml (replaces 20-line stub with full 127-line ruleset)
- phpstan.neon, phpstan-bootstrap.php (new — phpstan was previously not running here)
- phpcs-custom-sniffs/CustomSniffs/Sniffs/Commenting/SpecTagSniff.php (new)

Composer fleet-consistency fix:
- composer.json config.platform.php: "8.3" → "8.2" (the rest of the
  fleet pins 8.1; openconnector requires 8.2+ via php-soap, so 8.2
  is the floor). composer.lock regenerated; rolls azjezz/psl back
  off its 8.3-only typed-class-constant syntax.

Mechanical phpmd fixes:
- PdokConnector::suggest/free $q → $query (internal helpers; controller
  route bindings left intact since Nextcloud binds query params by name).
- PdokConnector::orLookup/writeThrough $or → $objectService.
- IBabsConnectorService::pushVoorstel removed UnusedLocalVariable
  $organisatieId from placeholder body.
- ExportService::export unreachable `return new JSONResponse()` after
  `#[NoReturn] $this->download()` — JetBrains attribute not natively
  understood by phpstan.

phpcbf auto-fix: 575 violations across 64 files (brace placement,
spacing, comment style — categories the previous ~30 silent
`<severity>0</severity>` PEAR overrides were masking).

Gate counts after sync:
- PHPCS:   4 756 errors / 798 warnings (was 5 406 / 806)
- PHPMD:   17 lines (was 22)
- PSALM:   150 errors + 520 other issues (canonical ruleset landed cold)
- PHPSTAN: 0 errors with 818-entry baseline (was 820 raw)

Burndown tracked: #848

Notable: openconnector is the only fleet app where phpstan is turned
on for the first time by this PR; the baseline therefore carries the
full pre-existing static-analysis debt of `lib/` as tracked items
rather than newly-introduced regressions.
@rubenvdlinde rubenvdlinde merged commit 32239ab into development May 21, 2026
11 of 15 checks passed
@rubenvdlinde rubenvdlinde deleted the chore/sync-canonical-root-configs branch May 21, 2026 20:46
@github-actions
Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openconnector @ 6c19f26

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

Quality workflow — 2026-05-21 20:48 UTC

Download the full PDF report from the workflow artifacts.

rubenvdlinde added a commit that referenced this pull request May 22, 2026
Resolves 30-file conflict between i18n's Tier-4 refactor (OR-adoption +
PHPCS docblock harmonisation + manifest v2 schema URL flip) and the 9
commits dev accumulated independently (#823 LogIndex wrapper, #842
.php-cs-fixer cleanup, #849 root-config sync + phpmd cleanup, #727
cross-entity slug refs, #752 PDOK adapter, #762 brand cobalt, #767
specter spec, #703 .gitignore harmonise, #679 openspec sync workflows).

Resolution strategy:
- 17 DU conflicts (Db classes + ExportService) — confirmed i18n's
  deletions (Tier-4 OR-adoption: data moved off bespoke Db/ classes
  to OR-backed objects).
- l10n/en.json + l10n/nl.json — took HEAD's union (translation work
  was done on i18n).
- composer.lock — took HEAD's (i18n had it regenerated for new deps).
- src/manifest.json — took HEAD (v2 schema URL + 2-space indent + the
  typed-primitive page shapes; whitespace-only conflict otherwise).
- 8 UU conflicts on PHP controllers/services + routes.php + registry.js
  — took HEAD (i18n). The systematic pattern: i18n calls the new OR
  API (->getObject()) while dev still references the now-deleted Db
  classes (->jsonSerialize()). Dev's references would break at
  runtime against i18n's structural state; HEAD is the only
  internally-consistent resolution.

All conflict-resolved files: 0 markers remaining, PHP syntactically
valid. Manifest still validates clean against v2 schema 2.7.0.
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