Completed
Pull Request — develop (#1404)
by Gennady
06:10
created
includes/class-gravityview-image.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 
66 66
 		$atts = wp_parse_args( $atts, $defaults );
67 67
 
68
-		foreach( $atts as $key => $val ) {
68
+		foreach ( $atts as $key => $val ) {
69 69
 			$this->{$key} = $val;
70 70
 		}
71 71
 
72
-		$this->class = !empty( $this->class ) ? esc_attr( implode( ' ', (array)$this->class ) ) : $this->class;
72
+		$this->class = ! empty( $this->class ) ? esc_attr( implode( ' ', (array)$this->class ) ) : $this->class;
73 73
 
74 74
 		$this->set_image_size();
75 75
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	 */
86 86
 	function validate_image_src() {
87 87
 
88
-		if ( !$this->validate_src ) { return true; }
88
+		if ( ! $this->validate_src ) { return true; }
89 89
 
90 90
 		$info = pathinfo( $this->src );
91 91
 
@@ -93,9 +93,9 @@  discard block
 block discarded – undo
93 93
 		 * @filter `gravityview_image_extensions` Extensions that GravityView recognizes as valid images to be shown in an `img` tag
94 94
 		 * @param array $image_exts Default: `['jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico']`
95 95
 		 */
96
-		$image_exts = apply_filters( 'gravityview_image_extensions', array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ));
96
+		$image_exts = apply_filters( 'gravityview_image_extensions', array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ) );
97 97
 
98
-		return isset( $info['extension'] ) && in_array( strtolower( $info['extension'] ), $image_exts);
98
+		return isset( $info[ 'extension' ] ) && in_array( strtolower( $info[ 'extension' ] ), $image_exts );
99 99
 	}
100 100
 
101 101
 	/**
@@ -111,16 +111,16 @@  discard block
 block discarded – undo
111 111
 
112 112
 			// And there is no string size passed
113 113
 			// 		And we want to get the image size using PHP
114
-			if ( empty( $string ) && !empty( $this->getimagesize ) ) {
114
+			if ( empty( $string ) && ! empty( $this->getimagesize ) ) {
115 115
 
116 116
 				$image_size = @getimagesize( $this->src );
117 117
 
118 118
 				// If it didn't return a response, it may be a HTTPS/SSL error
119
-				if ( empty( $image_size[0] ) ) {
119
+				if ( empty( $image_size[ 0 ] ) ) {
120 120
 					$image_size = @getimagesize( set_url_scheme( $this->src, 'http' ) );
121 121
 				}
122 122
 
123
-				if ( !empty( $image_size ) ) {
123
+				if ( ! empty( $image_size ) ) {
124 124
 					list( $width, $height ) = $image_size;
125 125
 				}
126 126
 
@@ -133,33 +133,33 @@  discard block
 block discarded – undo
133 133
 				 * @param array $image_sizes Array of image sizes with the key being the size slug, and the value being an array with `width` and `height` defined, in pixels
134 134
 				 */
135 135
 				$image_sizes = apply_filters( 'gravityview_image_sizes', array(
136
-					'tiny' => array('width' => 40, 'height' => 30),
137
-					'small' => array('width' => 100, 'height' => 75),
138
-					'medium' => array('width' => 250, 'height' => 188),
139
-					'large' => array('width' => 448, 'height' => 336),
136
+					'tiny' => array( 'width' => 40, 'height' => 30 ),
137
+					'small' => array( 'width' => 100, 'height' => 75 ),
138
+					'medium' => array( 'width' => 250, 'height' => 188 ),
139
+					'large' => array( 'width' => 448, 'height' => 336 ),
140 140
 				) );
141 141
 
142
-				switch( $this->size ) {
142
+				switch ( $this->size ) {
143 143
 					case 'tiny':
144
-						extract($image_sizes['tiny']);
144
+						extract( $image_sizes[ 'tiny' ] );
145 145
 						break;
146 146
 					case 'small':
147 147
 					case 's':
148 148
 					case 'thumb':
149
-						extract($image_sizes['small']);
149
+						extract( $image_sizes[ 'small' ] );
150 150
 						break;
151 151
 					case 'm':
152 152
 					case 'medium':
153
-						extract($image_sizes['medium']);
153
+						extract( $image_sizes[ 'medium' ] );
154 154
 						break;
155 155
 					case 'large':
156 156
 					case 'l':
157
-						extract($image_sizes['large']);
157
+						extract( $image_sizes[ 'large' ] );
158 158
 						break;
159 159
 					default:
160 160
 						// Verify that the passed sizes are integers.
161
-						$width = !empty( $width ) ? intval( $width ) : intval( $this->width );
162
-						$height = !empty( $height ) ? intval( $height ) : intval( $this->height );
161
+						$width = ! empty( $width ) ? intval( $width ) : intval( $this->width );
162
+						$height = ! empty( $height ) ? intval( $height ) : intval( $this->height );
163 163
 				}
164 164
 
165 165
 			}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-transaction-id.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
 	var $is_numeric = true;
