-
-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Using PHP 7.4 I am getting the following error when running phpstan with the phpstan-wordpress extension enabled:
ParseError thrown in vendor/php-stubs/wordpress-stubs/wordpress-stubs.php on line 7343 while loading bootstrap file vendor/php-stubs/wordpress-stubs/wordpress-stubs.php: syntax error, unexpected '{', expecting variable (T_VARIABLE)
This is my phpstan.neon file:
parameters:
level: 2
bootstrapFiles:
- bootstrap.php
paths:
- src
excludePaths:
- src/Vendor/
ignoreErrors:
- '#Using self outside of class scope.#'
- '#WP_CLI#'
- '#Variable \$\w+ might not be defined.#'
- '#Calling self::\w+\(\) outside of class scope.#'
- '#Function pll_(.*) not found.#'
includes:
- vendor/szepeviktor/phpstan-wordpress/extension.neon
and this is my output from php -v:
PHP 7.4.33 (cli) (built: Oct 11 2025 23:03:42) ( NTS )
I am using the following:
- phpstan 2.1.32
- phpstan-wordpress 2.0
Metadata
Metadata
Assignees
Labels
No labels