Commit 2b64b5b
serega
```
refactor: Improve type safety and resolve static analysis warnings
Addresses PHPStan errors and warnings across entities and the security controller by enforcing strict type hints and best practices.
- **User.php**: Applied `readonly` and initialization (`= null`) to `$id` to satisfy PHP 8.1 rules for auto-generated Doctrine IDs. Added explicit array type hints (`array<string>`) and `type: json` for `$roles`.
- **ApiToken.php**: Added explicit array type hints for `$scopes` property and methods. Implemented the `\Stringable` interface.
- **SecurityController.php**: Added explicit type hints (`?User`, `JsonResponse`, `void`) to parameters and return types. Removed all remaining code comments.
```1 parent 892bc0d commit 2b64b5b
17 files changed
Lines changed: 2063 additions & 60 deletions
File tree
- .github/workflows
- app
- src
- Controller
- Entity
- tests
- Controller
- Entity
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
| |||
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
38 | | - | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
0 commit comments