fix(quality): psalm and phpstan read two OpenRegister runtime types as errors - #2087
Merged
Merged
Conversation
…s errors psalm could not see OCA\OpenRegister\Event\RegistrySubscriptionRequestedEvent, which Application registers a lazy service listener for and the listener itself checks with instanceof. Its five sibling events are already named in the UndefinedClass suppression list for the same reason, so it joins them. phpstan reported three unresolvable types with the same root cause one layer on. MailIntakeService::intake() and ForwardService::forward() both return OCA\OpenRegister\Db\ObjectEntity, so getObject() on the result is an error type and the JSON payload built from it cannot resolve; IntakeRoutingService fills its rule list from the same call and usort over it reads the same way. Both are scoped to the named files, beside the nine paths already listed for this effect, rather than silencing the identifier across the tree. No lib/ file changes. psalm: no errors, was 2. phpstan: no errors, was 3.
rubenvdlinde
requested review from
Rem-Dam,
SudoThijn,
WilcoLouwerse,
bbrands02,
remko48 and
rjzondervan
as code owners
September 19, 2026 11:07
Contributor
Quality Report — ConductionNL/integriq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ❌ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ❌ | ||||
| format | ❌ | ||||
| check-schema-l10n | ❌ | ||||
| check-l10n-js | ✅ | ||||
| composer | ✅ | ✅ 141/141 | |||
| npm | ✅ | ✅ 545/545 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ⏭️ not run for this diff — no file in this diff matches the code globs, and none carries a source extension — the heavy tier has nothing to decide about it. | ||||
| Newman | ✅ | ||||
| Playwright | ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it on any branch from the Actions tab, or locally with npx playwright test. |
||||
| Hydra gates | ❌ | ||||
| Hydra gates (axe) | ✅ |
Quality workflow — 2026-09-19 11:12 UTC
Download the full PDF report from the workflow artifacts.
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.
What was wrong
Two analysers were red on
development, and both failures had the same root:a type that exists only when OpenRegister is installed.
psalm reported
UndefinedClasstwice forOCA\OpenRegister\Event\RegistrySubscriptionRequestedEvent, once whereApplicationregisters a lazy service listener for it and once where thelistener checks it with
instanceof. Its five sibling events(
ObjectCreatedEvent,ObjectUpdatedEvent,ObjectDeletedEventand the two...ingEvents) are already named in theUndefinedClasssuppression list forexactly that reason.
phpstan reported three
argument.unresolvableTypeerrors, which is the samelimitation one layer on.
MailIntakeService::intake()andForwardService::forward()both returnOCA\OpenRegister\Db\ObjectEntity, sogetObject()on the result resolves to an error type and the wholenew JSONResponse($data)argument reads as unresolvable.IntakeRoutingService::firstMatchingRule()fills its rule list from the samecall, so
usortover that array reads the same way.What changed
Configuration only. No file under
lib/is touched.psalm.xmlnamesRegistrySubscriptionRequestedEventbeside its fivesiblings, with the reason written out.
phpstan.neonaddsMailIntakeControllerandOutboundLogControllerto theJSONResponseunresolvable-type block that already lists nine paths for thiseffect, and adds a
usortentry scoped tolib/Intake/IntakeRoutingService.php.Both are scoped to named files rather than silencing the identifier across the
tree, which is the rule the existing block states: "every path listed here
references
OCA\OpenRegister; re-check that before adding another." Checked:all three do, by return type.
Verified
./vendor/bin/psalm --threads=1 --no-cache: no errors. It was 2../vendor/bin/phpstan analyse --memory-limit=1G: no errors. It was 3.usortpatternmatched a real error rather than sitting dead.
Inherited, reported not fixed
phpcs (482 errors), phpmd (123 findings), prettier (18 files),
test:l10n(4 strings),check:schema-l10n(261 over baseline) and five hydragates are all red on
developmentindependently of this change. Each is itsown PR in this sweep.
🤖 Generated with Claude Code