Completed
Pull Request — develop (#1436)
by
unknown
15:35
created
includes/admin/field-types/type_number.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * number input type
4 4
  */
5 5
 
6
-if( !class_exists('GravityView_FieldType_text') ) {
6
+if ( ! class_exists( 'GravityView_FieldType_text' ) ) {
7 7
 	include_once( GRAVITYVIEW_DIR . 'includes/admin/field-types/type_text.php' );
8 8
 }
9 9
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 		$show_mt = $this->show_merge_tags();
22 22
 
23
-		if ( $show_mt && $this->field['merge_tags'] !== false || $this->field['merge_tags'] === 'force' ) {
23
+		if ( $show_mt && $this->field[ 'merge_tags' ] !== false || $this->field[ 'merge_tags' ] === 'force' ) {
24 24
 			$class = 'merge-tag-support mt-position-right mt-hide_all_fields ';
25 25
 		}
26 26
 
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 		$step = \GV\Utils::get( $this->field, 'step', null );
32 32
 
33 33
 		$atts = '';
34
-		$atts .= $max ? ' max="' . (int) $max . '"' : '';
35
-		$atts .= $min ? ' min="' . (int) $min . '"' : '';
36
-		$atts .= $step ? ' step="' . (int) $step . '"' : '';
34
+		$atts .= $max ? ' max="' . (int)$max . '"' : '';
35
+		$atts .= $min ? ' min="' . (int)$min . '"' : '';
36
+		$atts .= $step ? ' step="' . (int)$step . '"' : '';
37 37
 		?>
38 38
 		<input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="number"
39 39
 		       value="<?php echo esc_attr( $this->value ); ?>"
Please login to merge, or discard this patch.
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.
future/includes/class-gv-utils.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 * @param string $name The key name (will be prefixed).
53 53
 	 * @param mixed $default The default value if not found (Default: null)
54 54
 	 *
55
-	 * @return mixed The value or $default if not found.
55
+	 * @return string The value or $default if not found.
56 56
 	 */
57 57
 	public static function _SERVER( $name, $default = null ) {
58 58
 		return self::get( $_SERVER, $name, $default );
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 *
127 127
 	 * @param mixed $value The value to return from the closure.
128 128
 	 *
129
-	 * @return Closure The closure with the $value bound.
129
+	 * @return \Closure The closure with the $value bound.
130 130
 	 */
131 131
 	public static function _return( $value ) {
132 132
 		return function() use ( $value ) { return $value; };
Please login to merge, or discard this 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-created-by.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -37,23 +37,23 @@  discard block
 block discarded – undo
37 37
 
38 38
 		$merge_tags = array(
39 39
 			array(
40
-				'label' => __('Entry Creator: Display Name', 'gravityview'),
40
+				'label' => __( 'Entry Creator: Display Name', 'gravityview' ),
41 41
 				'tag' => '{created_by:display_name}'
42 42
 			),
43 43
 			array(
44
-				'label' => __('Entry Creator: Email', 'gravityview'),
44
+				'label' => __( 'Entry Creator: Email', 'gravityview' ),
45 45
 				'tag' => '{created_by:user_email}'
46 46
 			),
47 47
 			array(
48
-				'label' => __('Entry Creator: Username', 'gravityview'),
48
+				'label' => __( 'Entry Creator: Username', 'gravityview' ),
49 49
 				'tag' => '{created_by:user_login}'
50 50
 			),
51 51
 			array(
52
-				'label' => __('Entry Creator: User ID', 'gravityview'),
52
+				'label' => __( 'Entry Creator: User ID', 'gravityview' ),
53 53
 				'tag' => '{created_by:ID}'
54 54
 			),
55 55
 			array(
56
-				'label' => __('Entry Creator: Roles', 'gravityview'),
56
+				'label' => __( 'Entry Creator: Roles', 'gravityview' ),
57 57
 				'tag' => '{created_by:roles}'
58 58
 			),
59 59
 		);
@@ -81,19 +81,19 @@  discard block
 block discarded – undo
81 81
 	public function replace_merge_tag( $matches = array(), $text = '', $form = array(), $entry = array(), $url_encode = false, $esc_html = false ) {
82 82
 
83 83
 		// If there are no matches OR the Entry `created_by` isn't set or is 0 (no user)
84
-		if( empty( $matches ) || empty( $entry['created_by'] ) ) {
84
+		if ( empty( $matches ) || empty( $entry[ 'created_by' ] ) ) {
85 85
 			return $text;
86 86
 		}
87 87
 
88 88
 		// Get the creator of the entry
89
-		$entry_creator = new WP_User( $entry['created_by'] );
89
+		$entry_creator = new WP_User( $entry[ 'created_by' ] );
90 90
 
91 91
 		foreach ( $matches as $match ) {
92 92
 
93
-			$full_tag = $match[0];
94
-			$property = $match[1];
93
+			$full_tag = $match[ 0 ];
94
+			$property = $match[ 1 ];
95 95
 
96
-			switch( $property ) {
96
+			switch ( $property ) {
97 97
 				case '':
98 98
 					$value = $entry_creator->ID;
99 99
 					break;
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
 
120 120
 	public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) {
121 121
 
122
-		if( 'edit' === $context ) {
122
+		if ( 'edit' === $context ) {
123 123
 			return $field_options;
124 124
 		}
125 125
 
126
-		$field_options['name_display'] = array(
126
+		$field_options[ 'name_display' ] = array(
127 127
 			'type' => 'select',
128 128
 			'label' => __( 'User Format', 'gravityview' ),
129 129
 			'desc' => __( 'How should the User information be displayed?', 'gravityview' ),
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.
includes/widgets/class-gravityview-widget-gravityforms.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
 	 *
74 74
 	 * @param array $allowlist Array of widgets to show before a search is performed, if the setting is enabled.
75 75
 	 *
76
-	 * @return array
76
+	 * @return string[]
77 77
 	 */
78 78
 	function add_to_allowlist( $allowlist ) {
79 79
 
Please login to merge, or discard this 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/widgets/register-gravityview-widgets.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,17 +16,17 @@
 block discarded – undo
16 16
  */
17 17
 function gravityview_register_gravityview_widgets() {
18 18
 
19
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget.php' );
19
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget.php' );
20 20
 
21
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-pagination-info.php' );
22
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-links.php' );
23
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-page-size.php' );
24
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-custom-content.php' );
25
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/class-gravityview-widget-gravityforms.php' );
26
-	include_once( GRAVITYVIEW_DIR .'includes/widgets/search-widget/class-search-widget.php' );
21
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-pagination-info.php' );
22
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-links.php' );
23
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-page-size.php' );
24
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-custom-content.php' );
25
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/class-gravityview-widget-gravityforms.php' );
26
+	include_once( GRAVITYVIEW_DIR . 'includes/widgets/search-widget/class-search-widget.php' );
27 27
 
28
-	if( class_exists('GFPolls') ) {
29
-		include_once( GRAVITYVIEW_DIR .'includes/widgets/poll/class-gravityview-widget-poll.php' );
28
+	if ( class_exists( 'GFPolls' ) ) {
29
+		include_once( GRAVITYVIEW_DIR . 'includes/widgets/poll/class-gravityview-widget-poll.php' );
30 30
 	}
31 31
 
32 32
 }
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-provider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 		add_filter( 'gravityview/fields/fileupload/link_atts', array( $this, 'fileupload_link_atts' ), 10, 3 );
24 24
 		add_filter( 'gravityview/get_link/allowed_atts', array( $this, 'allowed_atts' ) );
25 25
 
26
-		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts') );
27
-		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles') );
26
+		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
27
+		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
28 28
 
29 29
 		add_action( 'wp_footer', array( $this, 'output_footer' ) );
30 30
 	}
@@ -44,8 +44,8 @@  discard block
 block discarded – undo
44 44
 		remove_filter( 'gravityview/fields/fileupload/link_atts', array( $this, 'fileupload_link_atts' ), 10 );
45 45
 		remove_filter( 'gravityview/get_link/allowed_atts', array( $this, 'allowed_atts' ) );
46 46
 
47
-		remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts') );
48
-		remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles') );
47
+		remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
48
+		remove_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles' ) );
49 49
 
50 50
 		remove_action( 'wp_footer', array( $this, 'output_footer' ) );
51 51
 	}
Please login to merge, or discard this patch.