From ea4afe2cca38531bd288b2d4efcdb226c7b28b65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Sat, 15 Jul 2017 19:48:42 +0200 Subject: [PATCH] Update phpstan --- .travis.yml | 2 +- composer-tools.json | 6 +++--- composer.json | 2 +- phpstan.neon | 5 +++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ab8257..569a19d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ before_script: script: - "! (composer outdated --direct | grep ^)" - vendor-tools/bin/php-cs-fixer fix --dry-run - - vendor-tools/bin/phpstan analyse --level=5 --configuration=phpstan.neon src tests + - vendor-tools/bin/phpstan analyse --level=7 --configuration=phpstan.neon src tests - vendor/bin/codecept run $coverage after_success: diff --git a/composer-tools.json b/composer-tools.json index 00d369e..9902e39 100644 --- a/composer-tools.json +++ b/composer-tools.json @@ -1,8 +1,8 @@ { "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0.0", - "phpstan/phpstan": "^0.6.3", - "phpstan/phpstan-nette": "^0.6.1" + "friendsofphp/php-cs-fixer": "@stable", + "phpstan/phpstan": "@stable", + "phpstan/phpstan-nette": "@stable" }, "config": { "vendor-dir": "vendor-tools" diff --git a/composer.json b/composer.json index 28fbb9a..cdbf5e0 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,7 @@ "@test" ], "fix": "\"vendor-tools/bin/php-cs-fixer\" fix", - "analyse": "\"vendor-tools/bin/phpstan\" analyse --no-progress --level=5 --configuration=phpstan.neon src tests", + "analyse": "\"vendor-tools/bin/phpstan\" analyse --no-progress --level=7 --configuration=phpstan.neon src tests", "test": [ "\"vendor/bin/codecept\" build", "\"vendor/bin/codecept\" run --debug" diff --git a/phpstan.neon b/phpstan.neon index 0c83ca4..008a5cd 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,9 +3,14 @@ includes: - vendor-tools/phpstan/phpstan-nette/rules.neon parameters: + excludes_analyse: + - %rootDir%/../../../tests/_* + ignoreErrors: - '#^Access to an undefined property Eloquent\\Phony\\Mock\\Handle\\InstanceHandle::\$[a-zA-Z]++#' - '#^Parameter \#[0-9]++ \$[a-zA-Z]++ of class [a-zA-Z\\]++ constructor expects [a-zA-Z\\]++, Eloquent\\Phony\\Mock\\Mock given#' - '#^Parameter \$[a-zA-Z]++ of method Tests\\Unit\\Classes\\[a-zA-Z]++::[a-zA-Z]++\(\) has invalid typehint type Tests\\Unit\\Classes\\[a-zA-Z0-9]++#' - '#^Property Tests\\Unit\\Classes\\[a-zA-Z]++::\$[a-zA-Z0-9]++ has unknown class Tests\\Unit\\Classes\\[a-zA-Z0-9]++ as its type#' - '#^Return typehint of method Tests\\Unit\\Classes\\TestPresenter::createComponentNonexistentComponent\(\) has invalid type Tests\\Unit\\Classes\\NonexistentComponent#' + - '#^Parameter \#1 \$reflection of method Arachne\\EntityLoader\\Application\\ParameterFinder::[a-zA-Z]++\(\) expects [a-zA-Z\\]++, Nette\\Application\\UI\\[a-zA-Z]+Reflection\|null given#' + - '#^Calling method [a-zA-Z]++\(\) on possibly nullable type Nette\\Application\\UI\\[a-zA-Z]+Reflection\|null#'