Skip to content

VIP Code Analysis Bot

PHP linting

The VIP Code Analysis Bot runs the PHP linter (php -l) bundled with PHP, to highlight code syntax and compilation errors.

By default, only modified PHP files in a repository’s pull request are PHP linted by the Bot. The Bot can be configured to PHP lint all files if needed.

VIP has configured the Bot so that it will PHP lint each file based on every PHP version used by the environments to which the repository being analyzed deploys. For example, if a particular repository deploys to two environments, one using PHP 7.4 and the other PHP 8.0, each file will be PHP linted using both PHP 7.4 and PHP 8.0.

This also applies to a repository that deploys to multiple applications with environments using multiple PHP versions.

VIP configures the Bot to syntax check each altered file, as syntax errors are often fatal. The Bot acts as a safeguard against such fatal errors as they usually need to be addressed before deployment.

In some cases code might intentionally contain syntax errors, such as files that are part of unit-test packages. Customizing the Bot’s behavior is useful in those cases to prevent that code from being unnecessarily highlighted during PHP linting.

An example of feedback from the Bot highlighting errors found by PHP linting

Last updated: March 25, 2022