Updating to PHPStan Level 10#73
Merged
Merged
Conversation
- 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.
- 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.
…consistent return structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.