You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(apphost): make the prelude branch-free and declare OC_App to psalm
Two CI findings on the prelude, both real:
1. psalm UndefinedClass on \OC_App. It is Nextcloud's server-private legacy
bootstrap class, absent from nextcloud/ocp, and there is no OCP interface
for registering another app's autoloader. Declared as a suppressed
referencedClass in psalm.xml, the same way doriath declares it.
2. The coverage ratchet. `return true` after the call plus `return false` in
the catch gave the method a branch that NO environment can exercise both
sides of — whichever runs, the other is dead in that run — so the class
could never reach full line coverage. No caller ever consumed the return
value either: what callers depend on is the class_exists() guard that
follows the call. The method is now void with a single statement in the
try and a comment-only catch, so every executable line runs in every
environment.
The tests now assert the two things that are actually observable: that control
returns to the caller at all (a Throwable escaping would fail the test, and in
production would abort the whole register()), and that a second call does not
stack another autoloader.
phpmd StaticAccess on the new composition-root call is documented on the
calling method rather than baselined.
0 commit comments