Skip to content

Commit 688ca96

Browse files
committed
Inclue phan
1 parent c780dbf commit 688ca96

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ FROM php:7.1-cli
33
MAINTAINER Jakub Zalas <[email protected]>
44

55
ENV COMPOSER_ALLOW_SUPERUSER 1
6-
ENV BUILD_DEPS="autoconf file g++ gcc libc-dev make pkg-config re2c"
6+
ENV BUILD_DEPS="autoconf file g++ gcc libc-dev make pkg-config re2c unzip"
77
ENV LIB_DEPS="zlib1g-dev"
88
ENV TOOL_DEPS="git graphviz"
99
ENV PATH="$PATH:/root/.composer/vendor/bin:/root/QualityAnalyzer/bin:/root/DesignPatternDetector/bin"
1010

1111
RUN apt-get update && apt-get install -y --no-install-recommends $TOOL_DEPS $BUILD_DEPS $LIB_DEPS && rm -rf /var/lib/apt/lists/* \
12+
&& git clone https://github.com/nikic/php-ast.git && cd php-ast && phpize && ./configure && make && make install && cd .. && rm -rf php-ast && docker-php-ext-enable ast \
1213
&& docker-php-ext-install zip \
1314
&& echo "date.timezone=Europe/London" >> $PHP_INI_DIR/php.ini \
1415
&& echo "memory_limit=-1" >> $PHP_INI_DIR/php.ini \
@@ -19,6 +20,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends $TOOL_DEPS $BUI
1920
&& curl -Ls https://github.com/dunglas/phpdoc-to-typehint/releases/download/v0.1.0/phpdoc-to-typehint.phar > /usr/local/bin/phpdoc-to-typehint && chmod +x /usr/local/bin/phpdoc-to-typehint \
2021
&& curl -Ls https://github.com/phpmetrics/PhpMetrics/releases/download/v2.2.0/phpmetrics.phar > /usr/local/bin/phpmetrics && chmod +x /usr/local/bin/phpmetrics \
2122
&& curl -Ls https://github.com/phpstan/phpstan/releases/download/0.7/phpstan-0.7.phar > /usr/local/bin/phpstan && chmod +x /usr/local/bin/phpstan \
23+
&& curl -Ls https://github.com/etsy/phan/releases/download/0.9.3/phan.phar.zip > phan.phar.zip && unzip phan.phar.zip && rm phan.phar.zip && mv phan.phar /usr/local/bin/phan && chmod +x /usr/local/bin/phan \
2224
&& curl -Ls https://phar.dephpend.com/dephpend.phar > /usr/local/bin/dephpend && chmod +x /usr/local/bin/dephpend \
2325
&& curl -Ls http://phpdoc.org/phpDocumentor.phar > /usr/local/bin/phpDocumentor && chmod +x /usr/local/bin/phpDocumentor \
2426
&& curl -Ls https://phar.phpunit.de/phpcpd.phar > /usr/local/bin/phpcpd && chmod +x /usr/local/bin/phpcpd \

Dockerfile-alpine

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ FROM php:7.1-alpine
33
MAINTAINER Jakub Zalas <[email protected]>
44

55
ENV COMPOSER_ALLOW_SUPERUSER 1
6-
ENV BUILD_DEPS="autoconf file g++ gcc libc-dev make pkgconf re2c"
6+
ENV BUILD_DEPS="autoconf file g++ gcc libc-dev make pkgconf re2c unzip"
77
ENV LIB_DEPS="zlib-dev"
88
ENV TOOL_DEPS="git graphviz"
99
ENV PATH="$PATH:/root/.composer/vendor/bin:/root/QualityAnalyzer/bin:/root/DesignPatternDetector/bin"
1010

1111
RUN apk add --no-cache --virtual .tool-deps $TOOL_DEPS $LIB_DEPS \
1212
&& apk add --no-cache --virtual .build-deps $BUILD_DEPS \
13+
&& git clone https://github.com/nikic/php-ast.git && cd php-ast && phpize && ./configure && make && make install && cd .. && rm -rf php-ast && docker-php-ext-enable ast \
1314
&& docker-php-ext-install zip \
1415
&& echo "date.timezone=Europe/London" >> $PHP_INI_DIR/php.ini \
1516
&& echo "phar.readonly=0" >> $PHP_INI_DIR/php.ini \
@@ -19,6 +20,7 @@ RUN apk add --no-cache --virtual .tool-deps $TOOL_DEPS $LIB_DEPS \
1920
&& curl -Ls https://github.com/dunglas/phpdoc-to-typehint/releases/download/v0.1.0/phpdoc-to-typehint.phar > /usr/local/bin/phpdoc-to-typehint && chmod +x /usr/local/bin/phpdoc-to-typehint \
2021
&& curl -Ls https://github.com/phpmetrics/PhpMetrics/releases/download/v2.2.0/phpmetrics.phar > /usr/local/bin/phpmetrics && chmod +x /usr/local/bin/phpmetrics \
2122
&& curl -Ls https://github.com/phpstan/phpstan/releases/download/0.7/phpstan-0.7.phar > /usr/local/bin/phpstan && chmod +x /usr/local/bin/phpstan \
23+
&& curl -Ls https://github.com/etsy/phan/releases/download/0.9.3/phan.phar.zip > phan.phar.zip && unzip phan.phar.zip && rm phan.phar.zip && mv phan.phar /usr/local/bin/phan && chmod +x /usr/local/bin/phan \
2224
&& curl -Ls https://phar.dephpend.com/dephpend.phar > /usr/local/bin/dephpend && chmod +x /usr/local/bin/dephpend \
2325
&& curl -Ls http://phpdoc.org/phpDocumentor.phar > /usr/local/bin/phpDocumentor && chmod +x /usr/local/bin/phpDocumentor \
2426
&& curl -Ls https://phar.phpunit.de/phpcpd.phar > /usr/local/bin/phpcpd && chmod +x /usr/local/bin/phpcpd \

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Docker image providing static analysis tools for PHP.
1313
* php-formatter - [Custom coding standards fixer](https://github.com/mmoreram/php-formatter)
1414
* phpmetrics - [Static Analysis Tool](http://www.phpmetrics.org/)
1515
* phpstan - [Static Analysis Tool](https://github.com/phpstan/phpstan)
16+
* phan - [Static Analysis Tool](https://github.com/etsy/phan)
1617
* dephpend - [Detect flaws in your architecture](https://dephpend.com/)
1718
* psalm - [Finds errors in PHP applications](https://getpsalm.org/)
1819
* phpDocumentor - [Documentation generator](https://www.phpdoc.org/)

list-tools.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Available tools:
99
* php-formatter - Custom coding standards fixer - https://github.com/mmoreram/php-formatter
1010
* phpmetrics - Static Analysis Tool - http://www.phpmetrics.org/
1111
* phpstan - Static Analysis Tool - https://github.com/phpstan/phpstan
12+
* phan - Static Analysis Tool - https://github.com/etsy/phan
1213
* dephpend - Detect flaws in your architecture - https://dephpend.com/
1314
* psalm - Finds errors in PHP applications - https://getpsalm.org/
1415
* phpDocumentor - Documentation generator - https://www.phpdoc.org/

0 commit comments

Comments
 (0)