From 7b13da98cd008eb4b5b5b5d59639ad2377452ab9 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Sat, 2 Jun 2018 22:37:32 +0200 Subject: [PATCH] Added phpstan - Added phpstan/phpstan - Added bootstrap file - Added phpstan config - Added ci file - Added to CI matrix Signed-off-by: William Desportes --- .travis.yml | 4 ++++ composer.json | 3 ++- phpstan.neon | 7 +++++++ test/bootstrap-phpstan.php | 19 +++++++++++++++++++ test/ci-install-phpstan | 3 +++ test/ci-phpstan | 7 +++++++ 6 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 phpstan.neon create mode 100644 test/bootstrap-phpstan.php create mode 100755 test/ci-install-phpstan create mode 100755 test/ci-phpstan diff --git a/.travis.yml b/.travis.yml index 7945ea4e3a..17a7625d06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,6 +66,8 @@ matrix: env: CI_MODE=docs - php: "7.1" env: CI_MODE=apidocs + - php: "7.2" + env: CI_MODE=phpstan - os: osx language: generic env: CI_MODE=test @@ -80,6 +82,8 @@ matrix: allow_failures: - php: "nightly" env: CI_MODE=test + - php: "7.2" + env: CI_MODE=phpstan cache: pip: true diff --git a/composer.json b/composer.json index f998ed661e..8cffd580a1 100644 --- a/composer.json +++ b/composer.json @@ -87,7 +87,8 @@ "pragmarx/google2fa": "^3.0", "bacon/bacon-qr-code": "^1.0", "samyoul/u2f-php-server": "^1.1", - "phpmyadmin/coding-standard": "^0.3" + "phpmyadmin/coding-standard": "^0.3", + "phpstan/phpstan": "^0.9.2" }, "extra": { "branch-alias": { diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000000..5a3a925680 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,7 @@ +parameters: + bootstrap: %rootDir%/../../../test/bootstrap-phpstan.php + ignoreErrors: + - '#Unexpected token "&", expected TOKEN_VARIABLE at offset#' + excludes_analyse: + - %rootDir%/../../../tmp/* + - %rootDir%/../../../vendor/* diff --git a/test/bootstrap-phpstan.php b/test/bootstrap-phpstan.php new file mode 100644 index 0000000000..3fe2a6a85e --- /dev/null +++ b/test/bootstrap-phpstan.php @@ -0,0 +1,19 @@ +