Skip to content

Commit

Permalink
Ignore the (evil) usage of constants, opened #37
Browse files Browse the repository at this point in the history
  • Loading branch information
carstingaxion committed Aug 10, 2023
1 parent 25e4dcc commit ee700d1
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#$ vendor/bin/phpstan analyze

includes:
# Include this extension, if not already autoloaded via composer
# - vendor/szepeviktor/phpstan-wordpress/extension.neon
parameters:
level: max
# had to leave level:max after reading this: https://github.com/phpstan/phpstan/issues/5927
level: 8
inferPrivatePropertyTypeFromConstructor: true
paths:
- inc/
Expand All @@ -15,7 +18,17 @@ parameters:
# and not running within ft-platform
- wp-content/
- tests/
# @todo #37 Find a nicer way instead of ignoring this Error on every ft-module
ignoreErrors:
# @todo #37 Find a nicer way instead of ignoring this Error on every ft-module
- '#Constant WP_CONTENT_DIR not found\.#'
- '#Constant WPMU_PLUGIN_URL not found\.#'
- '#Constant DISABLE_WP_CRON not found\.#'
- '#Constant WP_ENVIRONMENT_TYPE not found\.#'
- '#Function Altis\\register_module not found\.#'
- '#Function Figuren_Theater\\get_config not found\.#'

# allow constants to have different values in different environments
# to prevent errors like: "Right side of && is always false."
# @see https://phpstan.org/config-reference#constants
dynamicConstantNames:
- FT_MAINTENANCE_MODE

0 comments on commit ee700d1

Please sign in to comment.