@@ -851,7 +851,7 @@ private static function modify_wp_config( $content ) {
851851 $ wp_config_path = Utils \locate_wp_config ();
852852
853853 $ token = "/* That's all, stop editing! " ;
854- $ config_contents = file_get_contents ( $ wp_config_path );
854+ $ config_contents = ( string ) file_get_contents ( $ wp_config_path );
855855 if ( false === strpos ( $ config_contents , $ token ) ) {
856856 return false ;
857857 }
@@ -1121,6 +1121,10 @@ public function update( $args, $assoc_args ) {
11211121
11221122 // Update to next release
11231123 wp_version_check ();
1124+
1125+ /**
1126+ * @var object{updates: array<object{version: string, locale: string}>} $from_api
1127+ */
11241128 $ from_api = get_site_transient ( 'update_core ' );
11251129
11261130 if ( Utils \get_flag_value ( $ assoc_args , 'minor ' ) ) {
@@ -1185,7 +1189,12 @@ public function update( $args, $assoc_args ) {
11851189 $ insecure = (bool ) Utils \get_flag_value ( $ assoc_args , 'insecure ' , false );
11861190
11871191 $ GLOBALS ['wpcli_core_update_obj ' ] = $ update ;
1188- $ result = Utils \get_upgrader ( $ upgrader , $ insecure )->upgrade ( $ update );
1192+
1193+ /**
1194+ * @var \WP_CLI\Core\CoreUpgrader $wp_upgrader
1195+ */
1196+ $ wp_upgrader = Utils \get_upgrader ( $ upgrader , $ insecure );
1197+ $ result = $ wp_upgrader ->upgrade ( $ update );
11891198 unset( $ GLOBALS ['wpcli_core_update_obj ' ] );
11901199
11911200 if ( is_wp_error ( $ result ) ) {
@@ -1379,6 +1388,10 @@ private function get_download_url( $version, $locale = 'en_US', $file_type = 'zi
13791388 private function get_updates ( $ assoc_args ) {
13801389 $ force_check = (bool ) Utils \get_flag_value ( $ assoc_args , 'force-check ' );
13811390 wp_version_check ( [], $ force_check );
1391+
1392+ /**
1393+ * @var object{updates: array<object{version: string, locale: string, packages: object{partial?: string, full: string}}>}|false $from_api
1394+ */
13821395 $ from_api = get_site_transient ( 'update_core ' );
13831396 if ( ! $ from_api ) {
13841397 return [];
0 commit comments