@@ -1003,7 +1003,7 @@ private static function migrate_install_plan_to_plan_id( FS_Storage $storage, $b
10031003
10041004 if ( isset( $install->plan ) && is_object( $install->plan ) ) {
10051005 if ( isset( $install->plan->id ) && ! empty( $install->plan->id ) ) {
1006- $install->plan_id = self::_decrypt( $install->plan->id ); // @phpstan-ignore-line
1006+ $install->plan_id = self::_decrypt( $install->plan->id );
10071007 }
10081008
10091009 unset( $install->plan );
@@ -1564,8 +1564,8 @@ private function register_constructor_hooks() {
15641564 );
15651565 $this->add_filter( 'after_code_type_change', array( &$this, '_after_code_type_change' ) );
15661566
1567- add_action( 'admin_init', array( &$this, '_add_trial_notice' ) ); // @phpstan-ignore-line
1568- add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) ); // @phpstan-ignore-line
1567+ add_action( 'admin_init', array( &$this, '_add_trial_notice' ) );
1568+ add_action( 'admin_init', array( &$this, '_add_affiliate_program_notice' ) );
15691569 add_action( 'admin_enqueue_scripts', array( &$this, '_enqueue_common_css' ) );
15701570
15711571 /**
@@ -1882,7 +1882,7 @@ private function clear_module_main_file_cache( $store_prev_path = true ) {
18821882 $plugin_main_file = clone $this->_storage->plugin_main_file;
18831883
18841884 // Store cached path (2nd layer cache).
1885- $plugin_main_file->prev_path = $plugin_main_file->path; // @phpstan-ignore-line
1885+ $plugin_main_file->prev_path = $plugin_main_file->path;
18861886
18871887 // Clear cached path.
18881888 unset( $plugin_main_file->path );
@@ -8016,7 +8016,6 @@ private function maybe_network_activate_addon_license( $license = null ) {
80168016 }
80178017 }
80188018
8019- // @phpstan-ignore-next-line
80208019 if ( ! empty( $site_ids ) ) {
80218020 $this->activate_license_on_many_sites( $user, $license->secret_key, $site_ids );
80228021 }
@@ -8955,7 +8954,7 @@ private function update_plugin_version_event() {
89558954 * @author Vova Feldman (@svovaf)
89568955 * @since 2.0.0
89578956 *
8958- * @param string[] $plugins
8957+ * @param array< string, array> $plugins
89598958 *
89608959 * @return string
89618960 */
@@ -9888,13 +9887,15 @@ private function sync_installs( $override = array(), $flush = false ) {
98889887
98899888 $address_to_blog_map = $this->get_address_to_blog_map();
98909889
9891- foreach ( $result->installs as $install ) {
9892- $this->_site = new FS_Site( $install );
9890+ if ( ! empty( $result->installs ) ) {
9891+ foreach ( $result->installs as $install ) {
9892+ $this->_site = new FS_Site( $install );
98939893
9894- $address = trailingslashit( fs_strip_url_protocol( $install->url ) );
9895- $blog_id = $address_to_blog_map[ $address ];
9894+ $address = trailingslashit( fs_strip_url_protocol( $install->url ) );
9895+ $blog_id = $address_to_blog_map[ $address ];
98969896
9897- $this->_store_site( true, $blog_id );
9897+ $this->_store_site( true, $blog_id );
9898+ }
98989899 }
98999900 }
99009901
@@ -14101,7 +14102,7 @@ private function activate_license(
1410114102 $result = $fs->activate_license_on_many_installs( $user, $license_key, $blog_2_install_map );
1410214103 }
1410314104
14104- if ( true === $result && count ( $site_ids ) > 0 ) {
14105+ if ( true === $result && ! empty ( $site_ids ) > 0 ) {
1410514106 $result = $fs->activate_license_on_many_sites( $user, $license_key, $site_ids );
1410614107 }
1410714108 } else {
@@ -20057,7 +20058,7 @@ private function _store_licenses( $store = true, $module_id = false, $licenses =
2005720058 }
2005820059 }
2005920060
20060- if ( count ( $new_user_licenses_map ) > 0 ) {
20061+ if ( ! empty ( $new_user_licenses_map ) > 0 ) {
2006120062 // Add new licenses.
2006220063 $all_licenses[ $module_id ] = array_merge( array_values( $new_user_licenses_map ), $all_licenses[ $module_id ] );
2006320064 }
@@ -21303,14 +21304,17 @@ private function _sync_plugin_license(
2130321304
2130421305 // Find the current context install.
2130521306 $site = null;
21306- foreach ( $result->installs as $install ) {
21307- if ( $install->id == $this->_site->id ) {
21308- $site = new FS_Site( $install );
21309- } else {
21310- $address = trailingslashit( fs_strip_url_protocol( $install->url ) );
21311- $blog_id = $address_to_blog_map[ $address ];
2131221307
21313- $this->_store_site( true, $blog_id, new FS_Site( $install ) );
21308+ if ( ! empty( $result->installs ) ) {
21309+ foreach ( $result->installs as $install ) {
21310+ if ( $install->id == $this->_site->id ) {
21311+ $site = new FS_Site( $install );
21312+ } else {
21313+ $address = trailingslashit( fs_strip_url_protocol( $install->url ) );
21314+ $blog_id = $address_to_blog_map[ $address ];
21315+
21316+ $this->_store_site( true, $blog_id, new FS_Site( $install ) );
21317+ }
2131421318 }
2131521319 }
2131621320 }
0 commit comments