Skip to content

Commit fd44c01

Browse files
authored
Merge pull request #938 from carstingaxion/fix/phpstan-ignores-2-stubs
Fix phpstan: Use stubs, instead of ignoring
2 parents bf43ad6 + 588aa25 commit fd44c01

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

phpstan.neon.dist

+1-15
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ parameters:
1010
bootstrapFiles:
1111
# Constants, functions, etc. used by GatherPress
1212
- phpstan.stubs
13-
# - vendor/pmc/unit-test/src/classes/autoloader.php
14-
# - vendor/autoload.php
15-
# - gatherpress.php
13+
1614
parallel:
1715
maximumNumberOfProcesses: 1
1816
processTimeout: 300.0
@@ -23,20 +21,8 @@ parameters:
2321

2422
paths:
2523
- includes/
26-
# - test/
27-
28-
# excludePaths:
29-
# analyse:
30-
# - vendor/
3124

3225
ignoreErrors:
33-
- '#^Constant GATHERPRESS_CACHE_GROUP not found\.$#'
34-
- '#^Constant GATHERPRESS_CORE_FILE not found\.$#'
35-
- '#^Constant GATHERPRESS_CORE_PATH not found\.$#'
36-
- '#^Constant GATHERPRESS_CORE_URL not found\.$#'
37-
- '#^Constant GATHERPRESS_REST_NAMESPACE not found\.$#'
38-
- '#^Constant GATHERPRESS_REQUIRES_PHP not found\.$#'
39-
4026
# core/classes/class-setup.php
4127
#
4228
# A dev-only error, which can occur if the gatherpress is symlinked into a WP instance or called via wp-env or Playground.

phpstan.stubs

+8
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@
55
*/
66

77
namespace {
8+
9+
define( 'GATHERPRESS_CACHE_GROUP', '');
10+
define( 'GATHERPRESS_CORE_FILE', './gatherpress.php');
11+
define( 'GATHERPRESS_CORE_PATH', '.');
12+
define( 'GATHERPRESS_CORE_URL', '');
13+
define( 'GATHERPRESS_REST_NAMESPACE', '');
14+
define( 'GATHERPRESS_REQUIRES_PHP', '');
15+
816
/**
917
* Used in includes/core/classes/class-export.php
1018
*

0 commit comments

Comments
 (0)