From 935f130a5e538ae55dd81e4a7fbca4a40894e85b Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Thu, 21 Dec 2023 12:38:19 +0100 Subject: [PATCH] Improve PHPStan config --- composer.json | 2 +- phpstan.neon.dist | 4 +- tests/phpstan/bootstrap.php | 11 ---- vendor-bin/phpstan/composer.json | 4 +- vendor-bin/phpstan/composer.lock | 108 +++++++++++++++---------------- 5 files changed, 59 insertions(+), 70 deletions(-) delete mode 100644 tests/phpstan/bootstrap.php diff --git a/composer.json b/composer.json index e4b22bb..bdfd50c 100644 --- a/composer.json +++ b/composer.json @@ -66,7 +66,7 @@ "pronamic/wp-coding-standards": "^2.1", "roots/wordpress": "^6.0", "wp-phpunit/wp-phpunit": "^6.1", - "wpackagist-plugin/ninja-forms": "3.5.4", + "wpackagist-plugin/ninja-forms": "^3.7", "yoast/phpunit-polyfills": "^1.0" }, "scripts": { diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 986a90b..886445f 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -3,7 +3,7 @@ includes: parameters: customRulesetUsed: false level: max - bootstrapFiles: - - tests/phpstan/bootstrap.php paths: - src/ + scanDirectories: + - wp-content/plugins/ninja-forms diff --git a/tests/phpstan/bootstrap.php b/tests/phpstan/bootstrap.php deleted file mode 100644 index abaf869..0000000 --- a/tests/phpstan/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * Definitions for PHPStan. - * - * @author Pronamic <info@pronamic.eu> - * @copyright 2005-2023 Pronamic - * @license GPL-3.0-or-later - * @package Pronamic\WordPress\Pay - */ - -define( 'SCRIPT_DEBUG', true ); diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index ec6f3e5..b47c8ff 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -1,6 +1,6 @@ { "require-dev": { - "phpstan/phpstan": "^0.12", - "szepeviktor/phpstan-wordpress": "^0.7" + "phpstan/phpstan": "^1.10", + "szepeviktor/phpstan-wordpress": "^1.3" } } diff --git a/vendor-bin/phpstan/composer.lock b/vendor-bin/phpstan/composer.lock index 34f49f6..141b6df 100644 --- a/vendor-bin/phpstan/composer.lock +++ b/vendor-bin/phpstan/composer.lock @@ -4,36 +4,36 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2975d5a40e0b75bbe13237236457f2a", + "content-hash": "8b16f4424fd097b4bd3897e05855d4d7", "packages": [], "packages-dev": [ { "name": "php-stubs/wordpress-stubs", - "version": "v5.9.5", + "version": "v6.4.1", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "13ecf204a7e6d215a7c0d23e2aa27940fe617717" + "reference": "6d6063cf9464a306ca2a0529705d41312b08500b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/13ecf204a7e6d215a7c0d23e2aa27940fe617717", - "reference": "13ecf204a7e6d215a7c0d23e2aa27940fe617717", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6d6063cf9464a306ca2a0529705d41312b08500b", + "reference": "6d6063cf9464a306ca2a0529705d41312b08500b", "shasum": "" }, - "replace": { - "giacocorsiglia/wordpress-stubs": "*" - }, "require-dev": { - "nikic/php-parser": "< 4.12.0", - "php": "~7.3 || ~8.0", - "php-stubs/generator": "^0.8.1", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "nikic/php-parser": "^4.13", + "php": "^7.4 || ~8.0.0", + "php-stubs/generator": "^0.8.3", "phpdocumentor/reflection-docblock": "^5.3", - "phpstan/phpstan": "^1.2" + "phpstan/phpstan": "^1.10.12", + "phpunit/phpunit": "^9.5", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", - "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" }, "type": "library", @@ -50,26 +50,26 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.5" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.4.1" }, - "time": "2022-11-09T05:32:14+00:00" + "time": "2023-11-10T00:33:47+00:00" }, { "name": "phpstan/phpstan", - "version": "0.12.100", + "version": "1.10.50", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "48236ddf823547081b2b153d1cd2994b784328c3" + "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/48236ddf823547081b2b153d1cd2994b784328c3", - "reference": "48236ddf823547081b2b153d1cd2994b784328c3", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/06a98513ac72c03e8366b5a0cb00750b487032e4", + "reference": "06a98513ac72c03e8366b5a0cb00750b487032e4", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.2|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -79,11 +79,6 @@ "phpstan.phar" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.12-dev" - } - }, "autoload": { "files": [ "bootstrap.php" @@ -94,9 +89,16 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/0.12.100" + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" }, "funding": [ { @@ -112,20 +114,20 @@ "type": "tidelift" } ], - "time": "2022-11-01T09:52:08+00:00" + "time": "2023-12-13T10:59:42+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -134,7 +136,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -175,7 +177,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -191,34 +193,38 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "szepeviktor/phpstan-wordpress", - "version": "v0.7.7", + "version": "v1.3.2", "source": { "type": "git", "url": "https://github.com/szepeviktor/phpstan-wordpress.git", - "reference": "bdbea69b2ba4a69998c3b6fe2b7106d78a23bd72" + "reference": "b8516ed6bab7ec50aae981698ce3f67f1be2e45a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/bdbea69b2ba4a69998c3b6fe2b7106d78a23bd72", - "reference": "bdbea69b2ba4a69998c3b6fe2b7106d78a23bd72", + "url": "https://api.github.com/repos/szepeviktor/phpstan-wordpress/zipball/b8516ed6bab7ec50aae981698ce3f67f1be2e45a", + "reference": "b8516ed6bab7ec50aae981698ce3f67f1be2e45a", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0", - "php-stubs/wordpress-stubs": "^4.7 || ^5.0", - "phpstan/phpstan": "^0.12.26", + "php": "^7.2 || ^8.0", + "php-stubs/wordpress-stubs": "^4.7 || ^5.0 || ^6.0", + "phpstan/phpstan": "^1.10.30", "symfony/polyfill-php73": "^1.12.0" }, "require-dev": { - "composer/composer": "^1.10.22", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "composer/composer": "^2.1.14", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.1", - "phpstan/phpstan-strict-rules": "^0.12", - "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.6" + "phpstan/phpstan-strict-rules": "^1.2", + "phpunit/phpunit": "^8.0 || ^9.0", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.8" + }, + "suggest": { + "swissspidy/phpstan-no-private": "Detect usage of internal core functions, classes and methods" }, "type": "phpstan-extension", "extra": { @@ -247,15 +253,9 @@ ], "support": { "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", - "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v0.7.7" + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.3.2" }, - "funding": [ - { - "url": "https://www.paypal.me/szepeviktor", - "type": "custom" - } - ], - "time": "2021-07-14T09:19:15+00:00" + "time": "2023-10-16T17:23:56+00:00" } ], "aliases": [], @@ -265,5 +265,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" }