Browse Source

Improving PHPStan configuration

Ondrej Mirtes 9 years ago
parent
commit
105058546a
2 changed files with 12 additions and 1 deletions
  1. 1 1
      .travis.yml
  2. 11 0
      phpstan.neon

+ 1 - 1
.travis.yml

@@ -96,7 +96,7 @@ script:
 
   - if [[ $PHPCS = 1 ]]; then composer cs-check; fi
   - if [[ $PHPCS = 3 ]]; then vendor/bin/phpcs -p -s --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi
-  - if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:dev-master && vendor/bin/phpstan analyse -c phpstan.neon -l 0 src; fi
+  - if [[ $PHPSTAN = 1 ]]; then composer require --dev phpstan/phpstan:^0.5.1 && vendor/bin/phpstan analyse -c phpstan.neon -l 0 src; fi
 
 after_success:
   - if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then bash <(curl -s https://codecov.io/bash); fi

+ 11 - 0
phpstan.neon

@@ -1,3 +1,14 @@
 parameters:
 	autoload_files:
 		- %rootDir%/../../../src/basics.php
+	ignoreErrors:
+		- '#Function wincache_ucache_[a-zA-Z0-9_]+ not found#'
+		- '#Function xcache_[a-zA-Z0-9_]+ not found#'
+		- '#Function fastcgi_[a-zA-Z0-9_]+ not found#'
+		- '#Function apache_[a-zA-Z0-9_]+ not found#'
+		- '#Cake\\Database\\Type\\[a-zA-Z0-9_]+Type::__construct\(\) does not call parent constructor from Cake\\Database\\Type#'
+		- '#Constructor of class Cake\\[a-zA-Z0-9_\\]+ has an unused parameter#'
+		- '#Call to an undefined method Cake\\Console\\Shell::main\(\)#'
+		- '#Access to undefined constant Memcached::OPT_CLIENT_MODE#'
+		- '#Access to undefined constant Memcached::DYNAMIC_CLIENT_MODE#'
+		- '#Access to undefined constant PDO::SQLSRV_ENCODING_BINARY#'