Skip to content

fix(php): OR-API conformance for Wave-2 ADR-031 exceptions + missing CoursePublishGuard - #42

Merged
rubenvdlinde merged 1 commit into
developmentfrom
feature/wedge/php-conformance
May 12, 2026
Merged

fix(php): OR-API conformance for Wave-2 ADR-031 exceptions + missing CoursePublishGuard#42
rubenvdlinde merged 1 commit into
developmentfrom
feature/wedge/php-conformance

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

  • AuditPackExportController: replace non-existent AuditTrailService::query/verifyChain/getCurrentTenantId with real OR classes (AuditTrailMapper::findAll, AuditHashService::verifyChain, IConfig::getSystemValue); HMAC chain verification done inline (acceptable per ADR-031 "document generation" exception)
  • CredentialIssuanceHandler + CredentialVerifyController: getObject(register:,schema:,uuid:) does not exist on ObjectService; corrected to find(id:, register:, schema:) which returns ObjectEntity
  • XapiCompletionHandler + Application.php: OCA\OpenRegister\Event\XapiStatementReceivedEvent does not exist in OR; replaced with ObjectCreatedEvent; handler filters to XapiStatement schema/register and reads payload via getObject()->jsonSerialize()
  • CoursePublishGuard (new): lib/Lifecycle/CoursePublishGuard.php — guards Course publish transition; requires at least one published Lesson via ObjectService::findAll
  • HealthController (pre-existing fix): wrong OCP\IAppManager namespace corrected to OCP\App\IAppManager
  • phpstan.neon: added has invalid type OCA\OpenRegister\ ignore pattern

Test plan

  • phpcs lib/ passes — verified locally (0 errors)
  • phpstan analyse lib/ -c phpstan.neon passes — verified locally (0 errors)
  • php -l clean on all 9 touched files
  • Verify CoursePublishGuard is wired correctly in scholiq_register.json Course schema publish transition
  • Integration: complete all lessons on an enrolment, confirm CredentialIssuanceHandler fires and creates Credential via ObjectService::saveObject

…CoursePublishGuard

- AuditPackExportController: replace fictional AuditTrailService::query/verifyChain/getCurrentTenantId with AuditTrailMapper::findAll + AuditHashService::verifyChain + IConfig::getSystemValue; inline regulation filter over changed field
- CredentialIssuanceHandler: getObject(register:,schema:,uuid:) → find(id:,register:,schema:) returning ObjectEntity
- CredentialVerifyController: same getObject → find fix; remove redundant instanceof branch
- XapiCompletionHandler: replace non-existent XapiStatementReceivedEvent with ObjectCreatedEvent; getData() → getObject()->jsonSerialize(); add register/schema filter guard
- Application.php: update event registration to ObjectCreatedEvent::class
- CoursePublishGuard: create new guard for Course publish transition; checks at least one published Lesson exists via ObjectService::findAll
- HealthController: fix OCP\IAppManager → OCP\App\IAppManager (pre-existing wrong namespace)
- phpstan.neon: add 'has invalid type OCA\OpenRegister\' ignore pattern for OR dependency gap
@rubenvdlinde
rubenvdlinde merged commit 90e752e into development May 12, 2026
26 of 35 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/scholiq @ 00ce04d

Check PHP Vue Security License Tests
lint
phpcs
phpmd
psalm
phpstan
phpmetrics
eslint
stylelint
composer ✅ 100/100
npm
PHPUnit ⏭️
Newman ⏭️
Playwright ⏭️

Quality workflow — 2026-05-12 05:28 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant