Skip to content

Commit 6b1ad25

Browse files
committed
Added infection tests and static analysis
1 parent 540988a commit 6b1ad25

23 files changed

+2572
-375
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
FROM php:7.4.0alpha3-cli-alpine
2+
3+
LABEL maintainer="Grégory Planchat <[email protected]>"
4+
5+
ARG APP_UID=1000
6+
ARG APP_GID=1000
7+
ARG APP_USERNAME=docker
8+
ARG APP_GROUPNAME=docker
9+
10+
RUN set -ex\
11+
&& apk update \
12+
&& apk upgrade \
13+
&& echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
14+
&& apk add \
15+
shadow@testing \
16+
ca-certificates \
17+
wget \
18+
autoconf \
19+
bash \
20+
binutils \
21+
expat \
22+
file \
23+
g++ \
24+
gcc \
25+
m4 \
26+
make \
27+
git \
28+
nodejs \
29+
npm \
30+
&& update-ca-certificates
31+
32+
RUN docker-php-ext-install opcache
33+
34+
RUN apk add --update icu-dev icu \
35+
&& docker-php-ext-configure intl \
36+
&& docker-php-ext-install intl \
37+
&& apk del icu-dev
38+
39+
RUN docker-php-ext-configure pcntl \
40+
&& docker-php-ext-install pcntl
41+
42+
RUN docker-php-source extract \
43+
&& pecl install xdebug-2.8.0beta1 \
44+
&& docker-php-ext-enable xdebug \
45+
&& docker-php-source delete
46+
47+
RUN apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted
48+
49+
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
50+
51+
RUN apk del \
52+
autoconf \
53+
bash \
54+
binutils \
55+
expat \
56+
file \
57+
g++ \
58+
gcc \
59+
gdbm \
60+
gmp \
61+
isl \
62+
libatomic \
63+
libbz2 \
64+
libc-dev \
65+
libffi \
66+
libgcc \
67+
libgomp \
68+
libldap \
69+
libltdl \
70+
libmagic \
71+
libstdc++ \
72+
libtool \
73+
m4 \
74+
make \
75+
mpc1 \
76+
mpfr3 \
77+
musl-dev \
78+
perl \
79+
pkgconf \
80+
pkgconfig \
81+
python \
82+
re2c \
83+
readline \
84+
sqlite-libs \
85+
&& rm -rf /tmp/* /var/cache/apk/*
86+
87+
RUN addgroup -g ${APP_GID} ${APP_USERNAME} \
88+
&& adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME}
89+
90+
COPY config/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
91+
COPY config/memory.ini /usr/local/etc/php/conf.d/memory.ini
92+
93+
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
94+
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
95+
&& php composer-setup.php --install-dir /usr/local/bin --filename composer\
96+
&& php -r "unlink('composer-setup.php');"
97+
98+
RUN mkdir -p /opt/docker/.npm \
99+
&& chown docker:docker /opt/docker/.npm
100+
101+
WORKDIR /var/www/html
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
memory_limit=-1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
allow_url_include=1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[xdebug]
2+
xdebug.max_nesting_level=2048
3+
xdebug.remote_enable=1
4+
xdebug.remote_connect_back=0
5+
xdebug.remoteport=9000
6+
xdebug.remote_host=host.docker.internal
7+
xdebug.idekey=PHPSTORM
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
FROM php:7.4.0alpha3-cli-alpine
2+
3+
LABEL maintainer="Grégory Planchat <[email protected]>"
4+
5+
ARG APP_UID=1000
6+
ARG APP_GID=1000
7+
ARG APP_USERNAME=docker
8+
ARG APP_GROUPNAME=docker
9+
10+
RUN set -ex\
11+
&& apk update \
12+
&& apk upgrade \
13+
&& echo "@testing http://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
14+
&& apk add \
15+
shadow@testing \
16+
ca-certificates \
17+
wget \
18+
autoconf \
19+
bash \
20+
binutils \
21+
expat \
22+
file \
23+
g++ \
24+
gcc \
25+
m4 \
26+
make \
27+
git \
28+
nodejs \
29+
npm \
30+
&& update-ca-certificates
31+
32+
RUN docker-php-ext-install opcache
33+
34+
RUN apk add --update icu-dev icu \
35+
&& docker-php-ext-configure intl \
36+
&& docker-php-ext-install intl \
37+
&& apk del icu-dev
38+
39+
RUN docker-php-ext-configure pcntl \
40+
&& docker-php-ext-install pcntl
41+
42+
RUN apk add gnu-libiconv --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ --allow-untrusted
43+
44+
ENV LD_PRELOAD /usr/lib/preloadable_libiconv.so php
45+
46+
RUN apk del \
47+
autoconf \
48+
bash \
49+
binutils \
50+
expat \
51+
file \
52+
g++ \
53+
gcc \
54+
gdbm \
55+
gmp \
56+
isl \
57+
libatomic \
58+
libbz2 \
59+
libc-dev \
60+
libffi \
61+
libgcc \
62+
libgomp \
63+
libldap \
64+
libltdl \
65+
libmagic \
66+
libstdc++ \
67+
libtool \
68+
m4 \
69+
make \
70+
mpc1 \
71+
mpfr3 \
72+
musl-dev \
73+
perl \
74+
pkgconf \
75+
pkgconfig \
76+
python \
77+
re2c \
78+
readline \
79+
sqlite-libs \
80+
&& rm -rf /tmp/* /var/cache/apk/*
81+
82+
RUN addgroup -g ${APP_GID} ${APP_USERNAME} \
83+
&& adduser -u ${APP_UID} -h /opt/${APP_USERNAME} -H -G ${APP_GROUPNAME} -s /sbin/nologin -D ${APP_USERNAME}
84+
85+
COPY config/memory.ini /usr/local/etc/php/conf.d/memory.ini
86+
87+
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
88+
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
89+
&& php composer-setup.php --install-dir /usr/local/bin --filename composer\
90+
&& php -r "unlink('composer-setup.php');"
91+
92+
RUN mkdir -p /opt/docker/.npm \
93+
&& chown docker:docker /opt/docker/.npm
94+
95+
WORKDIR /var/www/html
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
memory_limit=-1
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
allow_url_include=1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.idea/
22
vendor/
3+
/.env

.phpspec.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"autoload": {
2222
"psr-4": {
23-
"Kiboko\\Component\\ETL\\Bucket\\": ""
23+
"Kiboko\\Component\\ETL\\Bucket\\": "src/"
2424
}
2525
},
2626
"extra": {
@@ -29,6 +29,9 @@
2929
}
3030
},
3131
"require-dev": {
32-
"phpspec/phpspec": "^5.1"
32+
"phpspec/phpspec": "^5.1",
33+
"infection/infection": "dev-master",
34+
"drupol/phpspec-code-coverage": "^4.0@dev",
35+
"phpstan/phpstan": "^0.12.0@dev"
3336
}
3437
}

0 commit comments

Comments
 (0)