Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(Added) Add PHPStan for Static Analysis (#23)
* Add phpstan.neon configuration file This commit introduces the phpstan.neon configuration file to the project. It includes various configuration parameters such as PHP version, error checking level, and paths to be analyzed. It is intended to standardize PHPStan static analysis settings across different environments. * Enable PHPStan static analysis in workflow Uncommented the PHPStan static analysis step in the GitHub Actions workflow. This will make it run after successful execution of Infection tests, improving overall code quality. * Add PHPStan to composer and testing scripts PHPStan and its PHPUnit extension have been added to our composer dependencies. Additionally, a new script for running PHPStan analysis has been implemented. This change aids in identifying code quality issues through static analysis. * Update packages in localTest.sh The commit revises the packages installed via composer in the localTest.sh script. Instead of "rector/rector", it now requires the "phpstan/phpstan" and "phpstan/phpstan-phpunit" packages with specified versions, aiming to align with the project's dependencies. * Refactor calculateRank method and remove psalm annotation The unnecessary psalm annotation was removed from the rankByMetric method. The calculateRank method was also refactored to include more explicit typing and to update the documentation regarding the method's parameters and return values. * Refactor rank calculation function in Trace Removed uneccessary comments and rearranged the order of types in the parameters within the rank calculation function. Further, the array returned was reformatted for improved readability. The process of incrementing the value of 'sameMetricValueCount' was also changed to the more standard unary operator (++$var). * Add generic class check in PHPStan configuration This commit includes an additional parameter to the PHPStan configuration, `checkGenericClassInNonGenericObjectType: true`. This enhancement ensures a more comprehensive analysis by enforcing checks for generic classes in non-generic object types. * Update method documentation in Trace.php The documentation for the method that calculates the rank for a given metric is updated. To make it more descriptive and clear, extra information is added to indicate that the parameter is
- Loading branch information