Skip to content

Commit 1afe25b

Browse files
committed
Tools - install suggested tools with symfony2 components only on php 5.4
1 parent 0390dc5 commit 1afe25b

2 files changed

Lines changed: 16 additions & 13 deletions

File tree

.github/workflows/php.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,14 @@ jobs:
6969
fi
7070
# test installing suggested tools like docker image
7171
if [[ ${CI_PHP_VERSION:0:3} == "7.2" ]]; then
72-
PSALM_VERSION=":~2" bin/suggested-tools.sh install --prefer-dist;
72+
bin/suggested-tools.sh install --prefer-dist;
7373
fi
74-
if [ ${CI_PHP_VERSION:0:3} == "5.4" ] || [ ${CI_PHP_VERSION:0:3} == "5.6" ]; then
74+
if [[ ${CI_PHP_VERSION:0:3} == "5.6" ]]; then
7575
PHP7=no bin/suggested-tools.sh install --prefer-dist;
7676
fi
77+
if [[ ${CI_PHP_VERSION:0:3} == "5.4" ]]; then
78+
PHP7=no SYMFONY2=yes bin/suggested-tools.sh install --prefer-dist;
79+
fi
7780
echo
7881
7982
- name: Show versions

bin/suggested-tools.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ mode="$1"
99
requireMode="$2"
1010

1111
PHP7=${PHP7:-"yes"}
12-
PSALM_VERSION=${PSALM_VERSION:-""}
12+
SYMFONY2=${SYMFONY2:-"no"}
1313

1414
if [ $mode = "install" ]
1515
then
1616
echo "Installing suggested tools"
17-
TOOLS="php-parallel-lint/php-parallel-lint php-parallel-lint/php-console-highlighter sensiolabs/security-checker vimeo/psalm$PSALM_VERSION"
17+
# psalm 0.2 for php 5.4, v2 can be minimum when php5.4 and symfony2 components are dropped
18+
TOOLS="php-parallel-lint/php-parallel-lint php-parallel-lint/php-console-highlighter sensiolabs/security-checker vimeo/psalm:>=0.2 friendsofphp/php-cs-fixer:>=2"
1819
if [[ ${PHP7} == "yes" ]]; then
1920
TOOLS="${TOOLS} phpstan/phpstan nette/neon"
2021
fi
21-
echo $TOOLS
22-
echo
23-
24-
if [ ! -z "$requireMode" ]; then
25-
# docker build OR travis + php 7.0 OR symfony2 (default composer.lock)
26-
composer require symfony/filesystem:~2 symfony/process:~2 symfony/finder:~2 $TOOLS friendsofphp/php-cs-fixer:~2.2 $requireMode
27-
else
28-
# symfony 3
29-
composer require $TOOLS friendsofphp/php-cs-fixer
22+
if [[ ${SYMFONY2} == "yes" ]]; then
23+
# https://github.com/EdgedesignCZ/phpqa/commit/94e9b49
24+
# https://github.com/EdgedesignCZ/phpqa/commit/13a8025
25+
TOOLS="${TOOLS} symfony/filesystem:~2 symfony/process:~2 symfony/finder:~2"
3026
fi
27+
echo
28+
echo "composer require $TOOLS $requireMode"
29+
echo
30+
composer require $TOOLS $requireMode
3131
else
3232
echo "Removing suggested tools"
3333
composer remove php-parallel-lint/php-parallel-lint php-parallel-lint/php-console-highlighter phpstan/phpstan friendsofphp/php-cs-fixer vimeo/psalm sensiolabs/security-checker

0 commit comments

Comments
 (0)