Skip to content

Commit e4af441

Browse files
committed
build(makefile, tests) udpate targets to PHP 7.1
1 parent 1552a86 commit e4af441

File tree

6 files changed

+89
-39
lines changed

6 files changed

+89
-39
lines changed

config/containers/php/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG PHP_VERSION=5.6
22

3-
FROM composer:2.2 as composer
3+
FROM composer:2.2 AS composer
44

55
FROM php:${PHP_VERSION}-cli-alpine
66

config/containers/php/di52-entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [ "$1" = 'run_tests' ]; then
88
echo -n "Running Composer update ..."
99
composer update -W -qn
1010
echo -e " done"
11-
vendor/bin/phpunit --stop-on-failure "$@"
11+
php -d error_reporting=E_ALL vendor/bin/phpunit --stop-on-failure "$@"
1212
exit $?
1313
fi
1414

makefile

Lines changed: 82 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,26 @@ PWD ?= pwd_unknown
66
PROJECT_NAME = $(notdir $(PWD))
77
# Suppress `make` own output.
88
#.SILENT:
9-
PHP_VERSION ?= 5.6
10-
11-
# Create a function that will return the xdebug source depending on the PHP version.
12-
define xdebug_src
13-
@if [ "$(1)" = 5.6 ]; \
14-
then echo "https://pecl.php.net/get/xdebug-2.5.5.tgz"; \
15-
elif [ "$(1)" = 7.0 ]; \
16-
then echo "https://pecl.php.net/get/xdebug-2.7.2.tgz"; \
17-
else \
18-
echo "xdebug"; \
19-
fi
20-
endef
21-
22-
php_versions :=5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3
9+
PHP_VERSION ?= 7.1
10+
11+
php_versions :=7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
2312
build: $(build_php_versions) ## Builds the project PHP images.
2413
mkdir -p var/cache/composer
2514
mkdir -p var/log
2615
# Foreach PHP version build a Docker image.
2716
for version in $(php_versions); do \
28-
if [ "$${version}" = 5.6 ]; \
29-
then export XDEBUG_SRC="https://pecl.php.net/get/xdebug-2.5.5.tgz"; \
30-
elif [ "$${version}" = 7.0 ]; \
31-
then export XDEBUG_SRC="https://pecl.php.net/get/xdebug-2.7.2.tgz"; \
32-
else \
33-
export XDEBUG_SRC="xdebug"; \
34-
fi; \
3517
docker build \
3618
--build-arg PHP_VERSION=$${version} \
3719
--build-arg XDEBUG_REMOTE_HOST=$${XDEBUG_REMOTE_HOST:-host.docker.internal} \
3820
--build-arg XDEBUG_REMOTE_PORT=$${XDEBUG_REMOTE_PORT:-9009} \
3921
--build-arg WORKDIR=${PWD} \
40-
--build-arg XDEBUG_SRC=$${XDEBUG_SRC} \
22+
--build-arg XDEBUG_SRC=xdebug \
4123
--progress plain \
4224
config/containers/php \
4325
--tag lucatume/di52-dev:php-v$${version}; \
4426
done
4527
.PHONY: build
4628

47-
lint: ## Lint the project source files to make sure they are PHP 5.6 compatible.
48-
docker run --rm -v ${PWD}:/${PWD} lucatume/parallel-lint-56 --colors ${PWD}/src
49-
.PHONY: lint
50-
5129
phpcs: ## Run PHP Code Sniffer on the project source files.
5230
docker run --rm \
5331
-u "$$(id -u):$$(id -g)" \
@@ -71,7 +49,7 @@ phpcbf: ## Run PHP Code Sniffer Beautifier on the project source files.
7149
.PHONY: phpcbf
7250

7351
PHPSTAN_LEVEL?=max
74-
phpstan: ## Run phpstan on the project source files, PHP 5.6 version.
52+
phpstan: ## Run phpstan on the project source files, PHP 7.1 version.
7553
docker run --rm \
7654
-v ${PWD}:${PWD} \
7755
-u "$$(id -u):$$(id -g)" \
@@ -80,7 +58,7 @@ phpstan: ## Run phpstan on the project source files, PHP 5.6 version.
8058
-l ${PHPSTAN_LEVEL} ${PWD}/src
8159
.PHONY: phpstan
8260

83-
phan: ## Run phan on the project source files, PHP 5.6 version.
61+
phan: ## Run phan on the project source files, PHP 7.1 version.
8462
docker run --rm \
8563
-v ${PWD}:/mnt/src \
8664
-u "$$(id -u):$$(id -g)" \
@@ -96,14 +74,86 @@ composer_update:
9674
lucatume/di52-dev:php-v${PHP_VERSION} update -W
9775
.PHONY: composer_update
9876

