Passed
Push — master ( c18f22...92d0a1 )
by Brian
04:39
created
includes/wpinv-helper-functions.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
  */
137 137
 function wpinv_get_invoice_statuses( $draft = false, $trashed = false, $invoice = false ) {
138 138
 
139
-	$invoice_statuses = array(
140
-		'wpi-pending'    => _x( 'Pending payment', 'Invoice status', 'invoicing' ),
139
+    $invoice_statuses = array(
140
+        'wpi-pending'    => _x( 'Pending payment', 'Invoice status', 'invoicing' ),
141 141
         'publish'        => _x( 'Paid', 'Invoice status', 'invoicing' ),
142 142
         'wpi-processing' => _x( 'Processing', 'Invoice status', 'invoicing' ),
143
-		'wpi-onhold'     => _x( 'On hold', 'Invoice status', 'invoicing' ),
144
-		'wpi-cancelled'  => _x( 'Cancelled', 'Invoice status', 'invoicing' ),
145
-		'wpi-refunded'   => _x( 'Refunded', 'Invoice status', 'invoicing' ),
143
+        'wpi-onhold'     => _x( 'On hold', 'Invoice status', 'invoicing' ),
144
+        'wpi-cancelled'  => _x( 'Cancelled', 'Invoice status', 'invoicing' ),
145
+        'wpi-refunded'   => _x( 'Refunded', 'Invoice status', 'invoicing' ),
146 146
         'wpi-failed'     => _x( 'Failed', 'Invoice status', 'invoicing' ),
147 147
         'wpi-renewal'    => _x( 'Renewal Payment', 'Invoice status', 'invoicing' ),
148 148
     );
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         $invoice = $invoice->get_post_type();
160 160
     }
161 161
 
162
-	return apply_filters( 'wpinv_statuses', $invoice_statuses, $invoice );
162
+    return apply_filters( 'wpinv_statuses', $invoice_statuses, $invoice );
163 163
 }
164 164
 
165 165
 /**
@@ -277,25 +277,25 @@  discard block
 block discarded – undo
277 277
  * @return string
278 278
  */
279 279
 function getpaid_get_price_format() {
280
-	$currency_pos = wpinv_currency_position();
281
-	$format       = '%1$s%2$s';
282
-
283
-	switch ( $currency_pos ) {
284
-		case 'left':
285
-			$format = '%1$s%2$s';
286
-			break;
287
-		case 'right':
288
-			$format = '%2$s%1$s';
289
-			break;
290
-		case 'left_space':
291
-			$format = '%1$s %2$s';
292
-			break;
293
-		case 'right_space':
294
-			$format = '%2$s %1$s';
295
-			break;
296
-	}
297
-
298
-	return apply_filters( 'getpaid_price_format', $format, $currency_pos );
280
+    $currency_pos = wpinv_currency_position();
281
+    $format       = '%1$s%2$s';
282
+
283
+    switch ( $currency_pos ) {
284
+        case 'left':
285
+            $format = '%1$s%2$s';
286
+            break;
287
+        case 'right':
288
+            $format = '%2$s%1$s';
289
+            break;
290
+        case 'left_space':
291
+            $format = '%1$s %2$s';
292
+            break;
293
+        case 'right_space':
294
+            $format = '%2$s %1$s';
295
+            break;
296
+    }
297
+
298
+    return apply_filters( 'getpaid_price_format', $format, $currency_pos );
299 299
 }
300 300
 
301 301
 /**
@@ -401,13 +401,13 @@  discard block
 block discarded – undo
401 401
  * @param mixed  $value Value.
402 402
  */
403 403
 function getpaid_maybe_define_constant( $name, $value ) {
404
-	if ( ! defined( $name ) ) {
405
-		define( $name, $value );
406
-	}
404
+    if ( ! defined( $name ) ) {
405
+        define( $name, $value );
406
+    }
407 407
 }
408 408
 
409 409
 function wpinv_get_php_arg_separator_output() {
410
-	return ini_get( 'arg_separator.output' );
410
+    return ini_get( 'arg_separator.output' );
411 411
 }
412 412
 
413 413
 function wpinv_rgb_from_hex( $color ) {
@@ -718,16 +718,16 @@  discard block
 block discarded – undo
718 718
     return wp_kses(
719 719
         html_entity_decode( $var ),
720 720
         array(
721
-			'br'     => array(),
722
-			'em'     => array(),
723
-			'strong' => array(),
724
-			'b'      => array(),
725
-			'small'  => array(),
726
-			'span'   => array(),
727
-			'ul'     => array(),
728
-			'li'     => array(),
729
-			'ol'     => array(),
730
-			'p'      => array(),
721
+            'br'     => array(),
722
+            'em'     => array(),
723
+            'strong' => array(),
724
+            'b'      => array(),
725
+            'small'  => array(),
726
+            'span'   => array(),
727
+            'ul'     => array(),
728
+            'li'     => array(),
729
+            'ol'     => array(),
730
+            'p'      => array(),
731 731
         )
732 732
     );
733 733
 }
