-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
PHPStan Level max reports 14 warnings in SecretController.php related to type casting from Request->input() which returns mixed.
Errors
- Lines 108-114 (store method): Cannot cast mixed to string/array
- Lines 152-170 (update method): Cannot cast mixed to string/array
Example
$secret->title_plain = (string) $request->input('title'); // PHPStan: Cannot cast mixed to stringContext
- All tests passing (35/35 Secret+SecretShare tests)
- Runtime behavior correct
- Only static analysis warnings
Solutions to Consider
- @var DocBlocks before assignments (most common Laravel pattern)
- Custom type-safe Request classes with typed getters
- PHPStan baseline to suppress these specific warnings
- Validation-based type inference (PHPStan Laravel extension)
Priority
Low - Does not affect functionality, only static analysis
Related
- Issue Phase 3: Secret Sharing & Access Control (RBAC Integration) #182 (Secret Sharing & Access Control implementation)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done