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.
This commit is contained in:
Harald Eilertsen
2024-11-12 09:42:11 +01:00
parent ce9d67f7b1
commit 28b5b0cab5
6 changed files with 76 additions and 18 deletions

9
phpstan.neon.dist Normal file
View File

@@ -0,0 +1,9 @@
parameters:
level: 0
paths:
- boot.php
- include
- util
- Zotlabs
scanDirectories:
- library