Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
$finder = ( new PhpCsFixer\Finder() )->in( __DIR__ );
$rules = array(
// Keep these rules for sure.
'phpdoc_order' => array(
'phpdoc_order' => array(
'order' => array( 'since', 'param', 'throws', 'return' ),
),
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'phpdoc_var_without_name' => true,
'phpdoc_indent' => true,
'align_multiline_comment' => true,
'short_scalar_cast' => true,
'standardize_not_equals' => true,
'echo_tag_syntax' => true,
'semicolon_after_instruction' => true,
'no_useless_else' => true,
'no_superfluous_elseif' => true,
'phpdoc_types_order' => array(
'phpdoc_scalar' => true,
'phpdoc_trim' => true,
'phpdoc_var_without_name' => true,
'phpdoc_separation' => true,
'phpdoc_indent' => true,
'align_multiline_comment' => true,
'short_scalar_cast' => true,
'standardize_not_equals' => true,
'echo_tag_syntax' => true,
'semicolon_after_instruction' => true,
'no_useless_else' => true,
'no_superfluous_elseif' => true,
'elseif' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_types_order' => array(
'null_adjustment' => 'always_last',
),
);
Expand All @@ -28,7 +31,6 @@
return $config->setFinder( $finder );

// Maybe include these.
// 'phpdoc_separation' => true,
// 'phpdoc_summary' => true,
// 'phpdoc_align' => true,
// 'visibility_required' => true,
Expand Down
18 changes: 18 additions & 0 deletions classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ protected static function organize_and_get_categories() {
* @since 6.15
*
* @param array $addon The addon array that will be modified by reference.
*
* @return void
*/
protected static function set_categories( &$addon ) {
Expand Down Expand Up @@ -311,6 +312,7 @@ public static function get_addons_count() {
* If the API is unable to connect, show something on the addons page
*
* @since 3.04.03
*
* @return array
*/
protected static function fallback_plugin_list() {
Expand Down Expand Up @@ -409,6 +411,7 @@ protected static function fallback_plugin_list() {
* If Pro is missing but has been authenticated, include a download URL
*
* @since 3.04.03
*
* @return string
*/
public static function get_pro_download_url() {
Expand Down Expand Up @@ -454,6 +457,7 @@ public static function get_pro_license() {
* @since 4.08
*
* @param array $addons
*
* @return array
*/
protected static function get_pro_from_addons( $addons ) {
Expand Down Expand Up @@ -520,6 +524,7 @@ public static function get_primary_license_info() {
* @since 3.04.03
*
* @param mixed $transient
*
* @return object
*/
public static function check_update( $transient ) {
Expand Down Expand Up @@ -581,6 +586,7 @@ public static function check_update( $transient ) {
* This means that trying to access FrmAppHelper::get_plugins when upgrading from a Lite version before v5.5 results in a one-off error.
*
* @since 5.5.2
*
* @return array
*/
protected static function get_plugins() {
Expand Down Expand Up @@ -661,7 +667,9 @@ protected static function fill_update_addon_info( $installed_addons ) {
* Get the action link for an addon that isn't active.
*
* @since 3.06.03
*
* @param string $plugin The plugin slug.
*
* @return array
*/
public static function install_link( $plugin ) {
Expand Down Expand Up @@ -700,7 +708,9 @@ public static function install_link( $plugin ) {

/**
* @since 4.09
*
* @param string $plugin The plugin slug.
*
* @return array|false
*/
public static function get_addon( $plugin ) {
Expand All @@ -717,6 +727,7 @@ public static function get_addon( $plugin ) {

/**
* @since 4.09
*
* @return string
*/
protected static function get_license_type() {
Expand Down Expand Up @@ -898,6 +909,7 @@ protected static function set_addon_status( &$addon ) {
* @param string $redirect
* @param bool $network_wide
* @param bool $silent
*
* @return WP_Error|null Null on success, WP_Error on invalid file.
*/
protected static function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silent = false ) {
Expand All @@ -914,6 +926,7 @@ protected static function activate_plugin( $plugin, $redirect = '', $network_wid
*
* @param string $plugin
* @param bool $silent
*
* @return void
*/
protected static function deactivate_plugin( $plugin, $silent = false ) {
Expand All @@ -929,6 +942,7 @@ protected static function deactivate_plugin( $plugin, $silent = false ) {
* @since 6.8
*
* @param string $plugin
*
* @return true|WP_Error True on success, WP_Error on invalid file.
*/
protected static function uninstall_plugin( $plugin ) {
Expand Down Expand Up @@ -1134,6 +1148,7 @@ function ( $plugin ) {
*
* @param callable $action_callback The specific add-on action to be executed.
* @param callable|null $response_callback Optional. The response handling callback. Default null.
*
* @return void
*/
private static function process_addon_action( $action_callback, $response_callback = null ) {
Expand All @@ -1158,6 +1173,7 @@ private static function process_addon_action( $action_callback, $response_callba
*
* @param string $installed The plugin folder name with file name.
* @param string $action The action type ('activate', 'deactivate', 'uninstall').
*
* @return array|void
*/
protected static function handle_addon_action( $installed, $action ) {
Expand Down Expand Up @@ -1375,6 +1391,7 @@ private static function maybe_download_and_activate() {
*
* @param string $plugin
* @param array|string $upgrade_link_args
*
* @return void
*/
public static function conditional_action_button( $plugin, $upgrade_link_args ) {
Expand Down Expand Up @@ -1411,6 +1428,7 @@ public static function conditional_action_button( $plugin, $upgrade_link_args )
* @type string $plan_required
* @type string $upgrade_link
* }
*
* @return void
*/
public static function show_conditional_action_button( $atts ) {
Expand Down
2 changes: 2 additions & 0 deletions classes/controllers/FrmAntiSpamController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Anti-spam controller
*
* @package Formidable
*
* @since 6.21
*/

Expand Down Expand Up @@ -102,6 +103,7 @@ public static function get_default_spam_message() {
* Extracts email addresses from values.
*
* @param array $values Values to check.
*
* @return string[]
*/
public static function extract_emails_from_values( $values ) {
Expand Down
13 changes: 13 additions & 0 deletions classes/controllers/FrmAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ private static function menu_icon() {
* @since 3.0
*
* @param string $classes
*
* @return string
*/
public static function add_admin_class( $classes ) {
Expand Down Expand Up @@ -204,6 +205,7 @@ private static function is_grey_page() {
* @since 6.8
*
* @param bool $is_grey_page
*
* @return bool
*/
return apply_filters( 'frm_is_grey_page', $is_grey_page );
Expand All @@ -213,6 +215,7 @@ private static function is_grey_page() {
* @since 6.8
*
* @param array $pages A list of page names to check.
*
* @return bool
*/
private static function is_page_in_list( $pages ) {
Expand Down Expand Up @@ -271,6 +274,7 @@ private static function get_current_page() {

/**
* @param object $form
*
* @return array
*/
private static function get_form_nav_items( $form ) {
Expand Down Expand Up @@ -348,6 +352,7 @@ private static function get_form_nav_items( $form ) {
* Adds a settings link to the plugins page
*
* @param array $links
*
* @return array
*/
public static function settings_link( $links ) {
Expand Down Expand Up @@ -460,6 +465,7 @@ public static function upgrade_overlay_html() {
* @param string $form_key
* @param string $title
* @param string $description
*
* @return void
*/
public static function api_email_form( $form_key, $title = '', $description = '' ) {
Expand Down Expand Up @@ -518,6 +524,7 @@ public static function install_js_fallback() {
* Check if the database is outdated
*
* @since 2.0.1
*
* @return bool
*/
public static function needs_update() {
Expand All @@ -542,6 +549,7 @@ public static function needs_update() {
* @since 3.0.04
*
* @param array $atts
*
* @return bool
*/
public static function compare_for_update( $atts ) {
Expand Down Expand Up @@ -804,6 +812,7 @@ public static function admin_js() {
*
* @param string $plugin_url The plugin URL.
* @param string $version The plugin version.
*
* @return void
*/
private static function enqueue_builder_assets( $plugin_url, $version ) {
Expand Down Expand Up @@ -838,6 +847,7 @@ private static function enqueue_global_settings_scripts( $page ) {
* @since 6.11
*
* @param string $page
*
* @return void
*/
private static function maybe_enqueue_dropzone_css( $page ) {
Expand Down Expand Up @@ -1297,6 +1307,7 @@ private static function should_show_footer_links() {
* @since 6.7
*
* @param bool $show_footer_links
*
* @return bool
*/
return apply_filters( 'frm_show_footer_links', $show_footer_links );
Expand Down Expand Up @@ -1343,6 +1354,7 @@ public static function show_error_modal( $error_args ) {
*
* @param string $plugin_url URL of the plugin.
* @param string $version Current version of the plugin.
*
* @return void
*/
private static function enqueue_floating_links( $plugin_url, $version ) {
Expand Down Expand Up @@ -1514,6 +1526,7 @@ private static function remember_custom_sort() {
*
* @param string &$orderby Reference to the current 'orderby' parameter.
* @param string &$order Reference to the current 'order' parameter.
*
* @return void
*/
public static function apply_saved_sort_preference( &$orderby, &$order ) {
Expand Down
3 changes: 3 additions & 0 deletions classes/controllers/FrmApplicationsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ private static function get_prepared_template_data() {
/**
* @param array $total the accumulated array of reduced application data.
* @param array $current data for the current template from the API.
*
* @return array<array>
*/
private static function reduce_template( $total, $current ) {
Expand All @@ -154,6 +155,7 @@ private static function reduce_template( $total, $current ) {
* Sort applications alphabetically.
*
* @param array<array> $applications
*
* @return array<array>
*/
private static function sort_templates( $applications ) {
Expand Down Expand Up @@ -220,6 +222,7 @@ public static function dequeue_scripts() {
/**
* @param string $title
* @param string $context values include 'index', 'list', and 'edit'.
*
* @return void
*/
public static function render_applications_header( $title, $context ) {
Expand Down
9 changes: 9 additions & 0 deletions classes/controllers/FrmDashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ private static function view_args_payments() {
* Init view args for entries placeholder.
*
* @param array $forms_count The total forms count. If there are no any forms yet, we'll have CTA pointing to creating a form.
*
* @return array
*/
private static function view_args_entries_placeholder( $forms_count ) {
Expand Down Expand Up @@ -290,6 +291,7 @@ private static function view_args_entries_placeholder( $forms_count ) {
* @param string $counter_type
* @param int $counter_value
* @param false|object $latest_available_form The form object of the latest form available. If there are at least one form available we show "Add Entry" cta for entries counter.
*
* @return array
*/
public static function display_counter_cta( $counter_type, $counter_value, $latest_available_form = false ) {
Expand Down Expand Up @@ -345,6 +347,7 @@ public static function ajax_requests() {
* Hook name: manage_formidable_page_formidable-dashboard_columns.
*
* @param array $columns An associative array of column headings.
*
* @return array
*/
public static function entries_columns( $columns = array() ) {
Expand Down Expand Up @@ -383,6 +386,7 @@ public static function is_dashboard_page() {
* Detect if the logged user's email is subscribed. Used for inbox email subscribe.
*
* @param string $email The logged user's email.
*
* @return bool
*/
public static function email_is_subscribed( $email ) {
Expand Down Expand Up @@ -429,6 +433,7 @@ private static function view_args_inbox() {
* Prepare inbox messages data.
*
* @param array $data
*
* @return array
*/
private static function inbox_prepare_messages( $data ) {
Expand All @@ -446,6 +451,7 @@ private static function inbox_prepare_messages( $data ) {
* Clean messages CTA.
*
* @param string $cta
*
* @return string
*/
private static function inbox_clean_messages_cta( $cta ) {
Expand All @@ -459,6 +465,7 @@ private static function inbox_clean_messages_cta( $cta ) {
* Get the embed YouTube video from YouTube feed api. If there are 0 entries we show the welcome video otherwise latest video from FF YouTube channel is displayed.
*
* @param int $entries_count The total entries available.
*
* @return string|null The YouTube video ID.
*/
private static function get_youtube_embed_video( $entries_count ) {
Expand All @@ -484,6 +491,7 @@ private static function get_youtube_embed_video( $entries_count ) {
* Used for Inbox widget - email subscribe.
*
* @param string $email The user email address.
*
* @return void
*/
private static function save_subscribed_email( $email ) {
Expand Down Expand Up @@ -516,6 +524,7 @@ private static function get_subscribed_emails() {
* Get the dashboard options from db.
*
* @param string|null $option_name The dashboard option name. If null it will return all dashboard options.
*
* @return array
*/
private static function get_dashboard_options( $option_name = null ) {
Expand Down
Loading
Loading