Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 14d3a32

Browse files
belgattitudeweierophinney
authored andcommitted
phpstan example
1 parent 7025aad commit 14d3a32

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
"filp/whoops": "^1.1.10 || ^2.1.13",
3838
"malukenho/docheader": "^0.1.6",
3939
"mockery/mockery": "^1.0",
40+
"phpstan/phpstan": "^0.9.2",
41+
"phpstan/phpstan-strict-rules": "^0.9.0",
4042
"phpunit/phpunit": "^7.0.1",
4143
"zendframework/zend-coding-standard": "~1.0.0",
4244
"zendframework/zend-expressive-aurarouter": "^3.0.0alpha2",
@@ -92,6 +94,7 @@
9294
],
9395
"cs-check": "phpcs",
9496
"cs-fix": "phpcbf",
97+
"phpstan": "phpstan analyze -l max -c phpstan.neon ./src",
9598
"test": "phpunit --colors=always",
9699
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml",
97100
"license-check": "docheader check src/ test/"

phpstan.neon

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
includes:
2+
- vendor/phpstan/phpstan-strict-rules/rules.neon
3+
parameters:
4+
fileExtensions:
5+
- php
6+
reportUnmatchedIgnoredErrors: true
7+
ignoreErrors:
8+
# Virtual classes can be safely ignored
9+
- '#Class Zend\\Expressive\\ApplicationPipeline not found#'
10+
- '#Class Zend\\Expressive\\ServerRequestErrorResponseGenerator not found.#'
11+
# @see src/Application.php and https://github.com/zendframework/zend-expressive/pull/564
12+
- '#Parameter \#1 \$path of function Zend\\Stratigility\\path expects string, array\|callable\|Psr\\Http\\Server\\MiddlewareInterface\|Psr\\Http\\Server\\RequestHandlerInterface\|string given.#'
13+
# @see src/Container/WhoopsFactory.php (zend-expressive supports Whoops 1.x)
14+
- '#Call to an undefined method Whoops\\Handler\\JsonResponseHandler::onlyForAjaxRequests\(\).#'
15+
# @see src/MiddlewareFactory
16+
- '#PHPDoc tag @param for parameter \$middleware with type array\|string\|Zend\\Stratigility\\MiddlewarePipe is not subtype of native type array\<int, mixed\>#'

0 commit comments

Comments
 (0)