diff --git a/composer.json b/composer.json index c3250787..57be4bae 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "php": ">=7.2.24", "behat/behat": "^v3.15.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || ^0.5 || ^0.6.2 || ^0.7.1 || ^1.0.0", + "johnbillion/wp-compat": "^2.0", "php-parallel-lint/php-console-highlighter": "^1.0", "php-parallel-lint/php-parallel-lint": "^1.3.1", "phpcompatibility/php-compatibility": "^10.0", diff --git a/extension.neon b/extension.neon index 10b46abc..ae427506 100644 --- a/extension.neon +++ b/extension.neon @@ -29,6 +29,10 @@ rules: parameters: dynamicConstantNames: - FOO + WPCompat: + pluginFile: null + # Oldest WordPress version supported by WP-CLI. + requiresAtLeast: '4.9' strictRules: allRules: false disallowedLooseComparison: false @@ -53,9 +57,13 @@ parameters: dynamicCallOnStaticMethod: false illegalConstructorMethodCall: false -# Add the schema from phpstan-strict-rules so it's available without loading the extension -# and the above configuration works. +# Add the schemas from phpstan-strict-rules and wp-compat so they're available without +# loading the extensions and the above configuration works. parametersSchema: + WPCompat: structure([ + pluginFile: schema(string(), nullable()) + requiresAtLeast: schema(string(), nullable()) + ]) strictRules: structure([ allRules: anyOf(bool(), arrayOf(bool())), disallowedLooseComparison: anyOf(bool(), arrayOf(bool())),