Completed
Push — master ( 4e24b6...14289c )
by Jamie
03:44
created
classes/helpers/FrmListHelper.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if ( ! defined('ABSPATH') ) {
2
+if ( ! defined( 'ABSPATH' ) ) {
3 3
 	die( 'You are not allowed to call this page directly.' );
4 4
 }
5 5
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
 		add_filter( "manage_{$this->screen->id}_columns", array( $this, 'get_columns' ), 0 );
106 106
 
107
-		if ( !$args['plural'] )
107
+		if ( ! $args['plural'] )
108 108
 			$args['plural'] = $this->screen->base;
109 109
 
110 110
 		$args['plural'] = sanitize_key( $args['plural'] );
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 			'per_page' => 0,
246 246
 		) );
247 247
 
248
-		if ( !$args['total_pages'] && $args['per_page'] > 0 )
248
+		if ( ! $args['total_pages'] && $args['per_page'] > 0 )
249 249
 			$args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
250 250
 
251 251
 		// Redirect if page number is invalid and headers are not already sent.
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 	 * @return bool
285 285
 	 */
286 286
 	public function has_items() {
287
-		return !empty( $this->items );
287
+		return ! empty( $this->items );
288 288
 	}
289 289
 
290 290
 	/**
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 	 * @param string $input_id The search input id
308 308
 	 */
309 309
 	public function search_box( $text, $input_id ) {
310
-		if ( empty( $_REQUEST['s'] ) && !$this->has_items() )
310
+		if ( empty( $_REQUEST['s'] ) && ! $this->has_items() )
311 311
 			return;
312 312
 
313 313
 		$input_id = $input_id . '-search-input';
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 <p class="search-box">
325 325
 	<label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
326 326
 	<input type="search" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
327
-	<?php submit_button( $text, 'button', '', false, array('id' => 'search-submit') ); ?>
327
+	<?php submit_button( $text, 'button', '', false, array( 'id' => 'search-submit' ) ); ?>
328 328
 </p>
329 329
 <?php
330 330
 	}
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 
368 368
 		echo "<ul class='subsubsub'>\n";
369 369
 		foreach ( $views as $class => $view ) {
370
-			$views[ $class ] = "\t<li class='$class'>$view";
370
+			$views[$class] = "\t<li class='$class'>$view";
371 371
 		}
372 372
 		echo implode( " |</li>\n", $views ) . "</li>\n";
373 373
 		echo "</ul>";
@@ -471,12 +471,12 @@  discard block
 block discarded – undo
471 471
 		$action_count = count( $actions );
472 472
 		$i = 0;
473 473
 
474
-		if ( !$action_count )
474
+		if ( ! $action_count )
475 475
 			return '';
476 476
 
477 477
 		$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
478 478
 		foreach ( $actions as $action => $link ) {
479
-			++$i;
479
+			++ $i;
480 480
 			( $i == $action_count ) ? $sep = '' : $sep = ' | ';
481 481
 			$out .= "<span class='$action'>$link$sep</span>";
482 482
 		}
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 
533 533
 		$month_count = count( $months );
534 534
 
535
-		if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
535
+		if ( ! $month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
536 536
 			return;
537 537
 
538 538
 		$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
 			$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&lsaquo;</span>';
749 749
 		} else {
750 750
 			$page_links[] = sprintf( "<a class='prev-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
751
-				esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
751
+				esc_url( add_query_arg( 'paged', max( 1, $current - 1 ), $current_url ) ),
752 752
 				__( 'Previous page' ),
753 753
 				'&lsaquo;'
754 754
 			);
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 			$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&rsaquo;</span>';
772 772
 		} else {
773 773
 			$page_links[] = sprintf( "<a class='next-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
774
-				esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
774
+				esc_url( add_query_arg( 'paged', min( $total_pages, $current + 1 ), $current_url ) ),
775 775
 				__( 'Next page' ),
776 776
 				'&rsaquo;'
777 777
 			);
@@ -834,7 +834,7 @@  discard block
 block discarded – undo
834 834
 
835 835
 		// We need a primary defined so responsive views show something,
836 836
 		// so let's fall back to the first non-checkbox column.
837
-		foreach( $columns as $col => $column_name ) {
837
+		foreach ( $columns as $col => $column_name ) {
838 838
 			if ( 'cb' === $col ) {
839 839
 				continue;
840 840
 			}
@@ -860,7 +860,7 @@  discard block
 block discarded – undo
860 860
 
861 861
 		// If the primary column doesn't exist fall back to the
862 862
 		// first non-checkbox column.
863
-		if ( ! isset( $columns[ $default ] ) ) {
863
+		if ( ! isset( $columns[$default] ) ) {
864 864
 			$default = FrmListHelper::get_default_primary_column_name();
865 865
 		}
866 866
 
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 		 */
875 875
 		$column  = apply_filters( 'list_table_primary_column', $default, $this->screen->id );
876 876
 
877
-		if ( empty( $column ) || ! isset( $columns[ $column ] ) ) {
877
+		if ( empty( $column ) || ! isset( $columns[$column] ) ) {
878 878
 			$column = $default;
879 879
 		}
880 880
 
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
 			// In 4.3, we added a fourth argument for primary column.
897 897
 			$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
898 898
 			foreach ( $this->_column_headers as $key => $value ) {
899
-				$column_headers[ $key ] = $value;
899
+				$column_headers[$key] = $value;
900 900
 			}
901 901
 
902 902
 			return $column_headers;
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
 				continue;
925 925
 
926 926
 			$data = (array) $data;
927
-			if ( !isset( $data[1] ) )
927
+			if ( ! isset( $data[1] ) )
928 928
 				$data[1] = false;
929 929
 
930 930
 			$sortable[$id] = $data;
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
 			static $cb_counter = 1;
981 981
 			$columns['cb'] = '<label class="screen-reader-text" for="cb-select-all-' . $cb_counter . '">' . __( 'Select All' ) . '</label>'
982 982
 				. '<input id="cb-select-all-' . $cb_counter . '" type="checkbox" />';
983
-			$cb_counter++;
983
+			$cb_counter ++;
984 984
 		}
985 985
 
986 986
 		foreach ( $columns as $column_key => $column_display_name ) {
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
 			$scope = ( 'th' === $tag ) ? 'scope="col"' : '';
1020 1020
 			$id = $with_id ? "id='$column_key'" : '';
1021 1021
 
1022
-			if ( !empty( $class ) )
1022
+			if ( ! empty( $class ) )
1023 1023
 				$class = "class='" . join( ' ', $class ) . "'";
1024 1024
 
1025 1025
 			echo "<$tag $scope $id $class>$column_display_name</$tag>";
Please login to merge, or discard this patch.