style(notifier): fix two phpcs errors that landed on development - #2882
Conversation
#2864 merged while its `PHP Quality (phpcs)` cell was red, so `development` now carries both: * an inline IF — the display-name fallback ternary * a positional call to `displayName()` Neither is a behaviour change; both block every subsequent PR's phpcs cell until they are gone, which is why this is its own small PR rather than a follow-up. 🔑 I had reported this file clean. The run was real and described an earlier version of it: I ran phpcs, then made two more edits to localise the rich strings, and never re-ran. A check that ran before the last edit is not a check on what shipped. Reproduced, fixed, re-verified: phpcs, phpmd and phpstan clean on lib/Notification; 20 tests / 42 assertions green.
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-26 23:09 UTC
Download the full PDF report from the workflow artifacts.
|
Confirming your diagnosis from the other side, and naming what is actually blocking this PR now — it is not the phpcs errors. development is genuinely broken
return ($name === '' ? $uid : $name);so every openregister PR fails its Worth adding for the record on how #2864 got in: it was merged at
What is blocking THIS PRNot phpcs — that passes. The failing step is That is a catch-22 rather than a real regression. Satisfying return ($name === '' ? $uid : $name);into a 3-statement Two ways out
I would rather not push to your branch. If you would like me to take option 1, say so and I will open it against |
The coverage ratchet failed this PR on a 0.09% drop, and it was right. Turning
the fallback ternary into an explicit early return took the file from 182
statements to 184, and one of the two new ones — `return \$uid` when the display
name is blank — had nothing exercising it.
Two branches now do:
* a BLANK display name falls back to the uid. Nextcloud permits an empty
display name, and an empty one here reads as " asks to act on your behalf" —
a security decision with no subject in it. The uid is poorer copy and it is
always a name for somebody.
* NO user manager at all. The collaborator is nullable so the existing
hand-built construction keeps binding, and that is only safe if the null path
is exercised — an untested optional dependency is one whose absence is
discovered in production.
A 0.09% drop is small enough to wave through and was a real gap. 12 tests / 28
assertions.
|
The two code hunks already landed; the TEST is what this PR is now for. #2885 (commit
Verified against What #2885 did not add is I have updated this branch onto |
|
Correction to the comment above: the branch update FAILED — GitHub returned That is expected on reflection: both this branch and #2885 rewrote the same two lines, so the merge cannot resolve itself. Resolving it now and will push. |
…ister into pr2882 # Conflicts: # lib/Notification/Notifier.php
|
Resolved and pushed. The conflict is gone and the diff is now the test alone.
Run against development's |
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.
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:34 UTC
Download the full PDF report from the workflow artifacts.
#2864 merged while its
PHP Quality (phpcs)cell was red, sodevelopmentnow carries both errors. They block every subsequent PR's phpcs cell until they are gone, which is why this is its own small PR rather than a follow-up on a larger one.Notifier.php:89Notifier.php:281displayName()Neither is a behaviour change.
🔑 Why I reported this file clean
The run was real, and it described an earlier version of the file. I ran phpcs on
lib/Notification, then made two more edits to localise the rich subject and message, and never re-ran it. A check that ran before the last edit is not a check on what shipped — it is a check on something else that happened to have the same path.Verified after the fact against
development's own copy of the file (fetched via the contents API and run through phpcs) rather than against my working tree, so the claim is about what actually merged.phpcs, phpmd and phpstan clean on
lib/Notification; 20 tests / 42 assertions green.🤖 Generated with Claude Code