16 16
 
17
-	var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with'  );
17
+	var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' );
18 18
 
19 19
 	var $group = 'pricing';
20 20
 
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-product.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	function clear_product_info_cache( $form = array(), $entry_id = 0, $Edit_Entry_Render = null ) {
51 51
 
52
-		if( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) {
52
+		if ( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) {
53 53
 			return;
54 54
 		}
55 55
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 		 * @see GVCommon::entry_has_transaction_data()
102 102
 		 * @param boolean $hide_product_fields Whether to hide product fields in the editor. Uses $entry data to determine.
103 103
 		 */
104
-		$hide_product_fields = (bool) apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data );
104
+		$hide_product_fields = (bool)apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data );
105 105
 
106 106
 		return $hide_product_fields;
107 107
 	}
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-transaction-type.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	public function get_content( $output, $entry = array(), $field_settings = array(), $field = array() ) {
60 60
 
61 61
 		/** Overridden by a template. */
62
-		if( ! empty( $field['field_path'] ) ) { return $output; }
62
+		if ( ! empty( $field[ 'field_path' ] ) ) { return $output; }
63 63
 
64 64
 		return $this->get_string_from_value( $output );
65 65
 	}
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 		switch ( intval( $value ) ) {
79 79
 			case self::ONE_TIME_PAYMENT:
80 80
 			default:
81
-				$return = __('One-Time Payment', 'gravityview');
81
+				$return = __( 'One-Time Payment', 'gravityview' );
82 82
 				break;
83 83
 
84 84
 			case self::SUBSCRIPTION:
85
-				$return = __('Subscription', 'gravityview');
85
+				$return = __( 'Subscription', 'gravityview' );
86 86
 				break;
87 87
 		}
