Completed
Pull Request — develop (#1620)
by Zack
15:37
created
includes/presets/default-table/class-gravityview-default-template-table.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -88,15 +88,15 @@
 block discarded – undo
88 88
 	 */
89 89
 	public function maybe_modify_button_label( $label = '', $atts = array() ) {
90 90
 
91
-		if( $this->template_id !== \GV\Utils::get( $atts, 'template_id' ) ) {
91
+		if ( $this->template_id !== \GV\Utils::get( $atts, 'template_id' ) ) {
92 92
 			return $label;
93 93
 		}
94 94
 
95
-		if( 'field' !== \GV\Utils::get( $atts, 'type' ) ) {
95
+		if ( 'field' !== \GV\Utils::get( $atts, 'type' ) ) {
96 96
 			return $label;
97 97
 		}
98 98
 
99
-		if( 'edit' === \GV\Utils::get( $atts, 'zone' ) ) {
99
+		if ( 'edit' === \GV\Utils::get( $atts, 'zone' ) ) {
100 100
 			return $label;
101 101
 		}
102 102
 
Please login to merge, or discard this patch.
includes/admin/class.field.type.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -33,14 +33,14 @@  discard block
 block discarded – undo
33 33
         $defaults = self::get_field_defaults();
34 34
 
35 35
         // Backward compatibility
36
-        if( !empty( $field['choices'] ) ) {
37
-        	$field['options'] = $field['choices'];
38
-        	unset( $field['choices'] );
36
+        if ( ! empty( $field[ 'choices' ] ) ) {
37
+        	$field[ 'options' ] = $field[ 'choices' ];
38
+        	unset( $field[ 'choices' ] );
39 39
         }
40 40
 
41
-        $this->field =  wp_parse_args( $field, $defaults );
41
+        $this->field = wp_parse_args( $field, $defaults );
42 42
 
43
-        $this->value = is_null( $curr_value ) ? $this->field['value'] : $curr_value;
43
+        $this->value = is_null( $curr_value ) ? $this->field[ 'value' ] : $curr_value;
44 44
 
45 45
     }
46 46
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
 
81 81
     function get_tooltip() {
82
-        if( ! function_exists('gform_tooltip') ) {
82
+        if ( ! function_exists( 'gform_tooltip' ) ) {
83 83
             return null;
84 84
         }
85 85
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	    	'url' => '#',
90 90
 	    ) );
91 91
 
92
-        return !empty( $this->field['tooltip'] ) ? ' '. $this->tooltip( $this->field['tooltip'], false, true, $article ) : null;
92
+        return ! empty( $this->field[ 'tooltip' ] ) ? ' ' . $this->tooltip( $this->field[ 'tooltip' ], false, true, $article ) : null;
93 93
     }
94 94
 
95 95
     /**
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 	     * Below this line has been modified by GravityView.
133 133
 	     */
134 134
 
135
-		if ( empty( $tooltip_text ) && empty( $article['id'] ) ) {
135
+		if ( empty( $tooltip_text ) && empty( $article[ 'id' ] ) ) {
136 136
 			return '';
137 137
 		}
138 138
 
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
      * @return string
169 169
      */
170 170
     function get_field_id() {
171
-        if( isset( $this->field['id'] ) ) {
172
-            return esc_attr( $this->field['id'] );
171
+        if ( isset( $this->field[ 'id' ] ) ) {
172
+            return esc_attr( $this->field[ 'id' ] );
173 173
         }
174 174
         return esc_attr( sanitize_html_class( $this->name ) );
175 175
     }
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
      * @return string
180 180
      */
181 181
     function get_field_label() {
182
-        return esc_html( trim( $this->field['label'] ) );
182
+        return esc_html( trim( $this->field[ 'label' ] ) );
183 183
     }
184 184
 
185 185
 	/**
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 * @return string
191 191
 	 */
192 192
 	function get_field_left_label() {
193
-		return ! empty( $this->field['left_label'] ) ? esc_html( trim( $this->field['left_label'] ) ) : NULL;
193
+		return ! empty( $this->field[ 'left_label' ] ) ? esc_html( trim( $this->field[ 'left_label' ] ) ) : NULL;
194 194
 	}
195 195
 
196 196
     /**
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
      * @return string
199 199
      */
200 200
     function get_label_class() {
201
-        return 'gv-label-'. sanitize_html_class( $this->field['type'] );
201
+        return 'gv-label-' . sanitize_html_class( $this->field[ 'type' ] );
202 202
     }
203 203
 
204 204
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      * @return string
208 208
      */
209 209
     function get_field_desc() {
210
-        return !empty( $this->field['desc'] ) ? '<span class="howto">'. $this->field['desc'] .'</span>' : '';
210
+        return ! empty( $this->field[ 'desc' ] ) ? '<span class="howto">' . $this->field[ 'desc' ] . '</span>' : '';
211 211
     }
212 212
 
213 213
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     function render_setting( $override_input = NULL ) {
242 242
 
243
-        if( !empty( $this->field['full_width'] ) ) { ?>
243
+        if ( ! empty( $this->field[ 'full_width' ] ) ) { ?>
244 244
             <th scope="row" colspan="2">
245 245
                 <div>
246 246
                     <label for="<?php echo $this->get_field_id(); ?>">
Please login to merge, or discard this patch.
Indentation   +176 added lines, -176 removed lines patch added patch discarded remove patch
@@ -10,107 +10,107 @@  discard block
 block discarded – undo
10 10
 	 *
11 11
 	 * @var string
12 12
 	 */
13
-    protected $name;
13
+	protected $name;
14 14
 
15 15
 	/**
16 16
 	 * Field settings
17 17
 	 *
18 18
 	 * @var array
19 19
 	 */
20
-    protected $field;
20
+	protected $field;
21 21
 
22 22
 	/**
23 23
 	 * Field current value
24 24
 	 *
25 25
 	 * @var mixed
26 26
 	 */
27
-    protected $value;
28
-
29
-    function __construct( $name = '', $field = array(), $curr_value = NULL ) {
30
-
31
-        $this->name = $name;
32
-
33
-        $defaults = self::get_field_defaults();
34
-
35
-        // Backward compatibility
36
-        if( !empty( $field['choices'] ) ) {
37
-        	$field['options'] = $field['choices'];
38
-        	unset( $field['choices'] );
39
-        }
40
-
41
-        $this->field =  wp_parse_args( $field, $defaults );
42
-
43
-        $this->value = is_null( $curr_value ) ? $this->field['value'] : $curr_value;
44
-
45
-    }
46
-
47
-    /**
48
-     * Returns the default details for a field option
49
-     *
50
-     * - default    // default option value, in case nothing is defined (@deprecated)
51
-     * - desc       // option description
52
-     * - value      // the option default value
53
-     * - label      // the option label
54
-     * - left_label // In case of checkboxes, left label will appear on the left of the checkbox
55
-     * - id         // the field id
56
-     * - type       // the option type ( text, checkbox, select, ... )
57
-     * - options    // when type is select, define the select options ('choices' is @deprecated)
58
-     * - merge_tags // if the option supports merge tags feature
59
-     * - class      // (new) define extra classes for the field
60
-     * - tooltip    //
61
-     *
62
-     * @return array
63
-     */
64
-    public static function get_field_defaults() {
65
-        return array(
66
-            'desc' => '',
67
-            'value' => null,
68
-            'label' => '',
69
-            'left_label' => null,
70
-            'id' => null,
71
-            'type'  => 'text',
72
-            'options' => null,
73
-            'merge_tags' => true,
74
-            'class' => '',
75
-            'tooltip' => null,
76
-            'requires' => null
77
-        );
78
-    }
79
-
80
-
81
-    function get_tooltip() {
82
-        if( ! function_exists('gform_tooltip') ) {
83
-            return null;
84
-        }
85
-
86
-	    $article = wp_parse_args( \GV\Utils::get( $this->field, 'article', array() ), array(
87
-	    	'id' => '',
88
-	    	'type' => 'modal',
89
-	    	'url' => '#',
90
-	    ) );
91
-
92
-        return !empty( $this->field['tooltip'] ) ? ' '. $this->tooltip( $this->field['tooltip'], false, true, $article ) : null;
93
-    }
94
-
95
-    /**
96
-     * Displays the tooltip
97
-     *
98
-     * @since 2.8.1
99
-     *
100
-     * @global $__gf_tooltips
101
-     *
102
-     * @param string $name      The name of the tooltip to be displayed
103
-     * @param string $css_class Optional. The CSS class to apply toi the element. Defaults to empty string.
104
-     * @param bool   $return    Optional. If the tooltip should be returned instead of output. Defaults to false (output)
105
-     * @param array  $article   Optional. Details about support doc article connected to the tooltip. {
106
-     *   @type string $id   Unique ID of article for Beacon API
107
-     *   @type string $url  URL of support doc article
108
-     *   @type string $type Type of Beacon element to open. {@see https://developer.helpscout.com/beacon-2/web/javascript-api/#beaconarticle}
109
-     * }
110
-     *
111
-     * @return string
112
-     */
113
-    function tooltip( $name, $css_class = '', $return = false, $article = array() ) {
27
+	protected $value;
28
+
29
+	function __construct( $name = '', $field = array(), $curr_value = NULL ) {
30
+
31
+		$this->name = $name;
32
+
33
+		$defaults = self::get_field_defaults();
34
+
35
+		// Backward compatibility
36
+		if( !empty( $field['choices'] ) ) {
37
+			$field['options'] = $field['choices'];
38
+			unset( $field['choices'] );
39
+		}
40
+
41
+		$this->field =  wp_parse_args( $field, $defaults );
42
+
43
+		$this->value = is_null( $curr_value ) ? $this->field['value'] : $curr_value;
44
+
45
+	}
46
+
47
+	/**
48
+	 * Returns the default details for a field option
49
+	 *
50
+	 * - default    // default option value, in case nothing is defined (@deprecated)
51
+	 * - desc       // option description
52
+	 * - value      // the option default value
53
+	 * - label      // the option label
54
+	 * - left_label // In case of checkboxes, left label will appear on the left of the checkbox
55
+	 * - id         // the field id
56
+	 * - type       // the option type ( text, checkbox, select, ... )
57
+	 * - options    // when type is select, define the select options ('choices' is @deprecated)
58
+	 * - merge_tags // if the option supports merge tags feature
59
+	 * - class      // (new) define extra classes for the field
60
+	 * - tooltip    //
61
+	 *
62
+	 * @return array
63
+	 */
64
+	public static function get_field_defaults() {
65
+		return array(
66
+			'desc' => '',
67
+			'value' => null,
68
+			'label' => '',
69
+			'left_label' => null,
70
+			'id' => null,
71
+			'type'  => 'text',
72
+			'options' => null,
73
+			'merge_tags' => true,
74
+			'class' => '',
75
+			'tooltip' => null,
76
+			'requires' => null
77
+		);
78
+	}
79
+
80
+
81
+	function get_tooltip() {
82
+		if( ! function_exists('gform_tooltip') ) {
83
+			return null;
84
+		}
85
+
86
+		$article = wp_parse_args( \GV\Utils::get( $this->field, 'article', array() ), array(
87
+			'id' => '',
88
+			'type' => 'modal',
89
+			'url' => '#',
90
+		) );
91
+
92
+		return !empty( $this->field['tooltip'] ) ? ' '. $this->tooltip( $this->field['tooltip'], false, true, $article ) : null;
93
+	}
94
+
95
+	/**
96
+	 * Displays the tooltip
97
+	 *
98
+	 * @since 2.8.1
99
+	 *
100
+	 * @global $__gf_tooltips
101
+	 *
102
+	 * @param string $name      The name of the tooltip to be displayed
103
+	 * @param string $css_class Optional. The CSS class to apply toi the element. Defaults to empty string.
104
+	 * @param bool   $return    Optional. If the tooltip should be returned instead of output. Defaults to false (output)
105
+	 * @param array  $article   Optional. Details about support doc article connected to the tooltip. {
106
+	 *   @type string $id   Unique ID of article for Beacon API
107
+	 *   @type string $url  URL of support doc article
108
+	 *   @type string $type Type of Beacon element to open. {@see https://developer.helpscout.com/beacon-2/web/javascript-api/#beaconarticle}
109
+	 * }
110
+	 *
111
+	 * @return string
112
+	 */
113
+	function tooltip( $name, $css_class = '', $return = false, $article = array() ) {
114 114
 		global $__gf_tooltips; //declared as global to improve WPML performance
115 115
 
116 116
 		$css_class = empty( $css_class ) ? 'tooltip' : $css_class;
@@ -128,17 +128,17 @@  discard block
 block discarded – undo
128 128
 		$tooltip_class = isset( $__gf_tooltips[ $name ] ) ? "tooltip_{$name}" : '';
129 129
 		$tooltip_class = esc_attr( $tooltip_class );
130 130
 
131
-	    /**
132
-	     * Below this line has been modified by GravityView.
133
-	     */
131
+		/**
132
+		 * Below this line has been modified by GravityView.
133
+		 */
134 134
 
135 135
 		if ( empty( $tooltip_text ) && empty( $article['id'] ) ) {
136 136
 			return '';
137 137
 		}
138 138
 
139 139
 		$url = '#';
140
-	    $atts = 'onclick="return false;" onkeypress="return false;"';
141
-	    $anchor_text = '<i class=\'fa fa-question-circle\'></i>';
140
+		$atts = 'onclick="return false;" onkeypress="return false;"';
141
+		$anchor_text = '<i class=\'fa fa-question-circle\'></i>';
142 142
 		$css_class = gravityview_sanitize_html_class( 'gf_tooltip ' . $css_class . ' ' . $tooltip_class );
143 143
 
144 144
 		$tooltip = sprintf( '<a href="%s" %s class="%s" title="%s" role="button">%s</a>',
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
 			$anchor_text
150 150
 		);
151 151
 
152
-	    /**
153
-	     * Modify the tooltip HTML before outputting
154
-	     * @internal
155
-	     * @see GravityView_Support_Port::maybe_add_article_to_tooltip()
156
-	     */
152
+		/**
153
+		 * Modify the tooltip HTML before outputting
154
+		 * @internal
155
+		 * @see GravityView_Support_Port::maybe_add_article_to_tooltip()
156
+		 */
157 157
 		$tooltip = apply_filters( 'gravityview/tooltips/tooltip', $tooltip, $article, $url, $atts, $css_class, $tooltip_text, $anchor_text );
158 158
 
159 159
 		if ( ! $return ) {
@@ -163,84 +163,84 @@  discard block
 block discarded – undo
163 163
 		return $tooltip;
164 164
 	}
165 165
 
166
-    /**
167
-     * Build input id based on the name
168
-     * @return string
169
-     */
170
-    function get_field_id() {
171
-        if( isset( $this->field['id'] ) ) {
172
-            return esc_attr( $this->field['id'] );
173
-        }
174
-        return esc_attr( sanitize_html_class( $this->name ) );
175
-    }
176
-
177
-    /**
178
-     * Retrieve field label
179
-     * @return string
180
-     */
181
-    function get_field_label() {
182
-        return esc_html( trim( $this->field['label'] ) );
183
-    }
166
+	/**
167
+	 * Build input id based on the name
168
+	 * @return string
169
+	 */
170
+	function get_field_id() {
171
+		if( isset( $this->field['id'] ) ) {
172
+			return esc_attr( $this->field['id'] );
173
+		}
174
+		return esc_attr( sanitize_html_class( $this->name ) );
175
+	}
176
+
177
+	/**
178
+	 * Retrieve field label
179
+	 * @return string
180
+	 */
181
+	function get_field_label() {
182
+		return esc_html( trim( $this->field['label'] ) );
183
+	}
184 184
 
185 185
 	/**
186 186
 	 * Retrieve field left label
187
-     *
188
-     * @since 1.7
189
-     *
187
+	 *
188
+	 * @since 1.7
189
+	 *
190 190
 	 * @return string
191 191
 	 */
192 192
 	function get_field_left_label() {
193 193
 		return ! empty( $this->field['left_label'] ) ? esc_html( trim( $this->field['left_label'] ) ) : NULL;
194 194
 	}
195 195
 
196
-    /**
197
-     * Retrieve field label class
198
-     * @return string
199
-     */
200
-    function get_label_class() {
201
-        return 'gv-label-'. sanitize_html_class( $this->field['type'] );
202
-    }
203
-
204
-
205
-    /**
206
-     * Retrieve field description
207
-     * @return string
208
-     */
209
-    function get_field_desc() {
210
-        return !empty( $this->field['desc'] ) ? '<span class="howto">'. $this->field['desc'] .'</span>' : '';
211
-    }
212
-
213
-
214
-    /**
215
-     * Verify if field should have merge tags
216
-     * @return boolean
217
-     */
218
-    function show_merge_tags() {
219
-        // Show the merge tags if the field is a list view
220
-        $is_list = preg_match( '/_list-/ism', $this->name );
221
-        // Or is a single entry view
222
-        $is_single = preg_match( '/single_/ism', $this->name );
223
-
224
-        return ( $is_single || $is_list );
225
-    }
226
-
227
-
228
-
229
-    /**
230
-     * important! Override this class
231
-     * outputs the field option html
232
-     */
233
-    function render_option() {
234
-        // to replace on each field
235
-    }
236
-
237
-    /**
238
-     * important! Override this class if needed
239
-     * outputs the field setting html
240
-     */
241
-    function render_setting( $override_input = NULL ) {
242
-
243
-        if( !empty( $this->field['full_width'] ) ) { ?>
196
+	/**
197
+	 * Retrieve field label class
198
+	 * @return string
199
+	 */
200
+	function get_label_class() {
201
+		return 'gv-label-'. sanitize_html_class( $this->field['type'] );
202
+	}
203
+
204
+
205
+	/**
206
+	 * Retrieve field description
207
+	 * @return string
208
+	 */
209
+	function get_field_desc() {
210
+		return !empty( $this->field['desc'] ) ? '<span class="howto">'. $this->field['desc'] .'</span>' : '';
211
+	}
212
+
213
+
214
+	/**
215
+	 * Verify if field should have merge tags
216
+	 * @return boolean
217
+	 */
218
+	function show_merge_tags() {
219
+		// Show the merge tags if the field is a list view
220
+		$is_list = preg_match( '/_list-/ism', $this->name );
221
+		// Or is a single entry view
222
+		$is_single = preg_match( '/single_/ism', $this->name );
223
+
224
+		return ( $is_single || $is_list );
225
+	}
226
+
227
+
228
+
229
+	/**
230
+	 * important! Override this class
231
+	 * outputs the field option html
232
+	 */
233
+	function render_option() {
234
+		// to replace on each field
235
+	}
236
+
237
+	/**
238
+	 * important! Override this class if needed
239
+	 * outputs the field setting html
240
+	 */
241
+	function render_setting( $override_input = NULL ) {
242
+
243
+		if( !empty( $this->field['full_width'] ) ) { ?>
244 244
             <th scope="row" colspan="2">
245 245
                 <div>
246 246
                     <label for="<?php echo $this->get_field_id(); ?>">
@@ -260,14 +260,14 @@  discard block
 block discarded – undo
260 260
             </td>
261 261
         <?php }
262 262
 
263
-    }
263
+	}
264 264
 
265
-    /**
266
-     * important! Override this class
267
-     * outputs the input html part
268
-     */
269
-    function render_input( $override_input ) {
270
-        echo '';
271
-    }
265
+	/**
266
+	 * important! Override this class
267
+	 * outputs the input html part
268
+	 */
269
+	function render_input( $override_input ) {
270
+		echo '';
271
+	}
272 272
 
273 273
 }
Please login to merge, or discard this patch.
future/includes/class-gv-utils.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 		 * Try subkeys after split.
92 92
 		 */
93 93
 		if ( count( $parts = explode( '/', $key, 2 ) ) > 1 ) {
94
-			return self::get( self::get( $array, $parts[0] ), $parts[1], $default );
94
+			return self::get( self::get( $array, $parts[ 0 ] ), $parts[ 1 ], $default );
95 95
 		}
96 96
 
97 97
 		return $default;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	public static function gf_query_debug( $query ) {
146 146
 		$introspect = $query->_introspect();
147 147
 		return array(
148
-			'where' => $query->_where_unwrap( $introspect['where'] )
148
+			'where' => $query->_where_unwrap( $introspect[ 'where' ] )
149 149
 		);
150 150
 	}
151 151
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		if ( $condition->expressions ) {
159 159
 			$conditions = array();
160 160
 			foreach ( $condition->expressions as $expression ) {
161
-				$conditions[] = self::gf_query_strip_condition_column_aliases( $expression );
161
+				$conditions[ ] = self::gf_query_strip_condition_column_aliases( $expression );
162 162
 			}
163 163
 			return call_user_func_array(
164 164
 				array( '\GF_Query_Condition', $condition->operator == 'AND' ? '_and' : '_or' ),
Please login to merge, or discard this patch.
includes/fields/class-gravityview-field-date-updated.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
49 49
 
50
-		if( 'edit' === $context ) {
50
+		if ( 'edit' === $context ) {
51 51
 			return $field_options;
52 52
 		}
53 53
 
54
-		$this->add_field_support('date_display', $field_options );
54
+		$this->add_field_support( 'date_display', $field_options );
55 55
 
56 56
 		return $field_options;
57 57
 	}
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
 	public function get_content( $output = '', $entry = array(), $field_settings = array(), $field = array() ) {
72 72
 
73 73
 		/** Overridden by a template. */
74
-		if( \GV\Utils::get( $field, 'field_path' ) !== gravityview()->plugin->dir( 'templates/fields/field-html.php' ) ) {
74
+		if ( \GV\Utils::get( $field, 'field_path' ) !== gravityview()->plugin->dir( 'templates/fields/field-html.php' ) ) {
75 75
 			return $output;
76 76
 		}
77 77
 
78
-		return GVCommon::format_date( $field['value'], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) );
78
+		return GVCommon::format_date( $field[ 'value' ], 'format=' . \GV\Utils::get( $field_settings, 'date_display' ) );
79 79
 	}
80 80
 }
81 81
 
Please login to merge, or discard this patch.
plugin-and-theme-hooks/class-gravityview-plugin-hooks-gravity-flow.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 
34 34
 		parent::add_hooks();
35 35
 
36
-		add_filter( 'gravityview/search/searchable_fields', array( $this, 'modify_search_bar_fields_dropdown'), 10, 2 );
36
+		add_filter( 'gravityview/search/searchable_fields', array( $this, 'modify_search_bar_fields_dropdown' ), 10, 2 );
37 37
 
38 38
 		add_filter( 'gravityview/admin/available_fields', array( $this, 'maybe_add_non_default_fields' ), 10, 3 );
39 39
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 	 * @return void
54 54
 	 */
55 55
 	public function clear_cache_after_workflow( $form, $entry_id, $step_id, $starting_step_id ) {
56
-		do_action( 'gravityview_clear_form_cache', $form['id'] );
56
+		do_action( 'gravityview_clear_form_cache', $form[ 'id' ] );
57 57
 	}
58 58
 
59 59
 	/**
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
 	 */
71 71
 	public static function get_status_options( $form_id = 0, $status_key = 'workflow_final_status' ) {
72 72
 
73
-		if( empty( $form_id ) ) {
73
+		if ( empty( $form_id ) ) {
74 74
 			$form_id = GravityView_View::getInstance()->getFormId();
75 75
 		}
76 76
 
77 77
 		$entry_meta = gravity_flow()->get_entry_meta( array(), $form_id );
78 78
 
79
-		return (array) \GV\Utils::get( $entry_meta, $status_key . '/filter/choices' );
79
+		return (array)\GV\Utils::get( $entry_meta, $status_key . '/filter/choices' );
80 80
 	}
81 81
 
82 82
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
 		$workflow_steps = $GFlow->get_steps();
100 100
 
101
-		if( $workflow_steps ) {
101
+		if ( $workflow_steps ) {
102 102
 
103 103
 			foreach ( $workflow_steps as $step ) {
104 104
 
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
 				);
111 111
 			}
112 112
 
113
-			$fields['workflow_step'] = array(
113
+			$fields[ 'workflow_step' ] = array(
114 114
 				'label' => esc_html__( 'Workflow Step', 'gravityview' ),
115 115
 				'type'  => 'select',
116 116
 			);
117 117
 
118
-			$fields['workflow_final_status'] = array(
118
+			$fields[ 'workflow_final_status' ] = array(
119 119
 				'label' => esc_html__( 'Workflow Status', 'gravityview' ),
120 120
 				'type'  => 'select',
121 121
 			);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 		if ( ( $insert_at = array_search( 'workflow_final_status', wp_list_pluck( $fields, 'key' ) ) ) !== false ) {
132 132
 			$fields_end = array_splice( $fields, $insert_at + 1 );
133 133
 
134
-			$fields[] = array(
134
+			$fields[ ] = array(
135 135
 				'text' => __( 'Workflow Current Status Timestamp', 'gravityview' ),
136 136
 				'operators' => array( '>', '<' ),
137 137
 				'placeholder' => 'yyyy-mm-dd',
@@ -157,8 +157,8 @@  discard block
 block discarded – undo
157 157
 				$keys_end = array_splice( $keys, $insert_at + 1 );
158 158
 				$values_end = array_splice( $values, $insert_at + 1 );
159 159
 
160
-				$keys[] = 'workflow_current_status_timestamp';
161
-				$values[] = array(
160
+				$keys[ ] = 'workflow_current_status_timestamp';
161
+				$values[ ] = array(
162 162
 					'label' => __( 'Workflow Current Status Timestamp', 'gravityview' ),
163 163
 					'type' => 'workflow_current_status_timestamp',
164 164
 				);
Please login to merge, or discard this patch.
includes/extensions/lightbox/class-gravityview-lightbox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 */
39 39
 	public function set_provider( $provider = null ) {
40 40
 
41
-		if( gravityview()->request->is_admin() ) {
41
+		if ( gravityview()->request->is_admin() ) {
42 42
 			return;
43 43
 		}
44 44
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		}
58 58
 
59 59
 		// We're switching providers; remove the hooks that were added.
60
-		if( self::$active_provider ) {
60
+		if ( self::$active_provider ) {
61 61
 			self::$active_provider->remove_hooks();
62 62
 		}
63 63
 
Please login to merge, or discard this patch.
future/lib/EDD_SL_Plugin_Updater.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,9 @@
 block discarded – undo
10 10
  */
11 11
 
12 12
 // Exit if accessed directly
13
-if ( ! defined( 'ABSPATH' ) ) exit;
13
+if ( ! defined( 'ABSPATH' ) ) {
14
+	exit;
15
+}
14 16
 
15 17
 /**
16 18
  * Allows plugins to use their own update API.
Please login to merge, or discard this patch.
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 		$this->api_data    = $_api_data;
49 49
 		$this->name        = plugin_basename( $_plugin_file );
50 50
 		$this->slug        = basename( $_plugin_file, '.php' );
51
-		$this->version     = $_api_data['version'];
52
-		$this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
53
-		$this->beta        = ! empty( $this->api_data['beta'] ) ? true : false;
54
-		$this->cache_key   = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) );
51
+		$this->version     = $_api_data[ 'version' ];
52
+		$this->wp_override = isset( $_api_data[ 'wp_override' ] ) ? (bool)$_api_data[ 'wp_override' ] : false;
53
+		$this->beta        = ! empty( $this->api_data[ 'beta' ] ) ? true : false;
54
+		$this->cache_key   = 'edd_sl_' . md5( serialize( $this->slug . $this->api_data[ 'license' ] . $this->beta ) );
55 55
 
56 56
 		$edd_plugin_data[ $this->slug ] = $this->api_data;
57 57
 
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
 			return;
174 174
 		}
175 175
 
176
-		if( ! current_user_can( 'update_plugins' ) ) {
176
+		if ( ! current_user_can( 'update_plugins' ) ) {
177 177
 			return;
178 178
 		}
179 179
 
180
-		if( ! is_multisite() ) {
180
+		if ( ! is_multisite() ) {
181 181
 			return;
182 182
 		}
183 183
 
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 					'<a target="_blank" class="thickbox" href="' . esc_url( $changelog_link ) . '">',
270 270
 					esc_html( $version_info->new_version ),
271 271
 					'</a>',
272
-					'<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) .'">',
272
+					'<a href="' . esc_url( wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $this->name, 'upgrade-plugin_' . $this->name ) ) . '">',
273 273
 					'</a>'
274 274
 				);
275 275
 			}
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 			$_data->contributors = $this->convert_object_to_array( $_data->contributors );
354 354
 		}
355 355
 
356
-		if( ! isset( $_data->plugin ) ) {
356
+		if ( ! isset( $_data->plugin ) ) {
357 357
 			$_data->plugin = $this->name;
358 358
 		}
359 359
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 
396 396
 		$verify_ssl = $this->verify_ssl();
397 397
 		if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
398
-			$args['sslverify'] = $verify_ssl;
398
+			$args[ 'sslverify' ] = $verify_ssl;
399 399
 		}
400 400
 		return $args;
401 401
 
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 		if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
424 424
 			$test_url_parts = parse_url( $this->api_url );
425 425
 
426
-			$scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme']     : 'http';
427
-			$host   = ! empty( $test_url_parts['host'] )   ? $test_url_parts['host']       : '';
428
-			$port   = ! empty( $test_url_parts['port'] )   ? ':' . $test_url_parts['port'] : '';
426
+			$scheme = ! empty( $test_url_parts[ 'scheme' ] ) ? $test_url_parts[ 'scheme' ] : 'http';
427
+			$host   = ! empty( $test_url_parts[ 'host' ] ) ? $test_url_parts[ 'host' ] : '';
428
+			$port   = ! empty( $test_url_parts[ 'port' ] ) ? ':' . $test_url_parts[ 'port' ] : '';
429 429
 
430 430
 			if ( empty( $host ) ) {
431 431
 				$edd_plugin_url_available[ $store_hash ] = false;
@@ -442,27 +442,27 @@  discard block
 block discarded – undo
442 442
 
443 443
 		$data = array_merge( $this->api_data, $_data );
444 444
 
445
-		if ( $data['slug'] != $this->slug ) {
445
+		if ( $data[ 'slug' ] != $this->slug ) {
446 446
 			return false;
447 447
 		}
448 448
 
449
-		if ( $this->api_url == trailingslashit ( home_url() ) ) {
449
+		if ( $this->api_url == trailingslashit( home_url() ) ) {
450 450
 			return false; // Don't allow a plugin to ping itself
451 451
 		}
452 452
 
453 453
 		$api_params = array(
454 454
 			'edd_action' => 'get_version',
455
-			'license'    => ! empty( $data['license'] ) ? $data['license'] : '',
456
-			'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
457
-			'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
458
-			'version'    => isset( $data['version'] ) ? $data['version'] : false,
459
-			'slug'       => $data['slug'],
460
-			'author'     => $data['author'],
455
+			'license'    => ! empty( $data[ 'license' ] ) ? $data[ 'license' ] : '',
456
+			'item_name'  => isset( $data[ 'item_name' ] ) ? $data[ 'item_name' ] : false,
457
+			'item_id'    => isset( $data[ 'item_id' ] ) ? $data[ 'item_id' ] : false,
458
+			'version'    => isset( $data[ 'version' ] ) ? $data[ 'version' ] : false,
459
+			'slug'       => $data[ 'slug' ],
460
+			'author'     => $data[ 'author' ],
461 461
 			'url'        => home_url(),
462
-			'beta'       => ! empty( $data['beta'] ),
462
+			'beta'       => ! empty( $data[ 'beta' ] ),
463 463
 		);
464 464
 
465
-		$request    = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
465
+		$request = wp_remote_post( $this->api_url, array( 'timeout' => 15, 'sslverify' => $verify_ssl, 'body' => $api_params ) );
466 466
 
467 467
 		if ( ! is_wp_error( $request ) ) {
468 468
 			$request = json_decode( wp_remote_retrieve_body( $request ) );
@@ -483,8 +483,8 @@  discard block
 block discarded – undo
483 483
 		}
484 484
 
485 485
 		if ( ! empty( $request->sections ) ) {
486
-			foreach( $request->sections as $key => $section ) {
487
-				$request->$key = (array) $section;
486
+			foreach ( $request->sections as $key => $section ) {
487
+				$request->$key = (array)$section;
488 488
 			}
489 489
 		}
490 490
 
@@ -498,35 +498,35 @@  discard block
 block discarded – undo
498 498
 
499 499
 		global $edd_plugin_data;
500 500
 
501
-		if( empty( $_REQUEST['edd_sl_action'] ) || 'view_plugin_changelog' != $_REQUEST['edd_sl_action'] ) {
501
+		if ( empty( $_REQUEST[ 'edd_sl_action' ] ) || 'view_plugin_changelog' != $_REQUEST[ 'edd_sl_action' ] ) {
502 502
 			return;
503 503
 		}
504 504
 
505
-		if( empty( $_REQUEST['plugin'] ) ) {
505
+		if ( empty( $_REQUEST[ 'plugin' ] ) ) {
506 506
 			return;
507 507
 		}
508 508
 
509
-		if( empty( $_REQUEST['slug'] ) ) {
509
+		if ( empty( $_REQUEST[ 'slug' ] ) ) {
510 510
 			return;
511 511
 		}
512 512
 
513
-		if( ! current_user_can( 'update_plugins' ) ) {
513
+		if ( ! current_user_can( 'update_plugins' ) ) {
514 514
 			wp_die( __( 'You do not have permission to install plugin updates', 'gravityview' ), __( 'Error', 'gravityview' ), array( 'response' => 403 ) );
515 515
 		}
516 516
 
517
-		$data         = $edd_plugin_data[ $_REQUEST['slug'] ];
517
+		$data         = $edd_plugin_data[ $_REQUEST[ 'slug' ] ];
518 518
 		$version_info = $this->get_cached_version_info();
519 519
 
520
-		if( false === $version_info ) {
520
+		if ( false === $version_info ) {
521 521
 
522 522
 			$api_params = array(
523 523
 				'edd_action' => 'get_version',
524
-				'item_name'  => isset( $data['item_name'] ) ? $data['item_name'] : false,
525
-				'item_id'    => isset( $data['item_id'] ) ? $data['item_id'] : false,
526
-				'slug'       => $_REQUEST['slug'],
527
-				'author'     => $data['author'],
524
+				'item_name'  => isset( $data[ 'item_name' ] ) ? $data[ 'item_name' ] : false,
525
+				'item_id'    => isset( $data[ 'item_id' ] ) ? $data[ 'item_id' ] : false,
526
+				'slug'       => $_REQUEST[ 'slug' ],
527
+				'author'     => $data[ 'author' ],
528 528
 				'url'        => home_url(),
529
-				'beta'       => ! empty( $data['beta'] )
529
+				'beta'       => ! empty( $data[ 'beta' ] )
530 530
 			);
531 531
 
532 532
 			$verify_ssl = $this->verify_ssl();
@@ -542,22 +542,22 @@  discard block
 block discarded – undo
542 542
 				$version_info = false;
543 543
 			}
544 544
 
545
-			if( ! empty( $version_info ) ) {
546
-				foreach( $version_info->sections as $key => $section ) {
547
-					$version_info->$key = (array) $section;
545
+			if ( ! empty( $version_info ) ) {
546
+				foreach ( $version_info->sections as $key => $section ) {
547
+					$version_info->$key = (array)$section;
548 548
 				}
549 549
 			}
550 550
 
551 551
 			$this->set_version_info_cache( $version_info );
552 552
 
553 553
 			// Delete the unneeded option
554
-			delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST['plugin'] ) . '_' . $this->beta . '_version_info' ) );
554
+			delete_option( md5( 'edd_plugin_' . sanitize_key( $_REQUEST[ 'plugin' ] ) . '_' . $this->beta . '_version_info' ) );
555 555
 		}
556 556
 
557 557
 		if ( isset( $version_info->sections ) ) {
558 558
 			$sections = $this->convert_object_to_array( $version_info->sections );
559
-			if ( ! empty( $sections['changelog'] ) ) {
560
-				echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections['changelog'] ) . '</div>';
559
+			if ( ! empty( $sections[ 'changelog' ] ) ) {
560
+				echo '<div style="background:#fff;padding:10px;">' . wp_kses_post( $sections[ 'changelog' ] ) . '</div>';
561 561
 			}
562 562
 		}
563 563
 
@@ -572,25 +572,25 @@  discard block
 block discarded – undo
572 572
 	 */
573 573
 	public function get_cached_version_info( $cache_key = '' ) {
574 574
 
575
-		if( empty( $cache_key ) ) {
575
+		if ( empty( $cache_key ) ) {
576 576
 			$cache_key = $this->cache_key;
577 577
 		}
578 578
 
579 579
 		$cache = get_option( $cache_key );
580 580
 
581
-		if( empty( $cache['timeout'] ) || time() > $cache['timeout'] ) {
581
+		if ( empty( $cache[ 'timeout' ] ) || time() > $cache[ 'timeout' ] ) {
582 582
 			return false; // Cache is expired
583 583
 		}
584 584
 
585 585
 		// We need to turn the icons into an array, thanks to WP Core forcing these into an object at some point.
586
-		$cache['value'] = json_decode( $cache['value'] );
587
-		if ( ! empty( $cache['value']->icons ) ) {
588
-			$cache['value']->icons = (array) $cache['value']->icons;
589
-		} elseif ( $cache['value'] ) {
590
-			$cache['value']->icons = array();
586
+		$cache[ 'value' ] = json_decode( $cache[ 'value' ] );
587
+		if ( ! empty( $cache[ 'value' ]->icons ) ) {
588
+			$cache[ 'value' ]->icons = (array)$cache[ 'value' ]->icons;
589
+		} elseif ( $cache[ 'value' ] ) {
590
+			$cache[ 'value' ]->icons = array();
591 591
 		}
592 592
 
593
-		return $cache['value'];
593
+		return $cache[ 'value' ];
594 594
 
595 595
 	}
596 596
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 	 */
603 603
 	public function set_version_info_cache( $value = '', $cache_key = '' ) {
604 604
 
605
-		if( empty( $cache_key ) ) {
605
+		if ( empty( $cache_key ) ) {
606 606
 			$cache_key = $this->cache_key;
607 607
 		}
608 608
 
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 		update_option( $cache_key, $data, 'no' );
615 615
 
616 616
 		// Delete the duplicate option
617
-		delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data['license'] . $this->beta ) ) );
617
+		delete_option( 'edd_api_request_' . md5( serialize( $this->slug . $this->api_data[ 'license' ] . $this->beta ) ) );
618 618
 	}
619 619
 
620 620
 	/**
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
 	 * @return bool
625 625
 	 */
626 626
 	private function verify_ssl() {
627
-		return (bool) apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
627
+		return (bool)apply_filters( 'edd_sl_api_request_verify_ssl', true, $this );
628 628
 	}
629 629
 
630 630
 }
Please login to merge, or discard this patch.
includes/widgets/class-gravityview-widget-gravityforms.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 	function __construct() {
15 15
 
16
-		$this->widget_description = __('Display a Gravity Forms form.', 'gravityview' );
16
+		$this->widget_description = __( 'Display a Gravity Forms form.', 'gravityview' );
17 17
 
18 18
 		$default_values = array(
19 19
 			'header' => 1,
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 		add_filter( 'gravityview/widget/hide_until_searched/whitelist', array( $this, 'add_to_allowlist' ) );
56 56
 
57
-		parent::__construct( __( 'Gravity Forms', 'gravityview' ) , 'gravityforms', $default_values, $settings );
57
+		parent::__construct( __( 'Gravity Forms', 'gravityview' ), 'gravityforms', $default_values, $settings );
58 58
 	}
59 59
 
60 60
 	/**
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
 		 * gravityview_get_forms() is currently running too early as widgets_init runs before init and
82 82
 		 * when most Gravity Forms plugins register their own fields like GP Terms of Service.
83 83
 		 */
84
-		if( $doing_ajax || ( \GV\Admin_Request::is_admin() && ! GFForms::is_gravity_page() ) ) {
84
+		if ( $doing_ajax || ( \GV\Admin_Request::is_admin() && ! GFForms::is_gravity_page() ) ) {
85 85
 
86 86
 			// check for available gravity forms
87 87
 			$forms = gravityview_get_forms();
88 88
 
89 89
 			foreach ( $forms as $form ) {
90
-				$choices[ $form['id'] ] = $form['title'];
90
+				$choices[ $form[ 'id' ] ] = $form[ 'title' ];
91 91
 			}
92 92
 		}
93 93
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	function add_to_allowlist( $allowlist ) {
105 105
 
106
-		$allowlist[] = 'gravityforms';
106
+		$allowlist[ ] = 'gravityforms';
107 107
 
108 108
 		return $allowlist;
109 109
 	}
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	 * @param string $content
114 114
 	 * @param string $context
115 115
 	 */
116
-	public function render_frontend( $widget_args, $content = '', $context = '') {
116
+	public function render_frontend( $widget_args, $content = '', $context = '' ) {
117 117
 
118 118
 		if ( ! $this->pre_render_frontend() ) {
119 119
 			return;
Please login to merge, or discard this patch.
includes/load-plugin-and-theme-hooks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
 $plugin_hooks_files = glob( $include_path . 'class-gravityview-plugin-hooks-*.php' );
22 22
 
23 23
 // Load all plugin files automatically
24
-foreach ( (array) $plugin_hooks_files as $plugin_hooks_file ) {
24
+foreach ( (array)$plugin_hooks_files as $plugin_hooks_file ) {
25 25
 	include $plugin_hooks_file;
26 26
 }
27 27
 
28 28
 $theme_hooks_files = glob( $include_path . 'class-gravityview-theme-hooks-*.php' );
29 29
 
30 30
 // Load all theme files automatically
31
-foreach ( (array) $theme_hooks_files as $theme_hooks_file ) {
31
+foreach ( (array)$theme_hooks_files as $theme_hooks_file ) {
32 32
 	include $theme_hooks_file;
33 33
 }
Please login to merge, or discard this patch.