Skip to content

Updating to PHPStan Level 10#73

Merged
floriankraemer merged 5 commits into
masterfrom
phpstan-level
May 24, 2026
Merged

Updating to PHPStan Level 10#73
floriankraemer merged 5 commits into
masterfrom
phpstan-level

Conversation

@floriankraemer
Copy link
Copy Markdown
Contributor

No description provided.

- Increased PHPStan analysis level from 8 to 9 for stricter type checking and improved code quality.
- Refactored `Application` class to use dedicated methods for resolving input and output interfaces, enhancing clarity and error handling.
- Improved `ChurnMetrics` and related classes by adding type checks and default value handling for various metrics, ensuring robustness.
- Enhanced report generation by implementing consistent value resolution methods across multiple classes, improving data integrity and reducing redundancy.
- Updated command classes to format statistic values more reliably, ensuring consistent output across different data types.
- Increased PHPStan analysis level from 9 to 10 for stricter type checking and improved code quality.
- Refactored `ChurnMetricsCollection` to ensure class names are cast to strings when converting metrics to arrays.
- Updated `CognitiveMetricsCollection` to return values as an indexed array for consistency.
- Improved `CognitiveMetricsCollector` by normalizing ignored items and adding a new method for better handling of ignored items.
- Enhanced `Parser` class with better type handling for metrics and added methods to merge cyclomatic and Halstead metrics.
- Introduced `CustomExporterConfigValidator` to streamline validation of custom exporter configurations.
- Refactored `CompositeChurnSpecification` and `CustomExporter` to utilize the new validator for improved error handling.
- Added `ConfigException` for better error management in configuration handling.
- Updated `CognitiveMetrics` to return early if `cyclomatic_complexity` is not an array, enhancing robustness.
- Modified `ScoreCalculator` to skip non-numeric weights, ensuring only valid scores are accumulated.
- Cleaned up unnecessary whitespace in `ConfigFactory` for better code clarity.
@Phauthentic Phauthentic deleted a comment from github-actions Bot May 24, 2026
@Phauthentic Phauthentic deleted a comment from github-actions Bot May 24, 2026
- Added an empty string to the return array in the `CacheConfig` class to ensure consistent return structure.
- This change improves clarity and maintains the expected format for configuration data.
@Phauthentic Phauthentic deleted a comment from github-actions Bot May 24, 2026
@floriankraemer floriankraemer merged commit ab84eb2 into master May 24, 2026
6 checks passed
@floriankraemer floriankraemer deleted the phpstan-level branch May 24, 2026 23:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant