fix(notifier): two coding-standard errors phpcs refuses - #2890
fix(notifier): two coding-standard errors phpcs refuses#2890rubenvdlinde wants to merge 2 commits into
Conversation
`lib/Notification/Notifier.php` carries the only two phpcs ERRORS in the tree
(75 files scanned, one E). They surfaced on an unrelated PR that touches nothing
but `.github/dependabot.yml`, which is how I know they are the tree's and not
that change's.
line 89 Inline IF statements are not allowed
`return ($name === '' ? $uid : $name);` -> an explicit early return
line 285 All arguments in calls to internal code must use named arguments
`$this->displayName($principal)` -> `$this->displayName(uid: $principal)`
The second is the file disagreeing with itself: every other internal call in it
already uses named arguments (`prepareConfigurationUpdate(notification: …, l: …)`
and its five neighbours). This one call was the exception.
Verified by running the tool rather than reading the rule: `vendor/bin/phpcs
lib/Notification/Notifier.php` exits 0, and `php -l` reports no syntax errors.
|
Already on Both hunks landed in #2885 (commit
Verified on
Not closing it myself in case this branch is still open in another session. |
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| composer | ✅ | ✅ 175/175 | |||
| npm | ✅ | ✅ 545/545 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ❌ | ||||
| Newman | ✅ | ||||
| Playwright | ✅ | ||||
| Hydra gates | ✅ |
Quality workflow — 2026-08-27 00:27 UTC
Download the full PDF report from the workflow artifacts.
The coding-standard fix expands an inline ternary into an if/return, which
phpcs requires ('Inline IF statements are not allowed'). That adds two
statements to Notifier.php, and the coverage guard failed the PR for adding
uncovered code -- correctly: no test exercised the branch.
This covers it, and the branch turns out to matter. With the fallback removed
the prompt renders 'X asks to act on your behalf' with an empty string where
the person should be -- a hole in the sentence rather than a bare uid. The
test was verified to FAIL against that broken version before being committed.
Asserts with a whitespace-only display name, not the empty string, so that
dropping the trim() would also be caught.
Quality Report — ConductionNL/openregister @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-specs | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| composer | ✅ | ✅ 175/175 | |||
| npm | ✅ | ✅ 545/545 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| PHPUnit | ✅ | ||||
| Newman | ✅ | ||||
| Playwright | ✅ | ||||
| Hydra gates | ✅ |
Quality workflow — 2026-08-27 01:37 UTC
Download the full PDF report from the workflow artifacts.
|
Now fully superseded — safe to close. #2882 merged, and it carried both of this PR's hunks plus a
Verified by content on Leaving the close to whoever owns the branch rather than doing it from here. |
|
Superseded by #2882, which landed the same two phpcs fixes on development together with an equivalent blank-display-name regression test. Nothing here is left to merge — closing rather than resolving the conflict against a tree that already contains the change. |
lib/Notification/Notifier.phpcarries the only two phpcs errors in the tree — 75 files scanned, oneE.They surfaced on an unrelated PR (#2884) that touches nothing but
.github/dependabot.yml, which is how I know they belong to the tree rather than to that change.return ($name === '' ? $uid : $name);→ an explicit early return$this->displayName($principal)→$this->displayName(uid: $principal)The second is the file disagreeing with itself: every other internal call in it already uses named arguments —
prepareConfigurationUpdate(notification: …, l: …)and its five neighbours. This one call was the exception, so the fix restores the file's own convention rather than imposing a new one.Verification
Ran the tool rather than reading the rule:
vendor/bin/phpcs lib/Notification/Notifier.phpexits 0, andphp -lreports no syntax errors.🤖 Generated with Claude Code