A Set of Static Analyzers for PHP Code
A static analyzer scans the source code for errors and vulnerabilities and for compliance with the coding standard. The article describes how to install, configure and run static analyzers: PHPStan Psalm PHP_CodeSniffer PHP Coding Standards Fixer PHPMD PHPStan Installation composer require --dev phpstan/phpstan Run vendor/bin/phpstan analyze -l 9 src Psalm Installation composer require --dev vimeo/psalm Configuration src/psalm.xml <?xml version="1.0"?> <psalm errorLevel="7" resolveFromConfigFile="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" findUnusedBaselineEntry="true" > <projectFiles> <directory name="src" /> <ignoreFiles> <directory name="vendor