Skip to content

Commit beed6e1

Browse files
committed
Add PHPSTAN for 1.6 too
1 parent ce5360b commit beed6e1

3 files changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/php.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,33 @@ jobs:
2626
runs-on: ubuntu-latest
2727
strategy:
2828
matrix:
29-
presta-versions: ['1.7.0.3', 'latest']
29+
presta-versions: ['latest', '1.7.0.3', '1.6.1.21','1.6.1.0']
3030
steps:
3131
- name: Checkout
3232
uses: actions/checkout@v2.0.0
33+
3334
- name: Cache vendor folder
3435
uses: actions/cache@v1
3536
with:
3637
path: vendor
3738
key: php-${{ hashFiles('composer.lock') }}
39+
3840
- name: Cache composer folder
3941
uses: actions/cache@v1
4042
with:
4143
path: ~/.composer/cache
4244
key: php-composer-cache
45+
4346
- run: composer install
47+
4448
- name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }})
4549
run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }}
50+
51+
- name: Select .neon file to run with PHPStan
52+
id: neon
53+
run: |
54+
PS_VERSION=$(docker exec temp-ps bash -c 'echo "$PS_VERSION"')
55+
[[ "${PS_VERSION:0:3}" != '1.7' ]] && echo ::set-output name=filename::phpstan-PS-1.6.neon || echo ::set-output name=filename::phpstan-PS-1.7.neon
56+
4657
- name : Run PHPStan
47-
run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/phpstan.neon
58+
run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/${{steps.neon.outputs.filename}}

tests/phpstan/phpstan-PS-1.6.neon

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
includes:
2+
- %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon
3+
4+
parameters:
5+
paths:
6+
- ../../classes
7+
- ../../controllers
8+
- ../../ps_googleanalytics.php
9+
reportUnmatchedIgnoredErrors: false
10+
ignoreErrors:
11+
- '#Strict comparison using === between false and Module will always evaluate to false.#'
12+
- '#PrestaShop.Module.Ps_Googleanalytics.Handler.ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop.Module.Ps_Googleanalytics.Handler.ModuleHandler does not extend any class.#'
13+
14+
level: 5

0 commit comments

Comments
 (0)