src/WP_CLI/Core/CoreUpgrader.php
public function upgrade( $current, $args = [] ) {
		set_error_handler( [ __CLASS__, 'error_handler' ], E_USER_WARNING | E_USER_NOTICE );

		$result = parent::upgrade( $current, $args );

		restore_error_handler();

		return $result;
	}
public function upgrade( $current, $args = [] ) {
		set_error_handler( [ __CLASS__, 'error_handler' ], E_USER_WARNING | E_USER_NOTICE );

		$result = parent::upgrade( $current, $args );

		restore_error_handler();

		return $result;
	}
Upgrade WordPress core.

@access public

@global WP_Filesystem_Base $wp_filesystem Subclass
@global callable           $_wp_filesystem_direct_method

@param object $current Response object for whether WordPress is current.
@param array  $args {
Optional. Arguments for upgrading WordPress core. Default empty array.

@type bool $pre_check_md5    Whether to check the file checksums before
attempting the upgrade. Default true.
@type bool $attempt_rollback Whether to attempt to rollback the chances if
there is a problem. Default false.
@type bool $do_rollback      Whether to perform this "upgrade" as a rollback.
Default false.
}
@return null|false|WP_Error False or WP_Error on failure, null on success.