Skip to content

Commit e1ff83b

Browse files
authored
Fix PHPStan errors with WordPress 7.1 stubs (#44)
1 parent 7ce3b13 commit e1ff83b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/MaintenanceModeCommand.php‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,13 @@ public function is_active() {
132132
private function get_maintenance_mode_status() {
133133
$wp_filesystem = $this->init_wp_filesystem();
134134

135-
$maintenance_file = trailingslashit( $wp_filesystem->abspath() ) . '.maintenance';
135+
$abspath = $wp_filesystem->abspath();
136+
137+
if ( false === $abspath ) {
138+
WP_CLI::error( 'Could not determine the WordPress root directory.' );
139+
}
140+
141+
$maintenance_file = trailingslashit( $abspath ) . '.maintenance';
136142

137143
if ( ! $wp_filesystem->exists( $maintenance_file ) ) {
138144
return false;

0 commit comments

Comments
 (0)