@@ -778,11 +778,11 @@  discard block
 block discarded – undo
778 778
         $list = array();
779 779
     }
780 780
 
781
-	if ( ! is_array( $list ) ) {
782
-		return preg_split( '/[\s,]+/', $list, -1, PREG_SPLIT_NO_EMPTY );
783
-	}
781
+    if ( ! is_array( $list ) ) {
782
+        return preg_split( '/[\s,]+/', $list, -1, PREG_SPLIT_NO_EMPTY );
783
+    }
784 784
 
785
-	return $list;
785
+    return $list;
786 786
 }
787 787
 
788 788
 /**
@@ -823,17 +823,17 @@  discard block
 block discarded – undo
823 823
  */
824 824
 function wpinv_clean( $var ) {
825 825
 
826
-	if ( is_array( $var ) ) {
827
-		return array_map( 'wpinv_clean', $var );
826
+    if ( is_array( $var ) ) {
827
+        return array_map( 'wpinv_clean', $var );
828 828
     }
829 829
 
830 830
     if ( is_object( $var ) ) {
831
-		$object_vars = get_object_vars( $var );
832
-		foreach ( $object_vars as $property_name => $property_value ) {
833
-			$var->$property_name = wpinv_clean( $property_value );
831
+        $object_vars = get_object_vars( $var );
832
+        foreach ( $object_vars as $property_name => $property_value ) {
833
+            $var->$property_name = wpinv_clean( $property_value );
834 834
         }
835 835
         return $var;
836
-	}
836
+    }
837 837
 
838 838
     return is_string( $var ) ? sanitize_text_field( stripslashes( $var ) ) : $var;
839 839
 }
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
  */
847 847
 function getpaid_convert_price_string_to_options( $str ) {
848 848
 
849
-	$raw_options = array_map( 'trim', explode( ',', $str ) );
849
+    $raw_options = array_map( 'trim', explode( ',', $str ) );
850 850
     $options     = array();
851 851
 
852 852
     foreach ( $raw_options as $option ) {
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
  * @return string
936 936
  */
937 937
 function getpaid_date_format() {
938
-	return apply_filters( 'getpaid_date_format', get_option( 'date_format' ) );
938
+    return apply_filters( 'getpaid_date_format', get_option( 'date_format' ) );
939 939
 }
940 940
 
941 941
 /**
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
  * @return string
945 945
  */
946 946
 function getpaid_time_format() {
947
-	return apply_filters( 'getpaid_time_format', get_option( 'time_format' ) );
947
+    return apply_filters( 'getpaid_time_format', get_option( 'time_format' ) );
948 948
 }
949 949
 
950 950
 /**
@@ -957,15 +957,15 @@  discard block
 block discarded – undo
957 957
 function getpaid_limit_length( $string, $limit ) {
958 958
     $str_limit = $limit - 3;
959 959
 
960
-	if ( function_exists( 'mb_strimwidth' ) ) {
961
-		if ( mb_strlen( $string ) > $limit ) {
962
-			$string = mb_strimwidth( $string, 0, $str_limit ) . '...';
963
-		}
964
-	} else {
965
-		if ( strlen( $string ) > $limit ) {
966
-			$string = substr( $string, 0, $str_limit ) . '...';
967
-		}
968
-	}
960
+    if ( function_exists( 'mb_strimwidth' ) ) {
961
+        if ( mb_strlen( $string ) > $limit ) {
962
+            $string = mb_strimwidth( $string, 0, $str_limit ) . '...';
963
+        }
964
+    } else {
965
+        if ( strlen( $string ) > $limit ) {
966
+            $string = substr( $string, 0, $str_limit ) . '...';
967
+        }
968
+    }
969 969
     return $string;
970 970
 
971 971
 }
@@ -1095,12 +1095,12 @@  discard block
 block discarded – undo
1095 1095
     $types = get_allowed_mime_types();
1096 1096
 
1097 1097
     if ( isset( $types['htm|html'] ) ) {
1098
-		unset( $types['htm|html'] );
1099
-	}
1098
+        unset( $types['htm|html'] );
1099
+    }
1100 1100
 
1101 1101
     if ( isset( $types['js'] ) ) {
1102
-		unset( $types['js'] );
1103
-	}
1102
+        unset( $types['js'] );
1103
+    }
1104 1104
 
1105 1105
     return $types;
1106 1106
 
Please login to merge, or discard this patch.