From 15e4eab12ab0d3ad98f02e8995f7aead9ec1f91f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Thu, 10 Nov 2022 08:12:37 +0000 Subject: [PATCH] Simplify PHPStan configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Viktor Szépe --- phpstan.neon.dist | 50 +++-------------------------------------------- 1 file changed, 3 insertions(+), 47 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 04f6035..a8f55c3 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,57 +1,13 @@ -#$ composer update --optimize-autoloader -#$ vendor/bin/phpstan analyze - -includes: - # @see https://github.com/phpstan/phpstan-src/blob/master/conf/bleedingEdge.neon - - phar://phpstan.phar/conf/bleedingEdge.neon - # Include this extension - # - vendor/szepeviktor/phpstan-wordpress/extension.neon parameters: level: 5 inferPrivatePropertyTypeFromConstructor: true bootstrapFiles: - tests/phpstan-bootstrap.php - - %rootDir%/../../php-stubs/wordpress-stubs/wordpress-stubs.php - # autoload_files: - # Missing constants, function and class stubs - # - tests/phpstan/bootstrap.php - # Plugin stubs - # - tests/phpstan/PLUGIN-stubs.php - # Procedural code - # - myplugin-functions.php - # autoload_directories: - # - inc/ paths: + - hello-login.php - includes/ - - ./ - excludePaths: - analyse: - - node_modules/ - - scripts/ - - tests/ - - tools/ - - vendor/ - - wordpress/ - analyseAndScan: - - wordpress/wp-content/uploads/ - # scanFiles: - # - includes/class.php - # scanDirectories: - # - wordpress ignoreErrors: # Uses func_get_args() - # - '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' - # Fixed in WordPress 5.3 - # - '#^Function do_action(_ref_array)? invoked with [3456] parameters, 1-2 required\.$#' - # - '#^Function current_user_can invoked with 2 parameters, 1 required\.$#' - # - '#^Function add_query_arg invoked with [123] parameters?, 0 required\.$#' - # - '#^Function wp_sprintf invoked with [23456] parameters, 1 required\.$#' - # - '#^Function add_post_type_support invoked with [345] parameters, 2 required\.$#' - # - '#^Function ((get|add)_theme_support|current_theme_supports) invoked with [2345] parameters, 1 required\.$#' - # https://core.trac.wordpress.org/ticket/43304 - # - '/^Parameter #2 \$deprecated of function load_plugin_textdomain expects string, false given\.$/' - # WP-CLI accepts a class as callable - # - '/^Parameter #2 \$callable of static method WP_CLI::add_command\(\) expects callable\(\): mixed, \S+ given\.$/' - # Please consider commenting ignores: issue URL or reason for ignoring + #- '#^Function apply_filters(_ref_array)? invoked with [34567] parameters, 2 required\.$#' # Ignore cookie_redirect_key deprecation errors. - - '/.*Access to deprecated property \$cookie_redirect_key.*/' + - '/^Access to deprecated property \$cookie_redirect_key/'