PHP
Linters
Linter | Additional |
---|---|
phpcs PHP_PHPCS |
|
phpstan PHP_PHPSTAN |
|
psalm PHP_PSALM |
|
phplint PHP_PHPLINT |
|
php-cs-fixer PHP_PHPCSFIXER |
Linted files
- File extensions:
.php
Configuration in MegaLinter
Variable | Description | Default value |
---|---|---|
PHP_PRE_COMMANDS | List of bash commands to run before the linters | None |
PHP_POST_COMMANDS | List of bash commands to run after the linters | None |
PHP_FILTER_REGEX_INCLUDE | Custom regex including filter | |
PHP_FILTER_REGEX_EXCLUDE | Custom regex excluding filter |
Behind the scenes
Installation
- Dockerfile commands :
RUN update-alternatives --install /usr/bin/php php /usr/bin/php84 110
COPY --from=composer/composer:2-bin /composer /usr/bin/composer
ENV PATH="/root/.composer/vendor/bin:${PATH}"
ENV PHP_CS_FIXER_IGNORE_ENV=true