Skip to content

Commit

Permalink
feat(docker): add php-cs-fixer on docker
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Mar 31, 2024
1 parent 0c9ba11 commit d58719b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
ARG PHP_VERSION

FROM alpine:3.19.1 as php-cs-fixer

RUN set -eux; \
version=3.52.1; \
\
apk add --no-cache curl; \
\
curl -sSLfo /usr/local/bin/php-cs-fixer \
https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases/download/v${version}/php-cs-fixer.phar; \
\
chmod +x /usr/local/bin/php-cs-fixer; \
:;


FROM php:${PHP_VERSION}-cli

RUN docker-php-ext-install pdo
Expand Down Expand Up @@ -66,3 +81,5 @@ RUN set -eux; \
\
file /bin/ls --mime | grep application/x-executable; \
:;

COPY --from=php-cs-fixer /usr/local/bin/php-cs-fixer /usr/local/bin/php-cs-fixer
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ Tests
docker-compose down


Lint
----

test/bin/lint


Documentation
-------------

Expand Down
4 changes: 4 additions & 0 deletions test/bin/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/sh -eu

docker-compose up -d --build --remove-orphans php74 > /dev/null
docker-compose exec php74 php-cs-fixer fix

0 comments on commit d58719b

Please sign in to comment.