Skip to content

Commit 4f30f58

Browse files
authored
Merge pull request #2769 from Strategy11/new_sniff_to_remove_unnecessary_whitespace_in_small_if_conditions
New sniff to remove unnecessary white space in small if conditions
2 parents 0a1a156 + 533e20d commit 4f30f58

File tree

14 files changed

+141
-21
lines changed

14 files changed

+141
-21
lines changed

classes/controllers/FrmAddonsController.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ public static function license_settings() {
269269

270270
if ( ! $plugins ) {
271271
esc_html_e( 'There are no plugins on your site that require a license', 'formidable' );
272-
273272
return;
274273
}
275274

@@ -1546,7 +1545,6 @@ private static function allowed_external_urls() {
15461545

15471546
if ( ! is_array( $allowed_url_list ) ) {
15481547
_doing_it_wrong( __METHOD__, 'Only an array of URLs could be used within this filter.', '6.3.1' );
1549-
15501548
return array();
15511549
}
15521550

classes/controllers/FrmFormsController.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ public static function delete_all() {
978978

979979
if ( $permission_error !== false ) {
980980
self::display_forms_list( array(), '', array( $permission_error ) );
981-
982981
return;
983982
}
984983

@@ -2027,23 +2026,20 @@ public static function process_bulk_form_actions( $errors ) {
20272026

20282027
if ( $bulkaction && str_starts_with( $bulkaction, 'bulk_' ) ) {
20292028
FrmAppHelper::remove_get_action();
2030-
20312029
$bulkaction = str_replace( 'bulk_', '', $bulkaction );
20322030
}
20332031

20342032
$ids = FrmAppHelper::get_param( 'item-action', '', 'get', 'sanitize_text_field' );
20352033

20362034
if ( ! $ids ) {
20372035
$errors[] = __( 'No forms were specified', 'formidable' );
2038-
20392036
return $errors;
20402037
}
20412038

20422039
$permission_error = FrmAppHelper::permission_nonce_error( '', '_wpnonce', 'bulk-toplevel_page_formidable' );
20432040

20442041
if ( $permission_error !== false ) {
20452042
$errors[] = $permission_error;
2046-
20472043
return $errors;
20482044
}
20492045

classes/helpers/FrmAppHelper.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,7 +2082,6 @@ public static function post_edit_link( $post_id ) {
20822082

20832083
if ( $post ) {
20842084
$post_url = admin_url( 'post.php?post=' . $post_id . '&action=edit' );
2085-
20862085
return '<a href="' . esc_url( $post_url ) . '">' . self::truncate( $post->post_title, 50 ) . '</a>';
20872086
}
20882087

@@ -2389,7 +2388,6 @@ public static function permission_check( $permission, $show_message = 'show' ) {
23892388
public static function permission_nonce_error( $permission, $nonce_name = '', $nonce = '' ) {
23902389
if ( $permission && ! current_user_can( $permission ) && ! current_user_can( 'administrator' ) ) {
23912390
$frm_settings = self::get_settings();
2392-
23932391
return $frm_settings->admin_permission;
23942392
}
23952393

classes/helpers/FrmEntriesListHelper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ public function no_items() {
208208

209209
if ( $s ) {
210210
esc_html_e( 'No Entries Found', 'formidable' );
211-
212211
return;
213212
}
214213

classes/helpers/FrmFormsHelper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1726,7 +1726,6 @@ public static function get_plan_required( &$item ) {
17261726
foreach ( $item['categories'] as $k => $category ) {
17271727
if ( in_array( $category, $plans, true ) ) {
17281728
unset( $item['categories'][ $k ] );
1729-
17301729
return self::convert_legacy_package_names( $category );
17311730
}
17321731
}

classes/helpers/FrmXMLHelper.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,6 @@ private static function remove_default_html( $html_name, $defaults, &$options )
18651865
// phpcs:ignore Universal.Operators.StrictComparisons
18661866
if ( $old_html == $default_html ) {
18671867
unset( $options[ $html_name ] );
1868-
18691868
return;
18701869
}
18711870

classes/models/FrmAddon.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,6 @@ private function get_license_status() {
867867

868868
if ( empty( $this->license ) ) {
869869
$response['error'] = false;
870-
871870
return $response;
872871
}
873872

classes/models/FrmCreateFile.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ public function append_file( $file_content ) {
106106
if ( $this->has_permission ) {
107107

108108
if ( file_exists( $this->new_file_path ) ) {
109-
110109
$existing_content = $this->get_contents();
111110
$file_content = $existing_content . $file_content;
112111
}

classes/models/FrmEntryMeta.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ public static function get_entry_meta_by_field( $entry_id, $field_id ) {
276276

277277
if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) {
278278
$result = $cached->metas[ $field_id ];
279-
280279
return wp_unslash( $result );
281280
}
282281

classes/models/FrmEntryValidate.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ public static function validate( $values, $exclude = false ) {
2424

2525
if ( ! isset( $values['form_id'] ) || ! isset( $values['item_meta'] ) ) {
2626
$errors['form'] = __( 'There was a problem with your submission. Please try again.', 'formidable' );
27-
2827
return $errors;
2928
}
3029

@@ -1128,8 +1127,7 @@ private static function get_all_form_ids_and_flatten_meta( &$values ) { // phpcs
11281127

11291128
// Convert name array to string.
11301129
if ( isset( $subsubvalue['first'] ) && isset( $subsubvalue['last'] ) ) {
1131-
$subsubvalue = trim( implode( ' ', $subsubvalue ) );
1132-
1130+
$subsubvalue = trim( implode( ' ', $subsubvalue ) );
11331131
$values['name_field_ids'][] = $subsubindex;
11341132
}
11351133

0 commit comments

Comments
 (0)