chore(quality): drive procest to 0 phpcs + phpstan + psalm; baseline phpmd; REUSE.toml#261
Merged
rubenvdlinde merged 15 commits intodevelopmentfrom Apr 20, 2026
Merged
chore(quality): drive procest to 0 phpcs + phpstan + psalm; baseline phpmd; REUSE.toml#261rubenvdlinde merged 15 commits intodevelopmentfrom
rubenvdlinde merged 15 commits intodevelopmentfrom
Conversation
…ntController, PublicAppointmentController)
…-if, empty() explicit, doc-blocks)
…, Checklist, CaseSharing, Consultation, ZgwZrc)
Adds a nullable pass-through to resolve OpenRegister's ObjectService from the DI container. Mirrors the lazy-resolve pattern already used for ConfigurationService — OpenRegister is an optional runtime dependency so the class can't be type-hinted directly in the constructor. Eliminates ~20 phpstan/psalm 'undefined method' errors across services that already had null-checked call sites (CaseEmailService, ConsultationService, DsoIntakeService, MilestoneService, TemplateLibraryService).
- CaseDefinitionController: use is_array() guard on getUploadedFile() return value (real NC impl returns array|null despite OCP stub). - AppointmentService::getBackend: drop redundant ?? on non-nullable getConfigValue() return; explicit empty-string fallback for backend type. - MilestoneService::getCaseProgress: delete dead else branch — early return above guarantees $definitions is non-empty. - TenantMiddleware: remove invalid '@throws Response' (not a Throwable). - StufController::soapResponse: add @phpstan-param narrowing to Http::STATUS_* union for DataDisplayResponse status code.
Each ignore has an inline comment explaining why the rule is off-target: phpstan.neon: - IRequest::getContent() / setParameter(): exist in NC Request impl but missing from nextcloud/ocp interface stub. - IMessage::attachFile(): implemented in NC Mail\Message, not on OCP stub. - OC_Util::getVersionString: method_exists() guarded compat check. - 'Property never read, only written': DI-held services kept for future handlers and constructor signature stability. - 'Constant unused': documented defaults. - IRequest::getUploadedFile() strict-comparison: stub promises array but real impl returns array|null — keep the runtime guard. psalm.xml: - OC_Util UndefinedClass: version-compat. - DOMNode::getElementsByTagName UndefinedMethod: DOMNode narrows to DOMElement at runtime; psalm can't track the downcast. - UnusedParam in lib/Service: interface-contract params and planned-feature hooks kept for API stability.
Freezes 287 pre-existing PHPMD findings (159 ElseExpression, 93 MissingImport, 32 Avoid*, 3 Remove*) as architectural debt rather than fixing case-by-case. Future violations will fail the gate. Updates composer.json's 'phpmd' script to load the baseline file.
Declares SPDX copyright/licence for PHP (EUPL-1.2), JS/Vue/CSS (EUPL-1.2), and data/docs/locked-files (CC0-1.0) without touching individual source files (per ADR-014: PHP uses @author/@copyright/@license docblocks).
Contributor
Quality Report — ConductionNL/procest @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ❌ | ||||
| composer | ✅ | ✅ 100/100 | |||
| npm | ❌ | ❌ | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-04-20 08:15 UTC
Download the full PDF report from the workflow artifacts.
# Conflicts: # lib/BackgroundJob/AppointmentReminderJob.php # lib/BackgroundJob/BerichtenboxReadStatusJob.php # lib/Controller/AppointmentController.php # lib/Controller/BerichtenboxController.php # lib/Controller/CaseDefinitionController.php # lib/Controller/ConsultationController.php # lib/Controller/EmailController.php # lib/Controller/InspectionController.php # lib/Controller/LegesController.php # lib/Controller/MetricsController.php # lib/Controller/MilestoneController.php # lib/Controller/ParaferingController.php # lib/Controller/StufController.php # lib/Controller/TemplateController.php # lib/Service/AiService.php # lib/Service/AppointmentBackend/JccBackend.php # lib/Service/AppointmentBackend/QmaticBackend.php # lib/Service/AppointmentService.php # lib/Service/BerichtenboxService.php # lib/Service/CaseDefinitionExportService.php # lib/Service/CaseDefinitionImportService.php # lib/Service/CaseEmailService.php # lib/Service/ChecklistService.php # lib/Service/ConsultationService.php # lib/Service/DsoIntakeService.php # lib/Service/LegesCalculationService.php # lib/Service/LegesExportService.php # lib/Service/MilestoneService.php # lib/Service/ParaferingService.php # lib/Service/StufFieldMappingService.php # lib/Service/StufMessageBuilder.php # lib/Service/ZgwZrcRulesService.php
Contributor
Quality Report — ConductionNL/procest @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ❌ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ❌ | ||||
| stylelint | ❌ | ||||
| composer | ✅ | ✅ 100/100 | |||
| npm | ❌ | ❌ | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-04-20 08:35 UTC
Download the full PDF report from the workflow artifacts.
rubenvdlinde
added a commit
that referenced
this pull request
Apr 20, 2026
…phpmd; REUSE.toml (#261) * chore(quality): phpcbf auto-fixes (1147 violations) * chore(quality): phpcs fixes for small files (named-params, inline-if, file-docs) * chore(quality): phpcs fixes in Controllers (StufController, AppointmentController, PublicAppointmentController) * chore(quality): phpcs fixes for all Controllers (named-params, inline-if, empty() explicit, doc-blocks) * chore(quality): phpcs fixes for AiService, AppointmentService, BerichtenboxService * chore(quality): phpcs fixes for appointment backends and mock adapter * chore(quality): phpcs fixes for small/mid services (DsoIntake, Tenant, Checklist, CaseSharing, Consultation, ZgwZrc) * chore(quality): phpcs fixes for Stuf/Milestone/Parafering/LegesCalculation services * chore(quality): phpcs fixes for remaining services — zero phpcs errors * fix(quality): add SettingsService::getObjectService() pass-through Adds a nullable pass-through to resolve OpenRegister's ObjectService from the DI container. Mirrors the lazy-resolve pattern already used for ConfigurationService — OpenRegister is an optional runtime dependency so the class can't be type-hinted directly in the constructor. Eliminates ~20 phpstan/psalm 'undefined method' errors across services that already had null-checked call sites (CaseEmailService, ConsultationService, DsoIntakeService, MilestoneService, TemplateLibraryService). * fix(quality): real phpstan bug fixes across controllers and services - CaseDefinitionController: use is_array() guard on getUploadedFile() return value (real NC impl returns array|null despite OCP stub). - AppointmentService::getBackend: drop redundant ?? on non-nullable getConfigValue() return; explicit empty-string fallback for backend type. - MilestoneService::getCaseProgress: delete dead else branch — early return above guarantees $definitions is non-empty. - TenantMiddleware: remove invalid '@throws Response' (not a Throwable). - StufController::soapResponse: add @phpstan-param narrowing to Http::STATUS_* union for DataDisplayResponse status code. * chore(quality): phpstan/psalm framework-drift suppressions with reasons Each ignore has an inline comment explaining why the rule is off-target: phpstan.neon: - IRequest::getContent() / setParameter(): exist in NC Request impl but missing from nextcloud/ocp interface stub. - IMessage::attachFile(): implemented in NC Mail\Message, not on OCP stub. - OC_Util::getVersionString: method_exists() guarded compat check. - 'Property never read, only written': DI-held services kept for future handlers and constructor signature stability. - 'Constant unused': documented defaults. - IRequest::getUploadedFile() strict-comparison: stub promises array but real impl returns array|null — keep the runtime guard. psalm.xml: - OC_Util UndefinedClass: version-compat. - DOMNode::getElementsByTagName UndefinedMethod: DOMNode narrows to DOMElement at runtime; psalm can't track the downcast. - UnusedParam in lib/Service: interface-contract params and planned-feature hooks kept for API stability. * chore(quality): phpmd baseline for pre-existing architectural findings Freezes 287 pre-existing PHPMD findings (159 ElseExpression, 93 MissingImport, 32 Avoid*, 3 Remove*) as architectural debt rather than fixing case-by-case. Future violations will fail the gate. Updates composer.json's 'phpmd' script to load the baseline file. * chore(licence): add REUSE.toml for repo-level REUSE compliance Declares SPDX copyright/licence for PHP (EUPL-1.2), JS/Vue/CSS (EUPL-1.2), and data/docs/locked-files (CC0-1.0) without touching individual source files (per ADR-014: PHP uses @author/@copyright/@license docblocks).
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.
Summary
Drives the
procestquality gates to zero on phpcs, phpstan, and psalm; baselines phpmd's 287 pre-existing architectural findings; adds a repo-level REUSE.toml.Gate counts (before → after)
Real bug fixes
lib/Controller/CaseDefinitionController.php:127,159—getUploadedFile()null-guard switched tois_array()(real NC impl returnsarray\|null, OCP stub docblock is wrong).lib/Service/AppointmentService.php:250-252— dropped redundant?? ''on non-nullablegetConfigValue(); explicit empty-string fallback for the backend type.lib/Service/MilestoneService.php:141-145— deleted deadelsebranch; the early return on empty$definitionsabove guarantees$total > 0.lib/Middleware/TenantMiddleware.php:77— removed invalid@throws \OCP\AppFramework\Http\Response(not aThrowable).lib/Controller/StufController.php:418— added@phpstan-param Http::STATUS_*narrowing to satisfyDataDisplayResponse's literal-union status code.Structural addition
lib/Service/SettingsService.php— addedgetObjectService(): ?objectpass-through that lazy-resolvesOCA\OpenRegister\Service\ObjectServicefrom the DI container. Eliminates ~20 phpstan/psalm "undefined method" errors across 5 services that already had null-checked call sites. Mirrors theloadConfiguration()pattern forConfigurationService— OpenRegister is an optional runtime dependency, so the class cannot be type-hinted directly in the constructor.Suppressions (each with an inline reason)
phpstan.neon
IRequest::getContent()/IRequest::setParameter()— exist in NCRequestimpl but missing fromnextcloud/ocpinterface stub.IMessage::attachFile()— implemented in NCMail\Message, not on OCP stub.method_exists('OC_Util', 'getVersionString')— version-compat check guarded bymethod_exists().Property ... never read, only written— DI-held services kept for future handlers / constructor-signature stability (pre-existing architectural pattern).Constant ... is unused— documented defaults kept for config export.Strict comparison ... always evaluate to false—getUploadedFile()stub drift (keeps runtime null guard).psalm.xml
OC_Util(UndefinedClass) — version-compat check.DOMNode::getElementsByTagName(UndefinedMethod) —DOMNodenarrows toDOMElementat runtime; psalm can't track the downcast.UnusedParaminlib/Service/— interface-contract params and planned-feature hooks kept for API stability.REUSE.toml
Declares SPDX copyright/licence for:
EUPL-1.2.CC0-1.0.No individual PHP files touched — per ADR-014, licence is expressed via
@author/@copyright/@licensedocblocks in PHP, not SPDX header lines.phpmd baseline
composer phpmdnow runs with--baseline-file phpmd.baseline.xml; the 287 pre-existing findings (159ElseExpression, 93MissingImport, 32Avoid*, 3Remove*) are architectural debt not addressed in this PR. Future violations will fail the gate.Commits
chore(quality): phpcbf auto-fixes (1147 violations)— and 8 follow-up phpcs commits (already on branch)fix(quality): add SettingsService::getObjectService() pass-throughfix(quality): real phpstan bug fixes across controllers and serviceschore(quality): phpstan/psalm framework-drift suppressions with reasonschore(quality): phpmd baseline for pre-existing architectural findingschore(licence): add REUSE.toml for repo-level REUSE complianceTest plan
composer phpcs→ 0 errorscomposer phpmd→ 0 new findingscomposer psalm→ "No errors found"composer phpstan→ "No errors"composer check:strictpasses end-to-end