99-
composer_update_56:
77+
composer_update_71:
78+
docker run --rm \
79+
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
80+
-v "${PWD}:${PWD}" \
81+
-w ${PWD} \
82+
--entrypoint composer \
83+
lucatume/di52-dev:php-v7.1 update -W
84+
.PHONY: composer_update_71
85+
86+
composer_update_72:
87+
docker run --rm \
88+
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
89+
-v "${PWD}:${PWD}" \
90+
-w ${PWD} \
91+
--entrypoint composer \
92+
lucatume/di52-dev:php-v7.2 update -W
93+
.PHONY: composer_update_72
94+
95+
composer_update_73:
96+
docker run --rm \
97+
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
98+
-v "${PWD}:${PWD}" \
99+
-w ${PWD} \
100+
--entrypoint composer \
101+
lucatume/di52-dev:php-v7.3 update -W
102+
.PHONY: composer_update_73
103+
104+
composer_update_74:
105+
docker run --rm \
106+
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
107+
-v "${PWD}:${PWD}" \
108+
-w ${PWD} \
109+
--entrypoint composer \
110+
lucatume/di52-dev:php-v7.4 update -W
111+
.PHONY: composer_update_74
112+
113+
composer_update_80:
114+
docker run --rm \
115+
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
116+
-v "${PWD}:${PWD}" \
117+
-w ${PWD} \
118+
--entrypoint composer \
119+
lucatume/di52-dev:php-v8.0 update -W
120+
.PHONY: composer_update_80
121+
122+
composer_update_81:
123+
docker run --rm \
124+
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
125+
-v "${PWD}:${PWD}" \
126+
-w ${PWD} \
127+
--entrypoint composer \
128+
lucatume/di52-dev:php-v8.1 update -W
129+
.PHONY: composer_update_81
130+
131+
composer_update_82:
132+
docker run --rm \
133+
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
134+
-v "${PWD}:${PWD}" \
135+
-w ${PWD} \
136+
--entrypoint composer \
137+
lucatume/di52-dev:php-v8.2 update -W
138+
.PHONY: composer_update_82
139+
140+
composer_update_83:
141+
docker run --rm \
142+
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
143+
-v "${PWD}:${PWD}" \
144+
-w ${PWD} \
145+
--entrypoint composer \
146+
lucatume/di52-dev:php-v8.3 update -W
147+
.PHONY: composer_update_83
148+
149+
composer_update_84:
100150
docker run --rm \
101151
-e COMPOSER_CACHE_DIR=${PWD}/var/cache/composer \
102152
-v "${PWD}:${PWD}" \
103153
-w ${PWD} \
104154
--entrypoint composer \
105-
lucatume/di52-dev:php-v5.6 update -W
106-
.PHONY: composer_update_56
155+
lucatume/di52-dev:php-v8.4 update -W
156+
.PHONY: composer_update_84
107157

108158
test_run: ## Run the test on the specified PHP version with XDebug support. Example `PHP_VERSION=7.2 make test_run`.
109159
docker run --rm \
@@ -113,7 +163,7 @@ test_run: ## Run the test on the specified PHP version with XDebug support. Exam
113163
"lucatume/di52-dev:php-v${PHP_VERSION}" run_tests --no-coverage
114164
.PHONY: test_run
115165

116-
test: composer_update_56 lint phpcs phpstan phan ## Runs the project PHPUnit tests on all PHP versions.
166+
test: composer_update_71 phpcs phpstan phan ## Runs the project PHPUnit tests on all PHP versions.
117167
for version in $(php_versions); do \
118168
docker run --rm \
119169
-e COMPOSER_CACHE_DIR="${PWD}/var/cache/composer" \

tests/unit/Builders/parameter-test-classes.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ public function __construct($one, array $two, $three = [], array $four = ['four'
3737

3838
class ParameterTestClassSix
3939
{
40-
public function __construct($one, callable $two, $three = null, callable $four = null)
40+
public function __construct($one, callable $two, $three = null, ?callable $four = null)
4141
{
4242
}
4343
}
4444

4545
class ParameterTestClassSeven
4646
{
47-
public function __construct($one, iterable $two, $three = null, iterable $four = null)
47+
public function __construct($one, iterable $two, $three = null, ?iterable $four = null)
4848
{
4949
}
5050
}
5151

5252
class ParameterTestClassEight
5353
{
54-
public function __construct(ParameterTestClassOne $one, ParameterTestClassTwo $two = null)
54+
public function __construct(ParameterTestClassOne $one, ?ParameterTestClassTwo $two = null)
5555
{
5656
}
5757
}

tests/unit/Builders/parameter-test-ns-classes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ClassTwo
1212

1313
class ClassThree
1414
{
15-
public function __construct(ClassOne $one, \Parameter\Test\ClassTwo $two = null)
15+
public function __construct(ClassOne $one, ?\Parameter\Test\ClassTwo $two = null)
1616
{
1717
}
1818
}

tests/unit/data/namespaced-test-classes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function __construct(One $one)
179179

180180
class DependingOnOneInterfaceWithDefault
181181
{
182-
public function __construct(One $one = null)
182+
public function __construct(?One $one = null)
183183
{
184184
}
185185
}

0 commit comments

Comments
 (0)