Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@
},
"require-dev": {
"wp-cli/extension-command": "^1.2 || ^2",
"wp-cli/wp-cli-tests": "^4"
"wp-cli/wp-cli-tests": "^5"
},
"config": {
"process-timeout": 7200,
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"johnpbloch/wordpress-core-installer": true
"johnpbloch/wordpress-core-installer": true,
"phpstan/extension-installer": true
},
"lock": false
},
Expand Down Expand Up @@ -59,12 +60,14 @@
"behat-rerun": "rerun-behat-tests",
"lint": "run-linter-tests",
"phpcs": "run-phpcs-tests",
"phpstan": "run-phpstan-tests",
"phpcbf": "run-phpcbf-cleanup",
"phpunit": "run-php-unit-tests",
"prepare-tests": "install-package-tests",
"test": [
"@lint",
"@phpcs",
"@phpstan",
"@phpunit",
"@behat"
]
Expand Down
2 changes: 1 addition & 1 deletion features/scaffold.feature
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Feature: WordPress code scaffolding
"""
And the {PLUGIN_DIR}/hello-world/.phpcs.xml.dist file should contain:
"""
<config name="testVersion" value="5.6-"/>
<config name="testVersion" value="7.2-"/>
"""
And the {PLUGIN_DIR}/hello-world/hello-world.php file should contain:
"""
Expand Down
13 changes: 13 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
parameters:
level: 9
paths:
- src
- scaffold-command.php
scanDirectories:
- vendor/wp-cli/wp-cli/php
scanFiles:
- vendor/php-stubs/wordpress-stubs/wordpress-stubs.php
treatPhpDocTypesAsCertain: false
ignoreErrors:
- identifier: missingType.parameter
- identifier: missingType.return
4 changes: 2 additions & 2 deletions src/Scaffold_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,7 @@ private function scaffold_plugin_theme_tests( $args, $assoc_args, $type ) {
$wp_versions_to_test = [];
// Parse plugin readme.txt
if ( file_exists( "{$target_dir}/readme.txt" ) ) {
$readme_content = file_get_contents( "{$target_dir}/readme.txt" );
$readme_content = (string) file_get_contents( "{$target_dir}/readme.txt" );

preg_match( '/Requires at least\:(.*)\n/m', $readme_content, $matches );
if ( isset( $matches[1] ) && $matches[1] ) {
Expand Down Expand Up @@ -1045,7 +1045,7 @@ protected function log_whether_files_written( $files_written, $skip_message, $su
/**
* Extracts dashicon name when provided or return null otherwise.
*
* @param array $assoc_args
* @param array{dashicon?: string} $assoc_args
* @return string|null
*/
private function extract_dashicon( $assoc_args ) {
Expand Down
2 changes: 1 addition & 1 deletion templates/.phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

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

Expand Down