88 88
 
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-gravity-perks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 	public function edit_entry_fix_uid_fields( $fields ) {
51 51
 
52 52
 		/** @var GF_Field $field */
53
-		foreach( $fields as &$field ) {
53
+		foreach ( $fields as &$field ) {
54 54
 			if ( 'uid' === $field->type ) {
55 55
 
56 56
 				// Replace GF_Field with GF_Field_Text, copying all the data from $field
Please login to merge, or discard this patch.
class-gravityview-plugin-hooks-gravity-forms-coupon.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		 */
54 54
 		$hide_coupon_fields = apply_filters( 'gravityview/edit_entry/hide-coupon-fields', $has_transaction_data );
55 55
 
56
-		return (bool) $hide_coupon_fields;
56
+		return (bool)$hide_coupon_fields;
57 57
 	}
58 58
 
59 59
 	/**
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	public function edit_entry_field_blacklist( $blacklist = array(), $entry = array() ) {
70 70
 
71 71
 		if ( $this->should_hide_coupon_fields( $entry ) ) {
72
-			$blacklist[] = 'coupon';
72
+			$blacklist[ ] = 'coupon';
73 73
 		}
74 74
 
75 75
 		return $blacklist;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		// No coupons match the codes provided
108 108
 		$discounts = gf_coupons()->get_coupons_by_codes( $coupon_codes, $form );
109 109
 
110
-		if( ! $discounts ) {
110
+		if ( ! $discounts ) {
111 111
 			return $value;
112 112
 		}
113 113
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 		 * @see GF_Field_Coupon::get_field_input
117 117
 		 */
118 118
 		$_POST = ! isset( $_POST ) ? array() : $_POST;
119
-		$_POST[ 'gf_coupons_' . $form['id'] ] = json_encode( (array) $discounts );
119
+		$_POST[ 'gf_coupons_' . $form[ 'id' ] ] = json_encode( (array)$discounts );
120 120
 		$_POST[ 'input_' . $field->id ] = implode( ',', $coupon_codes );
121 121
 
122 122
 		return $value;
Please login to merge, or discard this patch.
includes/admin/field-types/type_multiselect.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 		?>
14 14
 		<label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>"><?php
15 15
 
16
-			echo '<span class="gv-label">'.$this->get_field_label().'</span>';
16
+			echo '<span class="gv-label">' . $this->get_field_label() . '</span>';
17 17
 
18 18
 			echo $this->get_tooltip() . $this->get_field_desc();
19 19
 
@@ -26,14 +26,14 @@  discard block
 block discarded – undo
26 26
 
27 27
 	function render_input( $override_input = null ) {
28 28
 
29
-		if( isset( $override_input ) ) {
29
+		if ( isset( $override_input ) ) {
30 30
 			echo $override_input;
31 31
 			return;
32 32
 		}
33 33
 
34 34
 		?>
35 35
 		<select name="<?php echo esc_attr( $this->name ); ?>[]" id="<?php echo $this->get_field_id(); ?>" multiple="multiple">
36
-			<?php foreach( $this->field['options'] as $value => $label ) : ?>
36
+			<?php foreach ( $this->field[ 'options' ] as $value => $label ) : ?>
37 37
 				<option value="<?php echo esc_attr( $value ); ?>" <?php selected( in_array( $value, (array)$this->value ), true, true ); ?>><?php echo esc_html( $label ); ?></option>
38 38
 			<?php endforeach; ?>
39 39
 		</select>
Please login to merge, or discard this patch.
future/includes/class-gv-collection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @return void
26 26
 	 */
27 27
 	public function add( $value ) {
28
-		$this->storage []= $value;
28
+		$this->storage [ ] = $value;
29 29
 	}
30 30
 
31 31
 	/**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @return void
50 50
 	 */
51 51
 	public function merge( \GV\Collection $collection ) {
52
-		array_map( array( $this, 'add'), $collection->all() );
52
+		array_map( array( $this, 'add' ), $collection->all() );
53 53
 	}
54 54
 
55 55
 	/**
Please login to merge, or discard this patch.
future/includes/class-gv-logger.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
      *
37 37
      * @return void
38 38
      */
39
-    public function emergency($message, array $context = array())
39
+    public function emergency( $message, array $context = array() )
40 40
     {
41
-        $this->log(LogLevel::EMERGENCY, $message, $context);
41
+        $this->log( LogLevel::EMERGENCY, $message, $context );
42 42
     }
43 43
 
44 44
     /**
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
      *
53 53
      * @return void
54 54
      */
55
-    public function alert($message, array $context = array())
55
+    public function alert( $message, array $context = array() )
56 56
     {
57
-        $this->log(LogLevel::ALERT, $message, $context);
57
+        $this->log( LogLevel::ALERT, $message, $context );
58 58
     }
59 59
 
60 60
     /**
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
      *
68 68
      * @return void
69 69
      */
70
-    public function critical($message, array $context = array())
70
+    public function critical( $message, array $context = array() )
71 71
     {
72
-        $this->log(LogLevel::CRITICAL, $message, $context);
72
+        $this->log( LogLevel::CRITICAL, $message, $context );
73 73
     }
74 74
 
75 75
     /**
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
      *
82 82
      * @return void
83 83
      */
84
-    public function error($message, array $context = array())
84
+    public function error( $message, array $context = array() )
85 85
     {
86
-        $this->log(LogLevel::ERROR, $message, $context);
86
+        $this->log( LogLevel::ERROR, $message, $context );
87 87
     }
88 88
 
89 89
     /**
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
      *
98 98
      * @return void
99 99
      */
100
-    public function warning($message, array $context = array())
100
+    public function warning( $message, array $context = array() )
101 101
     {
102
-        $this->log(LogLevel::WARNING, $message, $context);
102
+        $this->log( LogLevel::WARNING, $message, $context );
103 103
     }
104 104
 
105 105
     /**
@@ -110,9 +110,9 @@  discard block
 block discarded – undo
110 110
      *
111 111
      * @return void
112 112
      */
113
-    public function notice($message, array $context = array())
113
+    public function notice( $message, array $context = array() )
114 114
     {
115
-        $this->log(LogLevel::NOTICE, $message, $context);
115
+        $this->log( LogLevel::NOTICE, $message, $context );
116 116
     }
117 117
 
118 118
     /**
@@ -125,9 +125,9 @@  discard block
 block discarded – undo
125 125
      *
126 126
      * @return void
127 127
      */
128
-    public function info($message, array $context = array())
128
+    public function info( $message, array $context = array() )
129 129
     {
130
-        $this->log(LogLevel::INFO, $message, $context);
130
+        $this->log( LogLevel::INFO, $message, $context );
131 131
     }
132 132
 
133 133
     /**
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
      *
139 139
      * @return void
140 140
      */
141
-    public function debug($message, array $context = array())
141
+    public function debug( $message, array $context = array() )
142 142
     {
143
-        $this->log(LogLevel::DEBUG, $message, $context);
143
+        $this->log( LogLevel::DEBUG, $message, $context );
144 144
     }
145 145
 
146 146
 	/**
Please login to merge, or discard this patch.