Completed
Pull Request — develop (#1572)
by Zack
19:45
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.
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-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.
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.
lightbox/fancybox/class-gravityview-lightbox-provider-fancybox.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
 	 */
103 103
 	public function allowed_atts( $atts = array() ) {
104 104
 
105
-		$atts['data-fancybox']         = null;
106
-		$atts['data-fancybox-trigger'] = null;
107
-		$atts['data-fancybox-index']   = null;
108
-		$atts['data-src']              = null;
109
-		$atts['data-type']             = null;
110
-		$atts['data-width']            = null;
111
-		$atts['data-height']           = null;
112
-		$atts['data-srcset']           = null;
113
-		$atts['data-caption']          = null;
114
-		$atts['data-options']          = null;
115
-		$atts['data-filter']           = null;
105
+		$atts[ 'data-fancybox' ]         = null;
106
+		$atts[ 'data-fancybox-trigger' ] = null;
107
+		$atts[ 'data-fancybox-index' ]   = null;
108
+		$atts[ 'data-src' ]              = null;
109
+		$atts[ 'data-type' ]             = null;
110
+		$atts[ 'data-width' ]            = null;
111
+		$atts[ 'data-height' ]           = null;
112
+		$atts[ 'data-srcset' ]           = null;
113
+		$atts[ 'data-caption' ]          = null;
114
+		$atts[ 'data-options' ]          = null;
115
+		$atts[ 'data-filter' ]           = null;
116 116
 
117 117
 		return $atts;
118 118
 	}
@@ -126,14 +126,14 @@  discard block
 block discarded – undo
126 126
 			return $link_atts;
127 127
 		}
128 128
 
129
-		$link_atts['class'] = \GV\Utils::get( $link_atts, 'class' ) . ' gravityview-fancybox';
129
+		$link_atts[ 'class' ] = \GV\Utils::get( $link_atts, 'class' ) . ' gravityview-fancybox';
130 130
 
131
-		$link_atts['class'] = sanitize_html_class( $link_atts['class'] );
131
+		$link_atts[ 'class' ] = sanitize_html_class( $link_atts[ 'class' ] );
132 132
 
133 133
 		if ( $context && ! empty( $context->field->field ) ) {
134 134
 			if ( $context->field->field->multipleFiles ) {
135 135
 				$entry = $context->entry->as_entry();
136
-				$link_atts['data-fancybox'] = 'gallery-' . sprintf( "%s-%s-%s", $entry['form_id'], $context->field->ID, $context->entry->get_slug() );
136
+				$link_atts[ 'data-fancybox' ] = 'gallery-' . sprintf( "%s-%s-%s", $entry[ 'form_id' ], $context->field->ID, $context->entry->get_slug() );
137 137
 			}
138 138
 		}
139 139
 
Please login to merge, or discard this patch.