From 301c6ff2449a1b3ae44cbdbcae335e731a3c4a8d Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Wed, 15 May 2024 10:24:03 +0545 Subject: [PATCH 1/2] Add phpstan settings --- bin/run-phpstan-tests | 7 +++++++ composer.json | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100755 bin/run-phpstan-tests diff --git a/bin/run-phpstan-tests b/bin/run-phpstan-tests new file mode 100755 index 000000000..f0a311682 --- /dev/null +++ b/bin/run-phpstan-tests @@ -0,0 +1,7 @@ +#!/bin/sh + +# Run the code style check only if a configuration file exists. +if [ -f "phpstan.dist.neon" ] || [ -f "phpstan.neon.dist" ] || [ -f "phpstan.neon" ] +then + vendor/bin/phpstan analyse "$@" +fi diff --git a/composer.json b/composer.json index 90f8a12e4..88aee415c 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,9 @@ "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.3.5", + "phpstan/extension-installer": "^1.3", + "phpstan/phpstan": "^1.11", + "szepeviktor/phpstan-wordpress": "^1.3", "wp-cli/config-command": "^1 || ^2", "wp-cli/core-command": "^1 || ^2", "wp-cli/eval-command": "^1 || ^2", @@ -28,7 +31,8 @@ "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true, - "johnpbloch/wordpress-core-installer": true + "johnpbloch/wordpress-core-installer": true, + "phpstan/extension-installer": true }, "sort-packages": true }, @@ -62,7 +66,8 @@ "bin/run-linter-tests", "bin/run-php-unit-tests", "bin/run-phpcs-tests", - "bin/run-phpcbf-cleanup" + "bin/run-phpcbf-cleanup", + "bin/run-phpstan-tests" ], "scripts": { "behat": "run-behat-tests", @@ -70,11 +75,13 @@ "lint": "run-linter-tests", "phpcs": "run-phpcs-tests", "phpcbf": "run-phpcbf-cleanup", + "phpstan": "run-phpstan-tests", "phpunit": "run-php-unit-tests", "prepare-tests": "install-package-tests", "test": [ "@lint", "@phpcs", + "@phpstan", "@phpunit", "@behat" ] From 23714119165b883b9e0d7c7653cf4392c4de4759 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Thu, 16 May 2024 11:57:57 +0545 Subject: [PATCH 2/2] Update multiple dependencies --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 88aee415c..e202554d7 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,9 @@ "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^9.3.5", - "phpstan/extension-installer": "^1.3", - "phpstan/phpstan": "^1.11", - "szepeviktor/phpstan-wordpress": "^1.3", + "phpstan/extension-installer": "^1.0.5 || ^1.2.0 || ^1.3", + "phpstan/phpstan": "^0.1 || ^1.11", + "szepeviktor/phpstan-wordpress": "^1.0.5 || ^1.3", "wp-cli/config-command": "^1 || ^2", "wp-cli/core-command": "^1 || ^2", "wp-cli/eval-command": "^1 || ^2",