Skip to content

Commit 28b587d

Browse files
authored
Merge pull request #37 from wp-cli/add/phpstan
2 parents 881a162 + df3d0cc commit 28b587d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
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+
- maintenance-mode-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/MaintenanceModeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private function get_maintenance_mode_status() {
142142
// to check if the maintenance is available.
143143
$upgrading = 0;
144144

145-
$contents = $wp_filesystem->get_contents( $maintenance_file );
145+
$contents = (string) $wp_filesystem->get_contents( $maintenance_file );
146146
$matches = [];
147147
if ( preg_match( '/upgrading\s*=\s*(\d+)\s*;/i', $contents, $matches ) ) {
148148
$upgrading = (int) $matches[1];

0 commit comments

Comments
 (0)