Skip to content

Commit

Permalink
Merge pull request #57 from CZechBoY/phpstan-0.11
Browse files Browse the repository at this point in the history
Updated phpstan to 0.11 + added phpstan's rules for phpunit
  • Loading branch information
Majkl578 authored Mar 12, 2019
2 parents 16ca33e + aa9046c commit 2145e8c
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ vendor
coverage.clover
/phpcs.xml
/.phpcs-cache
/phpstan.neon
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ jobs:
php: 7.1
install: travis_retry composer install --prefer-dist
script:
- ./vendor/bin/phpstan analyse -c phpstan.neon -l max src
- ./vendor/bin/phpstan analyse -c phpstan.tests.neon -l max tests
- ./vendor/bin/phpstan analyse

- stage: Code Quality
env: BENCHMARK
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"ext-pdo": "*",
"doctrine/coding-standard": "^5.0",
"phpbench/phpbench": "^0.13",
"phpstan/phpstan-shim": "^0.9.2",
"phpstan/phpstan-phpunit": "^0.11",
"phpstan/phpstan-shim": "^0.11",
"phpunit/phpunit": "^7.0"
},
"autoload": {
Expand Down
75 changes: 67 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file removed phpstan.neon
Empty file.
19 changes: 19 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon

parameters:
level: max
paths:
- src
- tests

ignoreErrors:
-
message: '#::__construct\(\) does not call parent constructor from#'
path: '*/tests/DoctrineTest/InstantiatorTestAsset/*.php'

# dynamic properties confuse static analysis
-
message: '#Access to an undefined property object::\$foo\.#'
path: '*/tests/DoctrineTest/InstantiatorTest/InstantiatorTest.php'
6 changes: 0 additions & 6 deletions phpstan.tests.neon

This file was deleted.

0 comments on commit 2145e8c

Please sign in to comment.