Skip to content

Commit 1dc0d16

Browse files
committed
PHPStan level 9
1 parent aa2d899 commit 1dc0d16

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

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 ) {

0 commit comments

Comments
 (0)