Skip to content

Commit 28abef8

Browse files
authored
Merge pull request #354 from wp-cli/dependabot/composer/wp-cli/wp-cli-tests-tw-5
2 parents 23a03d3 + 6479424 commit 28abef8

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
},
1717
"require-dev": {
1818
"wp-cli/extension-command": "^1.2 || ^2",
19-
"wp-cli/wp-cli-tests": "^4"
19+
"wp-cli/wp-cli-tests": "^5"
2020
},
2121
"config": {
2222
"process-timeout": 7200,
2323
"sort-packages": true,
2424
"allow-plugins": {
2525
"dealerdirect/phpcodesniffer-composer-installer": true,
26-
"johnpbloch/wordpress-core-installer": true
26+
"johnpbloch/wordpress-core-installer": true,
27+
"phpstan/extension-installer": true
2728
},
2829
"lock": false
2930
},
@@ -59,12 +60,14 @@
5960
"behat-rerun": "rerun-behat-tests",
6061
"lint": "run-linter-tests",
6162
"phpcs": "run-phpcs-tests",
63+
"phpstan": "run-phpstan-tests",
6264
"phpcbf": "run-phpcbf-cleanup",
6365
"phpunit": "run-php-unit-tests",
6466
"prepare-tests": "install-package-tests",
6567
"test": [
6668
"@lint",
6769
"@phpcs",
70+
"@phpstan",
6871
"@phpunit",
6972
"@behat"
7073
]

features/scaffold.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Feature: WordPress code scaffolding
231231
"""
232232
And the {PLUGIN_DIR}/hello-world/.phpcs.xml.dist file should contain:
233233
"""
234-
<config name="testVersion" value="5.6-"/>
234+
<config name="testVersion" value="7.2-"/>
235235
"""
236236
And the {PLUGIN_DIR}/hello-world/hello-world.php file should contain:
237237
"""

phpstan.neon.dist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
parameters:
2+
level: 9
3+
paths:
4+
- src
5+
- scaffold-command.php
6+
scanDirectories:
7+
- vendor/wp-cli/wp-cli/php
8+
scanFiles:
9+
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
10+
treatPhpDocTypesAsCertain: false
11+
ignoreErrors:
12+
- identifier: missingType.parameter
13+
- identifier: missingType.return

src/Scaffold_Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ private function scaffold_plugin_theme_tests( $args, $assoc_args, $type ) {
875875
$wp_versions_to_test = [];
876876
// Parse plugin readme.txt
877877
if ( file_exists( "{$target_dir}/readme.txt" ) ) {
878-
$readme_content = file_get_contents( "{$target_dir}/readme.txt" );
878+
$readme_content = (string) file_get_contents( "{$target_dir}/readme.txt" );
879879

880880
preg_match( '/Requires at least\:(.*)\n/m', $readme_content, $matches );
881881
if ( isset( $matches[1] ) && $matches[1] ) {
@@ -1045,7 +1045,7 @@ protected function log_whether_files_written( $files_written, $skip_message, $su
10451045
/**
10461046
* Extracts dashicon name when provided or return null otherwise.
10471047
*
1048-
* @param array $assoc_args
1048+
* @param array{dashicon?: string} $assoc_args
10491049
* @return string|null
10501050
*/
10511051
private function extract_dashicon( $assoc_args ) {

templates/.phpcs.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<!-- Rules: Check PHP version compatibility -->
2020
<!-- https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions -->
21-
<config name="testVersion" value="5.6-"/>
21+
<config name="testVersion" value="7.2-"/>
2222
<!-- https://github.com/PHPCompatibility/PHPCompatibilityWP -->
2323
<rule ref="PHPCompatibilityWP"/>
2424

0 commit comments

Comments
 (0)