feat: update phpstan level and add type hints #116
Merged
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.
This pull request improves type safety and documentation across the codebase by adding and refining array type annotations in PHPDoc comments. It also updates the static analysis configuration to enforce stricter checks. These changes help clarify expected data structures, reduce ambiguity, and make the code easier to maintain and understand.
Type annotation improvements (most files):
Added or updated array type annotations in PHPDoc comments throughout the codebase, specifying key and value types for arrays such as
array<string, mixed>,array<int, string>, and similar, in method signatures and class properties for better type safety and IDE/static analysis support. [1] [2] [3] [4] [5] [6] [7] [8]Improved function and method documentation to specify array return and parameter types, e.g.,
@return array<string, mixed>,@param array<string>, and similar, making expectations clearer for developers and static analysis tools. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21]Static analysis configuration:
phpstan.neonfor stricter type checking and improved code quality enforcement.Constructor and property documentation:
These changes collectively enhance code reliability and maintainability by making type expectations explicit and leveraging stricter static analysis.