From 32cb4c86c9a8a8864df51819ac7d27191eef354a Mon Sep 17 00:00:00 2001 From: Al Amin Ahamed <34349365+mralaminahamed@users.noreply.github.com> Date: Sun, 12 May 2024 22:39:43 +0600 Subject: [PATCH 1/3] Fix: PHPStan validation errors for inccorrent parameter types --- includes/class-freemius.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/class-freemius.php b/includes/class-freemius.php index 20b178be..7b33f807 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -8958,7 +8958,7 @@ private function update_plugin_version_event() { * @author Vova Feldman (@svovaf) * @since 2.0.0 * - * @param array [string]array $plugins + * @param array [string] $plugins * * @return string */ @@ -9373,7 +9373,7 @@ private function get_install_data_for_api( * @author Vova Feldman (@svovaf) * @since 2.0.0 * - * @param string[] string $override + * @param string[] $override * @param bool $only_diff * @param bool $is_keepalive * @param bool $include_plugins Since 1.1.8 by default include plugin changes. @@ -9560,7 +9560,7 @@ private function get_installs_data_for_api( * * @param array $site * @param FS_Site $install - * @param string[] string $override + * @param string[] $override * * @return array */ @@ -9682,7 +9682,7 @@ function send_clone_resolution_update( $resolution_type, $clone_context_install * @author Vova Feldman (@svovaf) * @since 1.0.9 * - * @param string[] string $override + * @param string[] $override * @param bool $flush * @param bool $is_two_way_sync @since 2.5.0 If true and there's a successful API request, the install sync cron will be cleared. * @@ -9755,7 +9755,7 @@ private function send_install_update( $override = array(), $flush = false, $is_t * @author Vova Feldman (@svovaf) * @since 2.0.0 * - * @param string[] string $override + * @param string[] $override * @param bool $flush * @param bool $is_two_way_sync @since 2.5.0 If true and there's a successful API request, the install sync cron will be cleared. * @@ -9842,7 +9842,7 @@ private function maybe_sync_install_user() { * @author Vova Feldman (@svovaf) * @since 1.0.9 * - * @param string[] string $override + * @param string[] $override * @param bool $flush */ function sync_install( $override = array(), $flush = false ) { @@ -9871,7 +9871,7 @@ function sync_install( $override = array(), $flush = false ) { * @author Vova Feldman (@svovaf) * @since 1.0.9 * - * @param string[] string $override + * @param string[] $override * @param bool $flush */ private function sync_installs( $override = array(), $flush = false ) { @@ -19900,7 +19900,7 @@ function has_filter( $tag, $function_to_check = false ) { * @author Vova Feldman (@svovaf) * @since 1.1.6 * - * @param string[] string $key_value + * @param string[] $key_value * * @uses fs_override_i18n() */ From fce0d549ebd7a4253a56a90b4fae6fc1e582ffc3 Mon Sep 17 00:00:00 2001 From: Al Amin Ahamed <34349365+mralaminahamed@users.noreply.github.com> Date: Sun, 12 May 2024 22:54:57 +0600 Subject: [PATCH 2/3] fix: more validation errors --- includes/class-freemius.php | 11 +++++------ includes/entities/class-fs-entity.php | 2 +- includes/fs-core-functions.php | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/includes/class-freemius.php b/includes/class-freemius.php index 7b33f807..d7185abd 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -13914,9 +13914,9 @@ function is_migration() { * @param int $blog_id * * @return array { - * @var bool $success - * @var string $error - * @var string $next_page + * @type bool $success + * @type string $error + * @type string $next_page * } * * @uses Freemius::activate_license() @@ -17313,7 +17313,6 @@ function get_opt_in_params( $override_with = array(), $network_level_or_blog_id * @param bool $redirect * * @return string|object - * @use WP_Error */ function opt_in( $email = false, @@ -22840,8 +22839,8 @@ private function complete_change_owner() { * @author Leo Fajardo (@leorw) * @since 2.3.2 * - * @param number $user_id - * @param array[string]number $install_ids_by_slug_map + * @param number $user_id + * @param array[string] $install_ids_by_slug_map * */ private function complete_ownership_change_by_license( $user_id, $install_ids_by_slug_map ) { diff --git a/includes/entities/class-fs-entity.php b/includes/entities/class-fs-entity.php index ce281f45..edf8a8c5 100755 --- a/includes/entities/class-fs-entity.php +++ b/includes/entities/class-fs-entity.php @@ -88,7 +88,7 @@ static function equals( $entity1, $entity2 ) { * @author Vova Feldman (@svovaf) * @since 1.0.9 * - * @param string|array[string]mixed $key + * @param string|array[string] $key * @param string|bool $val * * @return bool diff --git a/includes/fs-core-functions.php b/includes/fs-core-functions.php index 09bb0b48..92df1f0d 100755 --- a/includes/fs-core-functions.php +++ b/includes/fs-core-functions.php @@ -1389,7 +1389,7 @@ function fs_esc_html_echo_inline( $text, $key = '', $slug = 'freemius' ) { * @author Vova Feldman (@svovaf) * @since 1.1.6 * - * @param array[string]string $key_value + * @param array[string] $key_value * @param string $slug * * @global $fs_text_overrides From a48c37a2ee7af566c1d81766b700bd3f015db49c Mon Sep 17 00:00:00 2001 From: Al Amin Ahamed <34349365+mralaminahamed@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:58:20 +0600 Subject: [PATCH 3/3] refactor: update incorrect parameter type in method docblock --- includes/class-freemius.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-freemius.php b/includes/class-freemius.php index d7185abd..e3bcbc37 100755 --- a/includes/class-freemius.php +++ b/includes/class-freemius.php @@ -10046,7 +10046,7 @@ function _uninstall_plugin_event( $check_user = true ) { * @author Vova Feldman (@svovaf) * @since 2.2.1 * - * @param string $is_premium + * @param bool $is_premium * @param string $caller * * @return void