diff --git a/composer.json b/composer.json index 225188a8..dee763ad 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "format": "phpcbf --standard=phpcs.xml --report-summary --report-source", "lint": "phpcs --standard=phpcs.xml", "phpstan": "phpstan", - "phpstan:generate:baseline": "phpstan --generate-baseline" + "phpstan:generate:baseline": "phpstan --generate-baseline --memory-limit=2G" }, "minimum-stability": "dev", "prefer-stable": true, diff --git a/composer.lock b/composer.lock index 4717227f..4894cf59 100644 --- a/composer.lock +++ b/composer.lock @@ -565,16 +565,16 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v6.8.2", + "version": "v6.9.1", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "9c8e22e437463197c1ec0d5eaa9ddd4a0eb6d7f8" + "reference": "f12220f303e0d7c0844c0e5e957b0c3cee48d2f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/9c8e22e437463197c1ec0d5eaa9ddd4a0eb6d7f8", - "reference": "9c8e22e437463197c1ec0d5eaa9ddd4a0eb6d7f8", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/f12220f303e0d7c0844c0e5e957b0c3cee48d2f7", + "reference": "f12220f303e0d7c0844c0e5e957b0c3cee48d2f7", "shasum": "" }, "conflict": { @@ -585,9 +585,10 @@ "nikic/php-parser": "^5.5", "php": "^7.4 || ^8.0", "php-stubs/generator": "^0.8.3", - "phpdocumentor/reflection-docblock": "^5.4.1", + "phpdocumentor/reflection-docblock": "^6.0", "phpstan/phpstan": "^2.1", "phpunit/phpunit": "^9.5", + "symfony/polyfill-php80": "*", "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^1.1.1", "wp-coding-standards/wpcs": "3.1.0 as 2.3.0" }, @@ -610,9 +611,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.8.2" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.9.1" }, - "time": "2025-07-16T06:41:00+00:00" + "time": "2026-02-03T19:29:21+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -820,11 +821,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.1.33", + "version": "2.1.40", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f", - "reference": "9e800e6bee7d5bd02784d4c6069b48032d16224f", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", + "reference": "9b2c7aeb83a75d8680ea5e7c9b7fca88052b766b", "shasum": "" }, "require": { @@ -869,7 +870,7 @@ "type": "github" } ], - "time": "2025-12-05T10:24:31+00:00" + "time": "2026-02-23T15:04:35+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2394,16 +2395,16 @@ }, { "name": "szepeviktor/phpstan-wordpress", - "version": "v2.0.2", + "version": "v2.0.3", "source": { "type": "git", "url": "https://github.com/szepeviktor/phpstan-wordpress.git", - "reference": "963887b04c21fe7ac78e61c1351f8b00fff9f8f8" + "reference": "aa722f037b2d034828cd6c55ebe9e5c74961927e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/963887b04c21fe7ac78e61c1351f8b00fff9f8f8", - "reference": "963887b04c21fe7ac78e61c1351f8b00fff9f8f8", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/aa722f037b2d034828cd6c55ebe9e5c74961927e", + "reference": "aa722f037b2d034828cd6c55ebe9e5c74961927e", "shasum": "" }, "require": { @@ -2413,6 +2414,7 @@ }, "require-dev": { "composer/composer": "^2.1.14", + "composer/semver": "^3.4", "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.1", "phpstan/phpstan-strict-rules": "^2.0", @@ -2450,9 +2452,9 @@ ], "support": { "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", - "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v2.0.2" + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v2.0.3" }, - "time": "2025-02-12T18:43:37+00:00" + "time": "2025-09-14T02:58:22+00:00" }, { "name": "theseer/tokenizer", diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index a96b74d5..814cf6b8 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -7,7 +7,7 @@ parameters: path: classes/Visualizer/Gutenberg/Block.php - - message: '#^Call to function is_wp_error\(\) with string will always evaluate to false\.$#' + message: '#^Call to function is_wp_error\(\) with non\-empty\-string will always evaluate to false\.$#' identifier: function.impossibleType count: 1 path: classes/Visualizer/Gutenberg/Block.php @@ -36,12 +36,6 @@ parameters: count: 1 path: classes/Visualizer/Gutenberg/Block.php - - - message: '#^Method Visualizer_Gutenberg_Block\:\:add_rest_query_vars\(\) has parameter \$request with generic class WP_REST_Request but does not specify its types\: T$#' - identifier: missingType.generics - count: 1 - path: classes/Visualizer/Gutenberg/Block.php - - message: '#^Method Visualizer_Gutenberg_Block\:\:enqueue_gutenberg_scripts\(\) has no return type specified\.$#' identifier: missingType.return @@ -204,6 +198,12 @@ parameters: count: 1 path: classes/Visualizer/Gutenberg/Block.php + - + message: '#^Unable to resolve the template type TUrl in call to function wp_http_validate_url$#' + identifier: argument.templateType + count: 1 + path: classes/Visualizer/Gutenberg/Block.php + - message: '#^Constant VISUALIZER_PRO_VERSION not found\.$#' identifier: constant.notFound @@ -1386,6 +1386,12 @@ parameters: count: 1 path: classes/Visualizer/Module/Chart.php + - + message: '#^Unable to resolve the template type TUrl in call to function wp_http_validate_url$#' + identifier: argument.templateType + count: 1 + path: classes/Visualizer/Module/Chart.php + - message: '#^Undefined variable\: \$atts$#' identifier: variable.undefined @@ -1512,12 +1518,6 @@ parameters: count: 1 path: classes/Visualizer/Module/Frontend.php - - - message: '#^Method Visualizer_Module_Frontend\:\:perform_action\(\) has parameter \$params with generic class WP_REST_Request but does not specify its types\: T$#' - identifier: missingType.generics - count: 1 - path: classes/Visualizer/Module/Frontend.php - - message: '#^Method Visualizer_Module_Frontend\:\:printFooterScripts\(\) has no return type specified\.$#' identifier: missingType.return @@ -2034,12 +2034,6 @@ parameters: count: 1 path: classes/Visualizer/Module/Wizard.php - - - message: '#^Path in include_once\(\) "\./wp\-admin/includes/plugin\-install\.php" is not a file or it does not exist\.$#' - identifier: includeOnce.fileNotFound - count: 1 - path: classes/Visualizer/Module/Wizard.php - - message: '#^Property Visualizer_Module_Wizard\:\:\$wizard_data has no type specified\.$#' identifier: missingType.property diff --git a/phpstan.neon b/phpstan.neon index d0545aa5..6840d0ec 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -10,10 +10,6 @@ parameters: - %currentWorkingDirectory%/vendor/neitanod/forceutf8 - %currentWorkingDirectory%/vendor/openspout/openspout - %currentWorkingDirectory%/vendor/codeinwp/themeisle-sdk - ignoreErrors: - - - identifiers: - - requireOnce.fileNotFound includes: - %currentWorkingDirectory%/vendor/szepeviktor/phpstan-wordpress/extension.neon - %currentWorkingDirectory%/phpstan-baseline.neon