Skip to content

Commit 8110d2a

Browse files
authored
Fix PHPStan errors (#348)
1 parent ae82325 commit 8110d2a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎src/Core_Command.php‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ private function multisite_convert_( $assoc_args ) {
917917
$wp_config_path = Utils\locate_wp_config();
918918
if ( true === Utils\get_flag_value( $assoc_args, 'skip-config' ) ) {
919919
WP_CLI::log( "Addition of multisite constants to 'wp-config.php' skipped. You need to add them manually:\n{$ms_config}" );
920-
} elseif ( is_writable( $wp_config_path ) && self::modify_wp_config( $ms_config ) ) {
920+
} elseif ( false !== $wp_config_path && is_writable( $wp_config_path ) && self::modify_wp_config( $ms_config ) ) {
921921
WP_CLI::log( "Added multisite constants to 'wp-config.php'." );
922922
} else {
923923
WP_CLI::warning( "Multisite constants could not be written to 'wp-config.php'. You may need to add them manually:\n{$ms_config}" );
@@ -996,6 +996,9 @@ private static function add_site_admins( $site_user ) {
996996

997997
private static function modify_wp_config( $content ) {
998998
$wp_config_path = Utils\locate_wp_config();
999+
if ( false === $wp_config_path ) {
1000+
return false;
1001+
}
9991002

10001003
$token = "/* That's all, stop editing!";
10011004
$config_contents = (string) file_get_contents( $wp_config_path );

0 commit comments

Comments
 (0)