PHPStan Config
Ignoring errors in your PHP code can sometimes be necessary, especially when you are dealing with legacy code or third-party libraries that may not adhere to the strictest standards. PHPStan provides a way to ignore certain errors by configuring them in the phpstan.neon file. This allows you to focus on critical issues while acknowledging and managing less important ones effectively.
The phpstan.neon file is where you can define rules and configurations for PHPStan to follow during the static analysis of your code. To ignore errors, you can specify the error codes that you want PHPStan to disregard. For example, if you frequently encounter a specific error that is not a priority to fix at the moment, you can add it to the ignore list in the phpstan.neon file. This helps you maintain a clean and manageable codebase without being overwhelmed by non-critical issues.
Branch: https://github.com/GaryClarke/php-api-pro/tree/16-phpstan-ignore-errors
PHPStan video on YouTube:
Testing PHP course:
0 comments