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 ### DX-002: Document EntitlementService public API
**Status:** Open **Status:** Fixed (2026-01-29)
**File:** `Services/EntitlementService.php` **File:** `Services/EntitlementService.php`
The EntitlementService is the core API for entitlement checks but lacks comprehensive PHPDoc. External consumers need clear documentation. The EntitlementService is the core API for entitlement checks but lacks comprehensive PHPDoc. External consumers need clear documentation.
**Acceptance Criteria:** **Resolution:**
- Add complete PHPDoc to all public methods - Added comprehensive class-level PHPDoc explaining key concepts (Features, Packages, Boosts, Usage Records)
- Document exception conditions - Documented all public methods with:
- Add @throws annotations where applicable - Detailed descriptions of purpose and behaviour
- Create usage examples in documentation - 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
--- ---