Skip to content

Commit

Permalink
Merge pull request #938 from carstingaxion/fix/phpstan-ignores-2-stubs
Browse files Browse the repository at this point in the history
Fix phpstan: Use stubs, instead of ignoring
  • Loading branch information
mauteri authored Oct 4, 2024
2 parents bf43ad6 + 588aa25 commit fd44c01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
16 changes: 1 addition & 15 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ parameters:
bootstrapFiles:
# Constants, functions, etc. used by GatherPress
- phpstan.stubs
# - vendor/pmc/unit-test/src/classes/autoloader.php
# - vendor/autoload.php
# - gatherpress.php

parallel:
maximumNumberOfProcesses: 1
processTimeout: 300.0
Expand All @@ -23,20 +21,8 @@ parameters:

paths:
- includes/
# - test/

# excludePaths:
# analyse:
# - vendor/

ignoreErrors:
- '#^Constant GATHERPRESS_CACHE_GROUP not found\.$#'
- '#^Constant GATHERPRESS_CORE_FILE not found\.$#'
- '#^Constant GATHERPRESS_CORE_PATH not found\.$#'
- '#^Constant GATHERPRESS_CORE_URL not found\.$#'
- '#^Constant GATHERPRESS_REST_NAMESPACE not found\.$#'
- '#^Constant GATHERPRESS_REQUIRES_PHP not found\.$#'

# core/classes/class-setup.php
#
# A dev-only error, which can occur if the gatherpress is symlinked into a WP instance or called via wp-env or Playground.
Expand Down
8 changes: 8 additions & 0 deletions phpstan.stubs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
*/

namespace {

define( 'GATHERPRESS_CACHE_GROUP', '');
define( 'GATHERPRESS_CORE_FILE', './gatherpress.php');
define( 'GATHERPRESS_CORE_PATH', '.');
define( 'GATHERPRESS_CORE_URL', '');
define( 'GATHERPRESS_REST_NAMESPACE', '');
define( 'GATHERPRESS_REQUIRES_PHP', '');

/**
* Used in includes/core/classes/class-export.php
*
Expand Down

0 comments on commit fd44c01

Please sign in to comment.