Skip to content

Commit 02fc314

Browse files
authored
🐳 Add php tools in dockerfile (#23)
1 parent 9668991 commit 02fc314

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ā€ŽDockerfileā€Ž

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,16 @@ RUN curl -sS https://getcomposer.org/installer | php -- \
139139
--filename=composer \
140140
&& chmod +x /usr/local/bin/composer
141141

142+
# Install global PHP QA tools needed by workflows that don't run composer install.
143+
# (php-cs-fixer and phpcs are invoked directly in lint workflows.)
144+
RUN curl -fsSL https://cs.symfony.com/download/php-cs-fixer-v3.phar -o /usr/local/bin/php-cs-fixer \
145+
&& chmod +x /usr/local/bin/php-cs-fixer \
146+
&& mkdir -p /opt/composer \
147+
&& COMPOSER_HOME=/opt/composer composer global require --no-interaction --no-progress squizlabs/php_codesniffer:^3 phpstan/phpstan:^2 \
148+
&& ln -sf /opt/composer/vendor/bin/phpcs /usr/local/bin/phpcs \
149+
&& ln -sf /opt/composer/vendor/bin/phpcbf /usr/local/bin/phpcbf \
150+
&& ln -sf /opt/composer/vendor/bin/phpstan /usr/local/bin/phpstan
151+
142152
# Install AWS CLI
143153
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
144154
&& unzip awscliv2.zip \

0 commit comments

Comments
Ā (0)