Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize phpstan config #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"phpstan/phpstan": "^0.11.4",
"phpstan/phpstan-strict-rules": "^0.11.0",
"roave/security-advisories": "dev-master",
"roots/wordpress": "^5.1"
"szepeviktor/phpstan-wordpress": "dev-master"
},
"config": {
"sort-packages": true
Expand Down Expand Up @@ -74,6 +74,8 @@
},
"prefer-stable": true,
"scripts": {
"post-install-cmd": "PHPStan\\WordPress\\Composer\\FixWpStubs::php73Polyfill",
"post-update-cmd": "PHPStan\\WordPress\\Composer\\FixWpStubs::php73Polyfill",
"phpstan:analyse": "phpstan analyse",
"pretag": [
"composer update",
Expand Down
18 changes: 7 additions & 11 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
includes:
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/szepeviktor/phpstan-wordpress/extension.neon
parameters:
level: max
inferPrivatePropertyTypeFromConstructor: true
paths:
- %rootDir%/../../../src
autoload_directories:
- %rootDir%/../../../wordpress

autoload_files:
- %rootDir%/../../../wordpress/wp-includes/plugin.php

- %currentWorkingDirectory%/src/
ignoreErrors:
- '#Variable property access on PHPMailer.#'

includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- '#^Variable property access on PHPMailer\.$#'