docs: add comprehensive PHPDoc to EntitlementService (P2-020)

- Document provisionNamespacePackage with examples
- Document provisionNamespaceBoost with boost/duration types
- Document invalidateNamespaceCache with auto-invalidation triggers
- Add cross-references to workspace-level equivalents

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Snider 2026-01-29 15:39:21 +00:00
parent 501ea1897e
commit 5197094bd6
2 changed files with 858 additions and 23 deletions

File diff suppressed because it is too large Load diff

18
TODO.md
View file

@ -127,16 +127,22 @@ Several files were missing `declare(strict_types=1);`:
---
### DX-002: Document EntitlementService public API
**Status:** Open
**Status:** Fixed (2026-01-29)
**File:** `Services/EntitlementService.php`
The EntitlementService is the core API for entitlement checks but lacks comprehensive PHPDoc. External consumers need clear documentation.
**Acceptance Criteria:**
- Add complete PHPDoc to all public methods
- Document exception conditions
- Add @throws annotations where applicable
- Create usage examples in documentation
**Resolution:**
- Added comprehensive class-level PHPDoc explaining key concepts (Features, Packages, Boosts, Usage Records)
- Documented all public methods with:
- Detailed descriptions of purpose and behaviour
- Complete parameter documentation with types
- Return type documentation with structure details
- `@throws` annotations where applicable
- Usage examples in docblocks
- Documented the entitlement cascade model (namespace -> workspace -> user tier)
- Added examples for common use cases (checking entitlements, recording usage, provisioning)
- Documented caching behaviour and invalidation triggers
---