From 28b5b0cab5eeaecaa4cb2b4f765c1d0d354550e4 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 12 Nov 2024 09:42:11 +0100 Subject: Add PHPStan as a developer dependency. PHPStan is a static PHP code analyzer that's aimed at finding actual bugs in the code. Where PHP Code Sniffer is about codeing standards, PHPStan is about correctness of code. The provided configuration file (`phpstan.neon.dist`) is configured to use the _lowest_ level of checks that PHPStan will report on. See https://phpstan.org/user-guide/rule-levels for information about the various rule levels. Run an analysis of the code base like this: % ./vendor/bin/phpstan It will output any found issues to stdout. You can also run it like this: % ./vendor/bin/phpstan --error-format=raw > phpstan.log This will give you an output file in a format that's suitable for use with typical editors for mapping errors to source locations. --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'composer.json') diff --git a/composer.json b/composer.json index 6b2354cd1..0a8e57b5e 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,8 @@ "phpmd/phpmd": "^2.6", "squizlabs/php_codesniffer": "*", "php-mock/php-mock": "^2.2", - "dms/phpunit-arraysubset-asserts": "^0.5.0" + "dms/phpunit-arraysubset-asserts": "^0.5.0", + "phpstan/phpstan": "^2.0" }, "autoload": { "psr-4": { -- cgit v1.2.3