Skip to content

PHP

Linters

Linter Configuration key Status
phpcs PHP_PHPCS GitHub last commit
phpstan PHP_PHPSTAN GitHub last commit
psalm PHP_PSALM GitHub last commit
phplint PHP GitHub last commit

Linted files

  • File extensions:
    • .php

Configuration in MegaLinter

Variable Description Default value
PHP_FILTER_REGEX_INCLUDE Custom regex including filter
PHP_FILTER_REGEX_EXCLUDE Custom regex excluding filter

Behind the scenes

Installation

  • Dockerfile commands :
RUN wget --tries=5 -q -O phive.phar https://phar.io/releases/phive.phar \
    && wget --tries=5 -q -O phive.phar.asc https://phar.io/releases/phive.phar.asc \
    && PHAR_KEY_ID="0x9D8A98B29B2D5D79" \
    && ( gpg --keyserver keyserver.pgp.com --recv-keys "$PHAR_KEY_ID" \
        || gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$PHAR_KEY_ID" \
        || gpg --keyserver pgp.mit.edu --recv-keys "$PHAR_KEY_ID" \
        || gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys "$PHAR_KEY_ID" ) \
    && gpg --verify phive.phar.asc phive.phar \
    && chmod +x phive.phar \
    && mv phive.phar /usr/local/bin/phive \
    && rm phive.phar.asc \
    && update-alternatives --install /usr/bin/php php /usr/bin/php7 100 \
    && update-alternatives --install /usr/bin/php php /usr/bin/php8 10