chore(#122): fix real Psalm type issues + enable findUnusedCode (PR B)#134
Merged
Conversation
PR B of the Psalm baseline burndown. Fixes all 34 real type findings so the type-issue baseline drops to zero, then turns on findUnusedCode. Type fixes: - 8 IEventListener listeners get @template-implements IEventListener<Event> - LifecycleService restore-result @return shapes reconciled (add pad_id?) - PadCreationService::createFromUrl @return gains snapshot_warning_code?; withCreateRollback action closure return hint dropped so the templated return type carries the precise shape - ExternalPadExportFetcher::getPublicTextFromResolvedExternalPad @param widened to the full resolved shape (origin/pad_id were rejected) - Viewer/PublicViewer ErrorMapper: parenthesize callable return union - EtherpadHealthCheckService latency math uses float literal - ConsistencyCheckService / AdminController: drop redundant is_array guards - PublicShareUrlBuilder: remove genuinely-dead '' branches (trimmed path) - Preview/Application/PadFileCreator/ExternalPadExportFetcher: targeted @psalm-suppress with rationale where Psalm can't model runtime (OCP\Image not in ocp stubs, Files-app event, curl write-callback mutation, basename('/') === '') findUnusedCode: - Enabled in psalm.xml - Entry points (controllers, listeners, migrations, settings, jobs, hooks, preview, Application) annotated @psalm-api so Psalm roots from them - Removed real dead code surfaced: 5 unused local inits, 1 unused param (buildProtectedRestorePadName), 1 unnecessary @var - Remaining findings are NC DI/entry-point false positives (constructors with no literal `new`, repair-step internals reached only via run()); captured in psalm-baseline.xml so new dead code is still caught composer psalm green; 409 PHPUnit tests pass.
Jaggob
added a commit
that referenced
this pull request
Jun 9, 2026
Bump version to 1.1.0-alpha.3 across appinfo/info.xml, package.json, and package-lock.json (consistency guard green); regenerate js/ license sidecars with the new version (bundles unchanged). Add the alpha.3 CHANGELOG section summarising the security hardening (#105, #102, #110), the Playwright e2e suite (#54), the Psalm burndown + findUnusedCode (#82, #122, #133, #134), and the supporting refactors/tooling.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR B of the Psalm baseline burndown (#122). Companion to the already-merged PR A (#133, noise reduction). Brings the type-issue baseline to zero and turns on
findUnusedCode.Type fixes (all 34 real findings)
@template-implements IEventListener<Event>(MissingTemplateParam)LifecycleServicerestore-result@returnshapes reconciled (pad_id?added) sobuildSkippedResultassigns cleanlyPadCreationService::createFromUrl:@returngainssnapshot_warning_code?; dropped the action-closure: arrayhint sowithCreateRollback's templated return carries the precise shapeExternalPadExportFetcher::getPublicTextFromResolvedExternalPad:@paramwidened to the full resolved shape (origin/pad_idwere being rejected)Viewer/PublicViewerErrorMapper: parenthesized thecallable(): (A|B)return union (precedence bug)EtherpadHealthCheckService: latency math uses a float literal (strict binary operands)ConsistencyCheckService/AdminController: dropped redundantis_arrayguardsPublicShareUrlBuilder: removed genuinely-dead''branches (path is already trimmed)@psalm-suppresswith rationale where Psalm can't model runtime:OCP\Image(not innextcloud/ocpstubs), the Files-appLoadAdditionalScriptsEvent, the curl write-callback mutation of$sizeExceeded, andbasename('/') === ''findUnusedCode
psalm.xmlApplication) annotated@psalm-apiso Psalm roots traversal from thembuildProtectedRestorePadName), 1 unnecessary@varnew; repair-step internals reached only viarun()). Captured inpsalm-baseline.xmlso new dead code is still caught.Verification
composer psalm✅ green (0 unbaselined issues)