From 8014b88dbe596dbde6048dbee7fe8cf5d4e27fc2 Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Tue, 6 Jan 2026 12:08:58 -0400 Subject: [PATCH 1/3] Remove some old use lines from rector config --- rector.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/rector.php b/rector.php index 5c1c4c5ff4..91db3a979e 100644 --- a/rector.php +++ b/rector.php @@ -7,7 +7,6 @@ use Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector; use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector; use Rector\CodeQuality\Rector\Assign\CombinedAssignRector; -use Rector\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector; use Rector\CodeQuality\Rector\Empty_\SimplifyEmptyCheckOnEmptyArrayRector; use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector; use Rector\Strict\Rector\Empty_\DisallowedEmptyRuleFixerRector; @@ -26,7 +25,6 @@ use Rector\DeadCode\Rector\Foreach_\RemoveUnusedForeachKeyRector; use Rector\CodeQuality\Rector\Switch_\SingularSwitchToIfRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector; -use Rector\Renaming\Rector\FuncCall\RenameFunctionRector; use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedConstructorParamRector; From 4559492a92c592c044333838a082b298889953a1 Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Tue, 6 Jan 2026 12:10:59 -0400 Subject: [PATCH 2/3] Remove some comments that are not very useful from config --- rector.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/rector.php b/rector.php index 91db3a979e..428d8a5132 100644 --- a/rector.php +++ b/rector.php @@ -183,7 +183,6 @@ SimplifyEmptyArrayCheckRector::class, LongArrayToShortArrayRector::class, TernaryToElvisRector::class, - // TODO: Try this for some files and not others. RemoveUnusedPrivateMethodRector::class, ShortenElseIfRector::class, CombineIfRector::class, @@ -194,9 +193,7 @@ InlineConstructorDefaultToPropertyRector::class, SimplifyRegexPatternRector::class, RemoveUnusedConstructorParamRector::class, - // Enable this one soon. NewlineAfterStatementRector::class, - // Try these RemoveUselessReturnTagRector::class, RenameVariableToMatchNewTypeRector::class, AddMethodCallBasedStrictParamTypeRector::class, From 47e485a0af7717b8a25f1edf5e04cbd9a04624ef Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Tue, 6 Jan 2026 12:32:54 -0400 Subject: [PATCH 3/3] Stop using the type declaration prepared set --- classes/controllers/FrmAddonsController.php | 4 +- .../controllers/FrmDashboardController.php | 2 +- classes/controllers/FrmFieldsController.php | 34 ++++----- .../controllers/FrmFormActionsController.php | 4 +- classes/controllers/FrmInboxController.php | 2 +- .../FrmOnboardingWizardController.php | 4 +- classes/controllers/FrmOverlayController.php | 2 +- .../controllers/FrmSimpleBlocksController.php | 2 +- .../controllers/FrmWelcomeTourController.php | 4 +- classes/helpers/FrmAppHelper.php | 16 ++-- classes/helpers/FrmCSVExportHelper.php | 2 +- classes/helpers/FrmDashboardHelper.php | 2 +- classes/helpers/FrmFieldsHelper.php | 12 +-- classes/helpers/FrmFormsHelper.php | 8 +- classes/helpers/FrmListHelper.php | 11 ++- classes/helpers/FrmShortcodeHelper.php | 2 +- classes/helpers/FrmStylesHelper.php | 8 +- classes/helpers/FrmSubmitHelper.php | 2 +- classes/helpers/FrmTipsHelper.php | 12 +-- classes/helpers/FrmXMLHelper.php | 4 +- classes/models/FrmAddon.php | 2 +- classes/models/FrmEmail.php | 2 +- classes/models/FrmEntryFormatter.php | 4 +- classes/models/FrmFormAction.php | 6 +- classes/models/FrmFormMigrator.php | 17 ++--- classes/models/FrmOnSubmitAction.php | 3 + classes/models/FrmReviews.php | 2 +- classes/models/FrmSettings.php | 2 +- classes/models/FrmSolution.php | 8 +- classes/models/FrmSpamCheckDenylist.php | 2 +- classes/models/FrmStyle.php | 2 +- classes/models/fields/FrmFieldCaptcha.php | 6 +- classes/models/fields/FrmFieldCheckbox.php | 2 +- classes/models/fields/FrmFieldCombo.php | 8 +- classes/models/fields/FrmFieldCreditCard.php | 2 +- classes/models/fields/FrmFieldNumber.php | 2 +- classes/models/fields/FrmFieldRadio.php | 2 +- classes/models/fields/FrmFieldSubmit.php | 2 +- classes/models/fields/FrmFieldTextarea.php | 2 +- classes/models/fields/FrmFieldType.php | 12 +-- classes/models/fields/FrmFieldUrl.php | 2 +- .../views/frm-form-actions/email_action.php | 2 +- classes/widgets/FrmElementorWidget.php | 2 +- rector.php | 75 +------------------ square/helpers/FrmSquareLiteConnectHelper.php | 4 +- square/models/FrmSquareLiteSettings.php | 2 +- .../FrmStrpLiteSettingsController.php | 2 +- .../FrmTransLiteActionsController.php | 2 +- stripe/helpers/FrmStrpLiteConnectHelper.php | 4 +- stripe/helpers/FrmTransLiteAppHelper.php | 6 +- stripe/helpers/FrmTransLiteListHelper.php | 2 +- stripe/models/FrmStrpLiteSettings.php | 2 +- stripe/models/FrmTransLiteDb.php | 2 +- stripe/models/FrmTransLitePayment.php | 2 +- stripe/models/FrmTransLiteSubscription.php | 2 +- tests/phpunit/base/FrmUnitTest.php | 3 + .../entries/test_FrmTableHTMLGenerator.php | 3 + .../phpunit/fields/test_FrmFieldValidate.php | 3 + .../misc/test_FrmSpamCheckDenylist.php | 9 +++ tests/phpunit/stripe/FrmStrpLiteUnitTest.php | 7 +- .../shortcodes/test_FrmFieldShortcodes.php | 3 + 61 files changed, 162 insertions(+), 202 deletions(-) diff --git a/classes/controllers/FrmAddonsController.php b/classes/controllers/FrmAddonsController.php index f81b785a3a..f203b2f2e6 100644 --- a/classes/controllers/FrmAddonsController.php +++ b/classes/controllers/FrmAddonsController.php @@ -81,7 +81,7 @@ public static function enqueue_assets() { * * @since 6.15 * - * @return array + * @return array */ private static function get_js_variables() { return array( @@ -1240,7 +1240,7 @@ protected static function handle_addon_action( $installed, $action ) { } /** - * @return array + * @return array */ private static function get_addon_activation_response() { $activating_page = self::get_activating_page(); diff --git a/classes/controllers/FrmDashboardController.php b/classes/controllers/FrmDashboardController.php index 0c7fd097a6..7258ad9b06 100644 --- a/classes/controllers/FrmDashboardController.php +++ b/classes/controllers/FrmDashboardController.php @@ -212,7 +212,7 @@ public static function view_args_build_counter( $heading, $cta = array(), $value * @param string $link * @param bool $display * - * @return array + * @return array */ public static function view_args_build_cta( $title, $link = '#', $display = true ) { return array( diff --git a/classes/controllers/FrmFieldsController.php b/classes/controllers/FrmFieldsController.php index 029e06f38d..c12b36ec3e 100644 --- a/classes/controllers/FrmFieldsController.php +++ b/classes/controllers/FrmFieldsController.php @@ -576,8 +576,8 @@ private static function add_input_classes( $field, array &$class ) { } /** - * @param array $field - * @param array $add_html + * @param array $field + * @param array $add_html * * @return void */ @@ -611,8 +611,8 @@ private static function add_html_size( $field, array &$add_html ) { } /** - * @param array $field - * @param array $add_html + * @param array $field + * @param array $add_html * * @return void */ @@ -642,8 +642,8 @@ private static function add_html_cols( $field, array &$add_html ) { } /** - * @param array $field - * @param array $add_html + * @param array $field + * @param array $add_html * * @return void */ @@ -669,9 +669,9 @@ private static function add_html_length( $field, array &$add_html ) { } /** - * @param array $field - * @param array $add_html - * @param array $class + * @param array $field + * @param array $add_html + * @param array $class * * @return void */ @@ -799,8 +799,8 @@ private static function add_frmval_to_input( $field, &$add_html ) { } /** - * @param array $field - * @param array $add_html + * @param array $field + * @param array $add_html * * @return void */ @@ -859,8 +859,8 @@ private static function get_validation_data_attribute_visibility_info( $field ) /** * @since 5.0.03 * - * @param array $field - * @param array $add_html + * @param array $field + * @param array $add_html * * @return void */ @@ -950,8 +950,8 @@ public static function pull_custom_error_body_from_custom_html( $form, $field, $ * * @since 3.06.01 * - * @param array $field - * @param array $add_html + * @param array $field + * @param array $add_html * * @return void */ @@ -1035,8 +1035,8 @@ private static function should_allow_input_attribute( $key ) { * * @since 3.0 * - * @param array $field - * @param array $add_html + * @param array $field + * @param array $add_html * * @return void */ diff --git a/classes/controllers/FrmFormActionsController.php b/classes/controllers/FrmFormActionsController.php index d5ab604d17..9d3b348fc3 100644 --- a/classes/controllers/FrmFormActionsController.php +++ b/classes/controllers/FrmFormActionsController.php @@ -513,8 +513,8 @@ private static function should_show_log_message( $action_type ) { } /** - * @param int|string $form_id - * @param array $values + * @param int|string $form_id + * @param array $values * * @return object */ diff --git a/classes/controllers/FrmInboxController.php b/classes/controllers/FrmInboxController.php index 25aa5176e3..660874614e 100644 --- a/classes/controllers/FrmInboxController.php +++ b/classes/controllers/FrmInboxController.php @@ -28,7 +28,7 @@ public static function get_notice_count( $filtered = true ) { /** * @since 6.8 * - * @return array + * @return array */ public static function get_inbox_messages() { self::add_tracking_request(); diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 574265c8aa..1b52f61307 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -399,7 +399,7 @@ public static function enqueue_assets() { * * @since 6.9 * - * @return array + * @return array */ private static function get_js_variables() { return array( @@ -463,7 +463,7 @@ public static function mark_onboarding_as_skipped() { * * @param array $inbox_messages The array of existing inbox messages. * - * @return array Configuration for the onboarding wizard slide-in notification. + * @return array> Configuration for the onboarding wizard slide-in notification. */ public static function add_wizard_to_floating_links( $inbox_messages ) { $message = __( 'Welcome to Formidable Forms! Click here to run the Onboarding Wizard and it will guide you through the basic settings and get you started in 2 minutes.', 'formidable' ); diff --git a/classes/controllers/FrmOverlayController.php b/classes/controllers/FrmOverlayController.php index b23f890789..af831b8555 100644 --- a/classes/controllers/FrmOverlayController.php +++ b/classes/controllers/FrmOverlayController.php @@ -70,7 +70,7 @@ public function __construct( $config = array() ) { /** * Get next execution time. Return the next execution timestamp and date. * - * @return array + * @return array */ private function get_next_execution() { $next_timestamp = strtotime( '+' . $this->config['execution-frequency'], $this->get_time() ); diff --git a/classes/controllers/FrmSimpleBlocksController.php b/classes/controllers/FrmSimpleBlocksController.php index a7a1bfa722..579bd911be 100644 --- a/classes/controllers/FrmSimpleBlocksController.php +++ b/classes/controllers/FrmSimpleBlocksController.php @@ -139,7 +139,7 @@ private static function get_forms_options() { * * @param object $form * - * @return array + * @return array */ private static function set_form_options( $form ) { return array( diff --git a/classes/controllers/FrmWelcomeTourController.php b/classes/controllers/FrmWelcomeTourController.php index 1ca581a706..16eed36eae 100644 --- a/classes/controllers/FrmWelcomeTourController.php +++ b/classes/controllers/FrmWelcomeTourController.php @@ -163,7 +163,7 @@ public static function setup_checklist_progress() { /** * Gets the checklist steps. * - * @return array + * @return array */ private static function get_steps() { $steps = array( @@ -494,7 +494,7 @@ public static function enqueue_assets() { /** * Get the Welcome Tour JS variables as an array. * - * @return array + * @return array */ private static function get_js_variables() { return array( diff --git a/classes/helpers/FrmAppHelper.php b/classes/helpers/FrmAppHelper.php index 0e62631875..71576065dc 100644 --- a/classes/helpers/FrmAppHelper.php +++ b/classes/helpers/FrmAppHelper.php @@ -684,7 +684,7 @@ public static function get_ip_address() { /** * @since 6.1 * - * @return array + * @return array */ public static function get_custom_header_keys_for_ip() { return array( @@ -1163,6 +1163,8 @@ private static function allowed_html( $allowed ) { /** * @since 2.05.03 + * + * @return array|mixed[]> */ private static function safe_html() { $allow_class = array( @@ -2895,10 +2897,10 @@ private static function prepare_field_arrays( $fields, $record, array &$values, } /** - * @param object $field - * @param object $record - * @param array $values - * @param array $args + * @param object $field + * @param object $record + * @param array $values + * @param array $args * * @return void */ @@ -2959,7 +2961,7 @@ private static function fill_field_defaults( $field, $record, array &$values, $a * * @param object $field * - * @return array + * @return array */ public static function start_field_array( $field ) { return array( @@ -3366,7 +3368,7 @@ private static function get_unit( $unit ) { * * @since 2.0.20 * - * @return array + * @return array> */ private static function get_time_strings() { return array( diff --git a/classes/helpers/FrmCSVExportHelper.php b/classes/helpers/FrmCSVExportHelper.php index 3775022e8a..d4e7534563 100644 --- a/classes/helpers/FrmCSVExportHelper.php +++ b/classes/helpers/FrmCSVExportHelper.php @@ -236,7 +236,7 @@ private static function generate_csv_filename( $form ) { /** * @since 5.0.16 * - * @return array + * @return array */ private static function get_standard_filter_args() { return array( diff --git a/classes/helpers/FrmDashboardHelper.php b/classes/helpers/FrmDashboardHelper.php index e6aa15b11d..f77e58fdb7 100644 --- a/classes/helpers/FrmDashboardHelper.php +++ b/classes/helpers/FrmDashboardHelper.php @@ -206,7 +206,7 @@ class="" * * @since 6.8 * - * @return array + * @return array> */ public static function get_license_buttons() { $cta_text = FrmSalesApi::get_best_sale_value( 'dashboard_license_cta_text' ); diff --git a/classes/helpers/FrmFieldsHelper.php b/classes/helpers/FrmFieldsHelper.php index 6e784d5b8c..43d6555a65 100644 --- a/classes/helpers/FrmFieldsHelper.php +++ b/classes/helpers/FrmFieldsHelper.php @@ -92,8 +92,8 @@ public static function field_object_to_array( $field ) { } /** - * @param object $field - * @param array $field_array + * @param object $field + * @param array $field_array * * @return void */ @@ -194,8 +194,8 @@ public static function get_default_field_options( $type ) { /** * @since 3.0 * - * @param object $field - * @param array $values + * @param object $field + * @param mixed[] $values * * @return void */ @@ -274,8 +274,8 @@ private static function context_is_safe_to_load_field_options_from_request_data( * * @since 3.0 * - * @param object $field - * @param array $field_array + * @param object $field + * @param array $field_array * * @return void */ diff --git a/classes/helpers/FrmFormsHelper.php b/classes/helpers/FrmFormsHelper.php index 496786886a..888e25a16f 100644 --- a/classes/helpers/FrmFormsHelper.php +++ b/classes/helpers/FrmFormsHelper.php @@ -447,7 +447,7 @@ public static function fill_default_opts( $values, $record, $post_values ) { } /** - * @return array + * @return array */ public static function get_default_opts() { $frm_settings = FrmAppHelper::get_settings(); @@ -1404,7 +1404,7 @@ public static function delete_trash_info( $id, $status ) { * * @param int $id * - * @return array + * @return array> */ public static function delete_trash_links( $id ) { $current_page = FrmAppHelper::get_simple_request( array( 'param' => 'form_type' ) ); @@ -1481,7 +1481,7 @@ public static function css_classes() { } /** - * @return array + * @return array */ public static function grid_classes() { return array( @@ -1893,7 +1893,7 @@ private static function create_unsafe_param_warning( $unsafe_params_in_redirect * * @since 4.04 * - * @return array Array of WordPress reserved words. + * @return array Array of WordPress reserved words. */ public static function reserved_words() { return array( diff --git a/classes/helpers/FrmListHelper.php b/classes/helpers/FrmListHelper.php index df1e3c61df..3b3fee690c 100644 --- a/classes/helpers/FrmListHelper.php +++ b/classes/helpers/FrmListHelper.php @@ -162,6 +162,9 @@ public function ajax_user_can() { return current_user_can( 'administrator' ); } + /** + * @return array{} + */ public function get_columns() { return array(); } @@ -307,7 +310,7 @@ private function hidden_search_inputs( $param_name ) { * * @since 2.0.18 * - * @return array + * @return array{} */ protected function get_views() { return array(); @@ -351,7 +354,7 @@ public function views() { * * @since 2.0.18 * - * @return array + * @return array{} */ protected function get_bulk_actions() { return array(); @@ -802,7 +805,7 @@ private function add_active_link( $atts ) { * * @since 2.0.18 * - * @return array + * @return array{} */ protected function get_sortable_columns() { return array(); @@ -1119,7 +1122,7 @@ protected function should_display( $args, $settings ) { * * @since 2.0.18 * - * @return array List of CSS classes for the table tag. + * @return array List of CSS classes for the table tag. */ protected function get_table_classes() { return array( 'widefat', 'fixed', 'striped', $this->_args['plural'] ); diff --git a/classes/helpers/FrmShortcodeHelper.php b/classes/helpers/FrmShortcodeHelper.php index 5f2d03e734..d1c5b169a2 100644 --- a/classes/helpers/FrmShortcodeHelper.php +++ b/classes/helpers/FrmShortcodeHelper.php @@ -36,7 +36,7 @@ public static function get_shortcode_attribute_array( $text ) { * * @since 6.16.3 * - * @return array + * @return array> */ public static function get_contextual_shortcodes() { return array( diff --git a/classes/helpers/FrmStylesHelper.php b/classes/helpers/FrmStylesHelper.php index 01da9febdf..1ab3ee178b 100644 --- a/classes/helpers/FrmStylesHelper.php +++ b/classes/helpers/FrmStylesHelper.php @@ -34,7 +34,7 @@ public static function save_button() { /** * @since 2.05 * - * @return array + * @return array */ public static function get_css_label_positions() { return array( @@ -76,7 +76,7 @@ public static function get_single_label_positions( $field = array() ) { } /** - * @return array + * @return array> */ public static function minus_icons() { return array( @@ -104,7 +104,7 @@ public static function minus_icons() { } /** - * @return array + * @return array */ public static function arrow_icons() { $minus_icons = self::minus_icons(); @@ -821,7 +821,7 @@ public static function prepare_color_output( &$settings, $allow_transparent = tr /** * @since 2.3 * - * @return array + * @return array */ private static function allow_color_override() { $frm_style = new FrmStyle(); diff --git a/classes/helpers/FrmSubmitHelper.php b/classes/helpers/FrmSubmitHelper.php index 00ca9c08ba..1744691043 100644 --- a/classes/helpers/FrmSubmitHelper.php +++ b/classes/helpers/FrmSubmitHelper.php @@ -98,7 +98,7 @@ public static function get_current_action_from_global_var( $form_id ) { * * @param object $form Form object. * - * @return array + * @return array */ private static function get_submit_settings_from_form( $form ) { return array( diff --git a/classes/helpers/FrmTipsHelper.php b/classes/helpers/FrmTipsHelper.php index adb431534c..2709702a53 100644 --- a/classes/helpers/FrmTipsHelper.php +++ b/classes/helpers/FrmTipsHelper.php @@ -118,7 +118,7 @@ private static function cta_label() { } /** - * @return array + * @return array> */ public static function get_builder_tip() { return array( @@ -174,7 +174,7 @@ public static function get_builder_tip() { } /** - * @return array + * @return array> */ public static function get_form_settings_tip() { return array( @@ -206,7 +206,7 @@ public static function get_form_settings_tip() { } /** - * @return array + * @return array> */ public static function get_form_action_tip() { return array( @@ -302,7 +302,7 @@ public static function get_form_action_tip() { } /** - * @return array + * @return array> */ public static function get_styling_tip() { return array( @@ -368,7 +368,7 @@ public static function get_entries_tip() { } /** - * @return array + * @return array> */ public static function get_import_tip() { return array( @@ -450,7 +450,7 @@ public static function show_admin_cta( $args ) { /** * @deprecated 6.21 * - * @return array + * @return array{} */ public static function get_banner_tip() { _deprecated_function( __METHOD__, '6.21' ); diff --git a/classes/helpers/FrmXMLHelper.php b/classes/helpers/FrmXMLHelper.php index 0341fe04b0..92122cd1b4 100644 --- a/classes/helpers/FrmXMLHelper.php +++ b/classes/helpers/FrmXMLHelper.php @@ -153,7 +153,7 @@ public static function import_xml_now( $xml, $installing_template = false ) { /** * @since 3.06 * - * @return array + * @return array|mixed[]> */ private static function pre_import_data() { $defaults = array( @@ -588,7 +588,7 @@ private static function do_after_field_imported_action( $field_array, $form_fiel * @param object $field * @param int|string $form_id * - * @return array + * @return array */ private static function fill_field( $field, $form_id ) { return array( diff --git a/classes/models/FrmAddon.php b/classes/models/FrmAddon.php index 6f6414753e..d8c12430aa 100644 --- a/classes/models/FrmAddon.php +++ b/classes/models/FrmAddon.php @@ -900,7 +900,7 @@ private function get_license_status() { } /** - * @return array + * @return array */ private function get_messages() { return array( diff --git a/classes/models/FrmEmail.php b/classes/models/FrmEmail.php index 469c6d2c1b..eab8f38e03 100644 --- a/classes/models/FrmEmail.php +++ b/classes/models/FrmEmail.php @@ -787,7 +787,7 @@ private function get_email_from_name( $name ) { * * @param string $sender * - * @return array + * @return array */ private function get_name_and_email_for_sender( $sender ) { $parts = explode( ' ', $sender ); diff --git a/classes/models/FrmEntryFormatter.php b/classes/models/FrmEntryFormatter.php index 77260abe6a..894af9ac95 100644 --- a/classes/models/FrmEntryFormatter.php +++ b/classes/models/FrmEntryFormatter.php @@ -304,7 +304,7 @@ protected function init_include_user_info( $atts ) { * * @since 3.0 * - * @return array + * @return array */ protected function skip_fields() { return array( 'captcha', 'html', FrmSubmitHelper::FIELD_TYPE ); @@ -780,7 +780,7 @@ protected function add_standard_row( $field_value, &$content ) { * * @param FrmFieldValue $field_value * - * @return array + * @return array */ protected function package_value_args( $field_value ) { return array( diff --git a/classes/models/FrmFormAction.php b/classes/models/FrmFormAction.php index ac2dbbdb49..5dbba3c8fd 100644 --- a/classes/models/FrmFormAction.php +++ b/classes/models/FrmFormAction.php @@ -99,14 +99,14 @@ public function form( $instance, $args = array() ) { } /** - * @return array of the default options + * @return array{} of the default options */ public function get_defaults() { return array(); } /** - * @return array + * @return array{} */ public function get_switch_fields() { return array(); @@ -968,7 +968,7 @@ public static function action_conditions_met( $action, $entry ) { /** * @param string $class * - * @return array + * @return array */ public static function default_action_opts( $class = '' ) { return array( diff --git a/classes/models/FrmFormMigrator.php b/classes/models/FrmFormMigrator.php index f30e82d820..b56195498f 100644 --- a/classes/models/FrmFormMigrator.php +++ b/classes/models/FrmFormMigrator.php @@ -245,7 +245,7 @@ protected function import_form( $source_id ) { * @param int|string $source_id * @param string $source_form_name * - * @return array + * @return array */ protected function prepare_new_form( $source_id, $source_form_name ) { return array( @@ -346,7 +346,7 @@ protected function prepare_field( $field, &$new_field ) { * * @since 4.04.03 * - * @return array + * @return array */ protected function fields_with_end() { return array( 'divider' ); @@ -500,7 +500,7 @@ protected function create_form( $form ) { * * @param array $form * - * @return array + * @return array */ protected function form_creation_error_response( $form ) { return array( @@ -623,9 +623,8 @@ private function is_imported( $source_id ) { } /** Start functions here that should be overridden **/ - /** - * @return array + * @return array{} */ protected function unsupported_field_types() { return array(); @@ -645,7 +644,7 @@ private function is_unsupported_field( $type ) { /** * Strict PRO fields with no Lite alternatives. * - * @return array + * @return array{} */ protected function skip_pro_fields() { return array(); @@ -677,7 +676,7 @@ protected function replace_smart_tags( $string, $fields ) { /** * Get ALL THE FORMS. * - * @return array + * @return array{} */ public function get_forms() { return array(); @@ -686,7 +685,7 @@ public function get_forms() { /** * @param int|string $id * - * @return array + * @return array{} */ public function get_form( $id ) { return array(); @@ -704,7 +703,7 @@ protected function get_form_name( $source_form ) { /** * @param array|object $source_form * - * @return array + * @return array{} */ protected function get_form_fields( $source_form ) { return array(); diff --git a/classes/models/FrmOnSubmitAction.php b/classes/models/FrmOnSubmitAction.php index a8f1d956e2..dc4fd67e98 100644 --- a/classes/models/FrmOnSubmitAction.php +++ b/classes/models/FrmOnSubmitAction.php @@ -50,6 +50,9 @@ public function form( $instance, $args = array() ) { include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/on_submit_settings.php'; } + /** + * @return array + */ public function get_defaults() { return array( 'success_action' => FrmOnSubmitHelper::get_default_action_type(), diff --git a/classes/models/FrmReviews.php b/classes/models/FrmReviews.php index 4bdc96233f..e3fd6ad83f 100644 --- a/classes/models/FrmReviews.php +++ b/classes/models/FrmReviews.php @@ -188,7 +188,7 @@ private function has_later_request( $requests, $asked ) { /** * @since 4.05.02 * - * @return array + * @return array */ private function inbox_keys() { return array( diff --git a/classes/models/FrmSettings.php b/classes/models/FrmSettings.php index 82978c0223..b9a948c1a6 100644 --- a/classes/models/FrmSettings.php +++ b/classes/models/FrmSettings.php @@ -286,7 +286,7 @@ private function translate_settings( $settings ) { } /** - * @return array + * @return array */ public function default_options() { return array( diff --git a/classes/models/FrmSolution.php b/classes/models/FrmSolution.php index a3f41fe670..477036a3e9 100644 --- a/classes/models/FrmSolution.php +++ b/classes/models/FrmSolution.php @@ -774,7 +774,7 @@ protected function previously_imported_forms() { /** * In the new plugin has any dependencies, include them here. * - * @return array + * @return array{} */ protected function required_plugins() { return array(); @@ -792,7 +792,7 @@ protected function download_id() { /** * Give options for which forms to import. * - * @return array + * @return array{} */ protected function form_options() { /** @@ -811,7 +811,7 @@ protected function form_options() { /** * Give options for which view to use. * - * @return array + * @return array{} */ protected function view_options() { return array(); @@ -820,7 +820,7 @@ protected function view_options() { /** * If the pages aren't imported automatically, set the page names. * - * @return array + * @return array{} */ protected function needed_pages() { /** diff --git a/classes/models/FrmSpamCheckDenylist.php b/classes/models/FrmSpamCheckDenylist.php index 1f6ff7b062..7d41964a9e 100644 --- a/classes/models/FrmSpamCheckDenylist.php +++ b/classes/models/FrmSpamCheckDenylist.php @@ -323,7 +323,7 @@ protected function convert_to_lowercase( $str ) { /** * Get the field IDs to check. * - * @param array $denylist The denylist data. + * @param array $denylist The denylist data. * * @return array|false Return array of field IDs or false if do not need to check. */ diff --git a/classes/models/FrmStyle.php b/classes/models/FrmStyle.php index 8121f32965..86227fa0c4 100644 --- a/classes/models/FrmStyle.php +++ b/classes/models/FrmStyle.php @@ -794,7 +794,7 @@ public function get_field_name( $field_name, $post_field = 'post_content' ) { } /** - * @return array + * @return array */ public static function get_bold_options() { return array( diff --git a/classes/models/fields/FrmFieldCaptcha.php b/classes/models/fields/FrmFieldCaptcha.php index 9af6e9b19d..fb47895675 100644 --- a/classes/models/fields/FrmFieldCaptcha.php +++ b/classes/models/fields/FrmFieldCaptcha.php @@ -35,7 +35,7 @@ public static function get_captcha_image_name() { } /** - * @return array + * @return array */ protected function field_settings_for_type() { $settings = FrmCaptchaFactory::get_settings_object(); @@ -50,7 +50,7 @@ protected function field_settings_for_type() { } /** - * @return array + * @return array */ protected function new_field_settings() { $frm_settings = FrmAppHelper::get_settings(); @@ -61,7 +61,7 @@ protected function new_field_settings() { } /** - * @return array + * @return array */ protected function extra_field_opts() { return array( diff --git a/classes/models/fields/FrmFieldCheckbox.php b/classes/models/fields/FrmFieldCheckbox.php index 17cfdb0811..87d5c51da2 100644 --- a/classes/models/fields/FrmFieldCheckbox.php +++ b/classes/models/fields/FrmFieldCheckbox.php @@ -81,7 +81,7 @@ public function displayed_field_type( $field ) { } /** - * @return array + * @return array */ protected function extra_field_opts() { $form_id = $this->get_field_column( 'form_id' ); diff --git a/classes/models/fields/FrmFieldCombo.php b/classes/models/fields/FrmFieldCombo.php index 3c969a5914..e72fb1b840 100644 --- a/classes/models/fields/FrmFieldCombo.php +++ b/classes/models/fields/FrmFieldCombo.php @@ -98,7 +98,7 @@ public function set_aria_invalid_error( &$shortcode_atts, $args ) { /** * Gets default sub field. * - * @return array + * @return array */ protected function get_default_sub_field() { return array( @@ -209,7 +209,7 @@ protected function get_default_value() { /** * Gets labels for built-in options of fields or sub fields. * - * @return array + * @return array */ protected function get_built_in_option_labels() { return array( @@ -222,7 +222,7 @@ protected function get_built_in_option_labels() { /** * Which built-in settings this field supports? * - * @return array + * @return array */ protected function field_settings_for_type() { return array( @@ -502,7 +502,7 @@ protected function should_print_hidden_sub_fields() { /** * Gets inputs container attributes. * - * @return array + * @return array */ protected function get_inputs_container_attrs() { return array( diff --git a/classes/models/fields/FrmFieldCreditCard.php b/classes/models/fields/FrmFieldCreditCard.php index 6b8b04f319..751a6664a8 100644 --- a/classes/models/fields/FrmFieldCreditCard.php +++ b/classes/models/fields/FrmFieldCreditCard.php @@ -24,7 +24,7 @@ class FrmFieldCreditCard extends FrmFieldType { protected $has_for_label = false; /** - * @return array + * @return array */ protected function field_settings_for_type() { return array( diff --git a/classes/models/fields/FrmFieldNumber.php b/classes/models/fields/FrmFieldNumber.php index c3f7379002..87accc98a4 100644 --- a/classes/models/fields/FrmFieldNumber.php +++ b/classes/models/fields/FrmFieldNumber.php @@ -37,7 +37,7 @@ protected function field_settings_for_type() { } /** - * @return array + * @return array */ protected function extra_field_opts() { return array( diff --git a/classes/models/fields/FrmFieldRadio.php b/classes/models/fields/FrmFieldRadio.php index c3f73eadd5..c699b6e479 100644 --- a/classes/models/fields/FrmFieldRadio.php +++ b/classes/models/fields/FrmFieldRadio.php @@ -72,7 +72,7 @@ public function displayed_field_type( $field ) { } /** - * @return array + * @return array */ protected function extra_field_opts() { $form_id = $this->get_field_column( 'form_id' ); diff --git a/classes/models/fields/FrmFieldSubmit.php b/classes/models/fields/FrmFieldSubmit.php index 629dae21fd..9ee3654656 100644 --- a/classes/models/fields/FrmFieldSubmit.php +++ b/classes/models/fields/FrmFieldSubmit.php @@ -53,7 +53,7 @@ public function default_html() { /** * Sets settings for this field type. * - * @return array + * @return array */ protected function field_settings_for_type() { return array( diff --git a/classes/models/fields/FrmFieldTextarea.php b/classes/models/fields/FrmFieldTextarea.php index 84ab644e4a..10be29a6bc 100644 --- a/classes/models/fields/FrmFieldTextarea.php +++ b/classes/models/fields/FrmFieldTextarea.php @@ -31,7 +31,7 @@ protected function field_settings_for_type() { } /** - * @return array + * @return array */ protected function extra_field_opts() { return array( diff --git a/classes/models/fields/FrmFieldType.php b/classes/models/fields/FrmFieldType.php index 6dac0759f4..2edcb8cec6 100644 --- a/classes/models/fields/FrmFieldType.php +++ b/classes/models/fields/FrmFieldType.php @@ -396,7 +396,7 @@ public function display_field_settings() { } /** - * @return array + * @return array */ protected function default_field_settings() { return array( @@ -437,7 +437,7 @@ protected function field_settings_for_type() { } /** - * @return array + * @return array */ private function no_input_settings() { return array( @@ -454,7 +454,7 @@ private function no_input_settings() { * * @since 3.06.01 * - * @return array + * @return array */ public function translatable_strings() { return array( @@ -880,7 +880,7 @@ protected function get_new_field_name() { } /** - * @return array + * @return array{} */ protected function new_field_settings() { return array(); @@ -920,7 +920,7 @@ public function get_default_field_options() { } /** - * @return array + * @return array{} */ protected function extra_field_opts() { return array(); @@ -1594,7 +1594,7 @@ protected function add_aria_description( $args, &$input_html ) { /** * @param array $args * - * @return array + * @return array{} */ public function validate( $args ) { return array(); diff --git a/classes/models/fields/FrmFieldUrl.php b/classes/models/fields/FrmFieldUrl.php index 5216f17847..b1c7bcc83d 100644 --- a/classes/models/fields/FrmFieldUrl.php +++ b/classes/models/fields/FrmFieldUrl.php @@ -33,7 +33,7 @@ protected function field_settings_for_type() { } /** - * @return array + * @return array */ protected function extra_field_opts() { return array( diff --git a/classes/views/frm-form-actions/email_action.php b/classes/views/frm-form-actions/email_action.php index 3b901f11a1..d5addb08a0 100644 --- a/classes/views/frm-form-actions/email_action.php +++ b/classes/views/frm-form-actions/email_action.php @@ -30,7 +30,7 @@ public function form( $form_action, $args = array() ) { } /** - * @return array + * @return array */ public function get_defaults() { return array( diff --git a/classes/widgets/FrmElementorWidget.php b/classes/widgets/FrmElementorWidget.php index a8d8ad1f44..d46615d675 100644 --- a/classes/widgets/FrmElementorWidget.php +++ b/classes/widgets/FrmElementorWidget.php @@ -28,7 +28,7 @@ public function get_icon() { } /** - * @return array + * @return array */ public function get_categories() { return array( 'general' ); diff --git a/rector.php b/rector.php index 428d8a5132..a258acbbc5 100644 --- a/rector.php +++ b/rector.php @@ -33,64 +33,28 @@ use Rector\CodingStyle\Rector\Stmt\NewlineAfterStatementRector; use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector; use Rector\Naming\Rector\ClassMethod\RenameVariableToMatchNewTypeRector; -use Rector\TypeDeclaration\Rector\ClassMethod\AddMethodCallBasedStrictParamTypeRector; -use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector; -use Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanStrictReturnsRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNullableTypeRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnDirectArrayRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNewArrayRector; -use Rector\TypeDeclaration\Rector\ClassMethod\StrictArrayParamDimFetchRector; -use Rector\TypeDeclaration\Rector\StmtsAwareInterface\DeclareStrictTypesRector; use Rector\CodingStyle\Rector\ClassMethod\NewlineBeforeNewAssignSetRector; use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector; use Rector\CodingStyle\Rector\FuncCall\StrictArraySearchRector; use Rector\Naming\Rector\Assign\RenameVariableToMatchMethodCallReturnTypeRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictNativeCallRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnUnionTypeRector; -use Rector\TypeDeclaration\Rector\ClassMethod\StringReturnTypeFromStrictStringReturnsRector; -use Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeRector; use Rector\CodingStyle\Rector\Encapsed\WrapEncapsedVariableInCurlyBracesRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictTypedCallRector; -use Rector\TypeDeclaration\Rector\ClassMethod\StrictStringParamConcatRector; use Rector\Naming\Rector\Class_\RenamePropertyToMatchTypeRector; -use Rector\TypeDeclaration\Rector\ClassMethod\NumericReturnTypeFromStrictReturnsRector; -use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromAssignsRector; -use Rector\TypeDeclaration\Rector\Property\TypedPropertyFromStrictConstructorRector; -use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationBasedOnParentClassMethodRector; use Rector\Naming\Rector\Foreach_\RenameForeachValueVariableToMatchExprVariableRector; -use Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanConstReturnsRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnCastRector; -use Rector\TypeDeclaration\Rector\ClassMethod\StringReturnTypeFromStrictScalarReturnsRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromStrictConstantReturnRector; use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector; use Rector\Php70\Rector\FuncCall\MultiDirnameRector; -use Rector\TypeDeclaration\Rector\Class_\ReturnTypeFromStrictTernaryRector; -use Rector\TypeDeclaration\Rector\Closure\AddClosureVoidReturnTypeWhereNoReturnRector; use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector; use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector; use Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnTypeFromReturnNewRector; -use Rector\TypeDeclaration\Rector\ClassMethod\NumericReturnTypeFromStrictScalarReturnsRector; -use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector; use Rector\CodingStyle\Rector\FuncCall\CallUserFuncArrayToVariadicRector; use Rector\CodingStyle\Rector\Catch_\CatchExceptionNameMatchingTypeRector; use Rector\EarlyReturn\Rector\Return_\ReturnBinaryOrToEarlyReturnRector; use Rector\EarlyReturn\Rector\StmtsAwareInterface\ReturnEarlyIfVariableRector; use Rector\EarlyReturn\Rector\If_\ChangeOrIfContinueToMultiContinueRector; use Rector\CodingStyle\Rector\String_\SimplifyQuoteEscapeRector; -use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\AddParamArrayDocblockFromAssignsParamToParamReferenceRector; -use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\AddParamArrayDocblockFromDimFetchAccessRector; use Rector\CodeQuality\Rector\BooleanAnd\RepeatedAndNotEqualToNotInArrayRector; use Rector\CodeQuality\Rector\Equal\UseIdenticalOverEqualWithSameTypeRector; -use Rector\TypeDeclaration\Rector\ClassMethod\AddParamFromDimFetchKeyUseRector; -use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockReturnArrayFromDirectArrayInstanceRector; -use Rector\TypeDeclaration\Rector\FuncCall\AddArrayFunctionClosureParamTypeRector; use Rector\Naming\Rector\ClassMethod\RenameParamToMatchTypeRector; -use Rector\TypeDeclaration\Rector\FuncCall\AddArrowFunctionParamArrayWhereDimFetchRector; use Rector\CodingStyle\Rector\ClassLike\NewlineBetweenClassLikeStmtsRector; -use Rector\TypeDeclaration\Rector\FunctionLike\AddClosureParamTypeForArrayMapRector; -use Rector\TypeDeclaration\Rector\ClassMethod\KnownMagicClassMethodTypeRector; -use Rector\TypeDeclaration\Rector\ClassMethod\AddParamStringTypeFromSprintfUseRector; use Rector\CodeQuality\Rector\Include_\AbsolutizeRequireAndIncludePathRector; use Rector\DeadCode\Rector\StaticCall\RemoveParentCallWithoutParentRector; @@ -114,7 +78,7 @@ // codingStyle true, // typeDeclarations - true, + false, // typeDeclarationDocblocks true, // privatization @@ -182,6 +146,7 @@ // This changes if is_array() && empty() to if === []. SimplifyEmptyArrayCheckRector::class, LongArrayToShortArrayRector::class, + // WP argues that the Elvis operator does not help with readability. TernaryToElvisRector::class, RemoveUnusedPrivateMethodRector::class, ShortenElseIfRector::class, @@ -196,64 +161,28 @@ NewlineAfterStatementRector::class, RemoveUselessReturnTagRector::class, RenameVariableToMatchNewTypeRector::class, - AddMethodCallBasedStrictParamTypeRector::class, - AddVoidReturnTypeWhereNoReturnRector::class, - BoolReturnTypeFromBooleanStrictReturnsRector::class, - ReturnNullableTypeRector::class, - ReturnTypeFromReturnDirectArrayRector::class, - ReturnTypeFromStrictNewArrayRector::class, - StrictArrayParamDimFetchRector::class, - DeclareStrictTypesRector::class, NewlineBeforeNewAssignSetRector::class, EncapsedStringsToSprintfRector::class, StrictArraySearchRector::class, RenameVariableToMatchMethodCallReturnTypeRector::class, - ReturnTypeFromStrictNativeCallRector::class, - ReturnUnionTypeRector::class, - StringReturnTypeFromStrictStringReturnsRector::class, - ClosureReturnTypeRector::class, WrapEncapsedVariableInCurlyBracesRector::class, - ReturnTypeFromStrictTypedCallRector::class, - StrictStringParamConcatRector::class, ReturnBinaryOrToEarlyReturnRector::class, RenamePropertyToMatchTypeRector::class, - NumericReturnTypeFromStrictReturnsRector::class, - TypedPropertyFromAssignsRector::class, - TypedPropertyFromStrictConstructorRector::class, - AddReturnTypeDeclarationBasedOnParentClassMethodRector::class, RenameForeachValueVariableToMatchExprVariableRector::class, - BoolReturnTypeFromBooleanConstReturnsRector::class, - ReturnTypeFromReturnCastRector::class, - StringReturnTypeFromStrictScalarReturnsRector::class, - ReturnTypeFromStrictConstantReturnRector::class, PostIncDecToPreIncDecRector::class, MultiDirnameRector::class, - ReturnTypeFromStrictTernaryRector::class, - AddClosureVoidReturnTypeWhereNoReturnRector::class, FlipTypeControlToUseExclusiveTypeRector::class, NullableCompareToNullRector::class, - ReturnTypeFromReturnNewRector::class, MakeInheritedMethodVisibilitySameAsParentRector::class, - NumericReturnTypeFromStrictScalarReturnsRector::class, - ReturnNeverTypeRector::class, CallUserFuncArrayToVariadicRector::class, CatchExceptionNameMatchingTypeRector::class, ChangeOrIfContinueToMultiContinueRector::class, ReturnEarlyIfVariableRector::class, SimplifyQuoteEscapeRector::class, - AddParamArrayDocblockFromAssignsParamToParamReferenceRector::class, - AddParamArrayDocblockFromDimFetchAccessRector::class, RepeatedAndNotEqualToNotInArrayRector::class, UseIdenticalOverEqualWithSameTypeRector::class, - AddParamFromDimFetchKeyUseRector::class, - DocblockReturnArrayFromDirectArrayInstanceRector::class, - AddArrayFunctionClosureParamTypeRector::class, RenameParamToMatchTypeRector::class, - AddArrowFunctionParamArrayWhereDimFetchRector::class, NewlineBetweenClassLikeStmtsRector::class, - AddClosureParamTypeForArrayMapRector::class, - KnownMagicClassMethodTypeRector::class, - AddParamStringTypeFromSprintfUseRector::class, AbsolutizeRequireAndIncludePathRector::class, CompleteDynamicPropertiesRector::class, RemoveParentCallWithoutParentRector::class, diff --git a/square/helpers/FrmSquareLiteConnectHelper.php b/square/helpers/FrmSquareLiteConnectHelper.php index b0322014de..7e82fb1ea0 100644 --- a/square/helpers/FrmSquareLiteConnectHelper.php +++ b/square/helpers/FrmSquareLiteConnectHelper.php @@ -233,7 +233,7 @@ private static function get_url_to_connect_server() { } /** - * @return array + * @return array */ private static function build_headers_for_post() { $password = self::maybe_get_pro_license(); @@ -548,7 +548,7 @@ private static function post_with_authenticated_body( $action, $additional_body } /** - * @return array + * @return array */ private static function get_standard_authenticated_body() { $mode = self::get_mode_value_from_post(); diff --git a/square/models/FrmSquareLiteSettings.php b/square/models/FrmSquareLiteSettings.php index 82ca72bd87..3ddf2a1f8e 100644 --- a/square/models/FrmSquareLiteSettings.php +++ b/square/models/FrmSquareLiteSettings.php @@ -22,7 +22,7 @@ public function param() { } /** - * @return array + * @return array */ public function default_options() { return array( diff --git a/stripe/controllers/FrmStrpLiteSettingsController.php b/stripe/controllers/FrmStrpLiteSettingsController.php index a5c58e118a..6c94815959 100644 --- a/stripe/controllers/FrmStrpLiteSettingsController.php +++ b/stripe/controllers/FrmStrpLiteSettingsController.php @@ -63,7 +63,7 @@ public static function global_settings_form( $atts = array() ) { } /** - * @return array + * @return array */ private static function get_default_settings_atts() { return array( diff --git a/stripe/controllers/FrmTransLiteActionsController.php b/stripe/controllers/FrmTransLiteActionsController.php index 5345b4d3e0..082910e627 100755 --- a/stripe/controllers/FrmTransLiteActionsController.php +++ b/stripe/controllers/FrmTransLiteActionsController.php @@ -171,7 +171,7 @@ public static function replace_success_message() { * @param stdClass $entry * @param mixed $form * - * @return array + * @return array */ public static function trigger_gateway( $action, $entry, $form ) { // This function must be overridden in a subclass. diff --git a/stripe/helpers/FrmStrpLiteConnectHelper.php b/stripe/helpers/FrmStrpLiteConnectHelper.php index bdac916439..460e68be22 100644 --- a/stripe/helpers/FrmStrpLiteConnectHelper.php +++ b/stripe/helpers/FrmStrpLiteConnectHelper.php @@ -346,7 +346,7 @@ private static function handle_reauth() { } /** - * @return array + * @return array */ private static function get_standard_authenticated_body() { $mode = self::get_mode_value_from_post(); @@ -514,7 +514,7 @@ private static function pull_response_body( $response ) { } /** - * @return array + * @return array */ private static function build_headers_for_post() { $password = self::maybe_get_pro_license(); diff --git a/stripe/helpers/FrmTransLiteAppHelper.php b/stripe/helpers/FrmTransLiteAppHelper.php index bdf6138cd5..61215174cb 100755 --- a/stripe/helpers/FrmTransLiteAppHelper.php +++ b/stripe/helpers/FrmTransLiteAppHelper.php @@ -226,7 +226,7 @@ public static function format_billing_cycle( $sub ) { } /** - * @return array + * @return array */ public static function get_repeat_times() { return array( @@ -242,7 +242,7 @@ public static function get_repeat_times() { * * @param int $number * - * @return array + * @return array */ private static function get_plural_repeat_times( $number ) { return array( @@ -303,7 +303,7 @@ public static function formatted_amount( $payment ) { * * @param array|float|object|string $payment Payment object, payment array or amount. * - * @return array Return the array with the first element is the amount, the second one is the currency value. + * @return array Return the array with the first element is the amount, the second one is the currency value. */ public static function get_amount_and_currency_from_payment( $payment ) { $currency = ''; diff --git a/stripe/helpers/FrmTransLiteListHelper.php b/stripe/helpers/FrmTransLiteListHelper.php index 9986eb1a49..da692deeeb 100755 --- a/stripe/helpers/FrmTransLiteListHelper.php +++ b/stripe/helpers/FrmTransLiteListHelper.php @@ -160,7 +160,7 @@ public function get_columns() { } /** - * @return array + * @return array */ public function get_sortable_columns() { return array( diff --git a/stripe/models/FrmStrpLiteSettings.php b/stripe/models/FrmStrpLiteSettings.php index 48680c9809..b2317fc1f9 100644 --- a/stripe/models/FrmStrpLiteSettings.php +++ b/stripe/models/FrmStrpLiteSettings.php @@ -23,7 +23,7 @@ public function param() { } /** - * @return array + * @return array */ public function default_options() { return array( diff --git a/stripe/models/FrmTransLiteDb.php b/stripe/models/FrmTransLiteDb.php index 080104ee12..daaeea8d21 100755 --- a/stripe/models/FrmTransLiteDb.php +++ b/stripe/models/FrmTransLiteDb.php @@ -279,7 +279,7 @@ public function get_count() { } /** - * @return array + * @return array{} */ public function get_defaults() { return array(); diff --git a/stripe/models/FrmTransLitePayment.php b/stripe/models/FrmTransLitePayment.php index a759c78213..d310e71b66 100755 --- a/stripe/models/FrmTransLitePayment.php +++ b/stripe/models/FrmTransLitePayment.php @@ -9,7 +9,7 @@ class FrmTransLitePayment extends FrmTransLiteDb { public $singular = 'payment'; /** - * @return array + * @return array> */ public function get_defaults() { return array( diff --git a/stripe/models/FrmTransLiteSubscription.php b/stripe/models/FrmTransLiteSubscription.php index 375ad3ad62..d0cc42780b 100755 --- a/stripe/models/FrmTransLiteSubscription.php +++ b/stripe/models/FrmTransLiteSubscription.php @@ -9,7 +9,7 @@ class FrmTransLiteSubscription extends FrmTransLiteDb { public $singular = 'subscription'; /** - * @return array + * @return array> */ public function get_defaults() { return array( diff --git a/tests/phpunit/base/FrmUnitTest.php b/tests/phpunit/base/FrmUnitTest.php index bda7580627..a5b9ff3d3d 100644 --- a/tests/phpunit/base/FrmUnitTest.php +++ b/tests/phpunit/base/FrmUnitTest.php @@ -469,6 +469,9 @@ public function get_footer_output() { return $output; } + /** + * @return array + */ public static function install_data() { return array( __DIR__ . '/testdata.xml', diff --git a/tests/phpunit/entries/test_FrmTableHTMLGenerator.php b/tests/phpunit/entries/test_FrmTableHTMLGenerator.php index fc89c0be5d..d3913ebe06 100644 --- a/tests/phpunit/entries/test_FrmTableHTMLGenerator.php +++ b/tests/phpunit/entries/test_FrmTableHTMLGenerator.php @@ -62,6 +62,9 @@ public function test_remove_border() { $this->assertEquals( $table_generator->remove_border( $html ), $html ); } + /** + * @return array> + */ private function _get_colors() { $atts = array( 'border_color' => 'ffffff', diff --git a/tests/phpunit/fields/test_FrmFieldValidate.php b/tests/phpunit/fields/test_FrmFieldValidate.php index bb04deb057..93ea209a33 100644 --- a/tests/phpunit/fields/test_FrmFieldValidate.php +++ b/tests/phpunit/fields/test_FrmFieldValidate.php @@ -82,6 +82,9 @@ public function test_format_validation() { } } + /** + * @return array|array> + */ protected function expected_format_errors() { return array( array( diff --git a/tests/phpunit/misc/test_FrmSpamCheckDenylist.php b/tests/phpunit/misc/test_FrmSpamCheckDenylist.php index 9c2994c4df..8647774074 100644 --- a/tests/phpunit/misc/test_FrmSpamCheckDenylist.php +++ b/tests/phpunit/misc/test_FrmSpamCheckDenylist.php @@ -304,6 +304,9 @@ public function test_check_ip() { $_SERVER['REMOTE_ADDR'] = '192.168.1.1'; // Test when IP is blacklisted. + /** + * @return array + */ function frm_test_filter_denylist_ip_data() { return array( 'custom' => array( '192.168.1.1' ), @@ -313,6 +316,9 @@ function frm_test_filter_denylist_ip_data() { add_filter( 'frm_denylist_ips_data', 'frm_test_filter_denylist_ip_data' ); $this->assertTrue( $this->run_private_method( array( $this->spam_check, 'check_ip' ) ) ); + /** + * @return array + */ function frm_test_filter_allowed_ips() { return array( '192.168.1.1' ); } @@ -323,6 +329,9 @@ function frm_test_filter_allowed_ips() { remove_filter( 'frm_denylist_ips_data', 'frm_test_filter_denylist_ip_data' ); // Test IP CIDR format. + /** + * @return array + */ function frm_test_filter_denylist_ip_data_2() { return array( 'custom' => array(), diff --git a/tests/phpunit/stripe/FrmStrpLiteUnitTest.php b/tests/phpunit/stripe/FrmStrpLiteUnitTest.php index a33e339ed0..3501c01c15 100644 --- a/tests/phpunit/stripe/FrmStrpLiteUnitTest.php +++ b/tests/phpunit/stripe/FrmStrpLiteUnitTest.php @@ -142,6 +142,9 @@ protected function add_card( $customer_id ) { return $card; } + /** + * @return array + */ protected function get_stripe_account_id_details() { return array( 'stripe_account' => self::$shared_account_id, @@ -219,7 +222,7 @@ protected function get_new_charge_data( $action_id = 0 ) { } /** - * @return array + * @return array */ protected function get_test_credit_card() { return array( @@ -295,7 +298,7 @@ protected function create_payment_method() { } /** - * @return array + * @return array */ protected function prepare_new_charge_array() { $customer_id = $this->get_customer_id(); diff --git a/tests/phpunit/views/shortcodes/test_FrmFieldShortcodes.php b/tests/phpunit/views/shortcodes/test_FrmFieldShortcodes.php index 70719dfda7..31e6e5ce4c 100644 --- a/tests/phpunit/views/shortcodes/test_FrmFieldShortcodes.php +++ b/tests/phpunit/views/shortcodes/test_FrmFieldShortcodes.php @@ -70,6 +70,9 @@ protected function expected_free_meta() { ); } + /** + * @return array + */ protected function get_expected_field_values() { return array( 'free-text-field' => 'Test Testerson',