Completed
Push — develop ( c79605...ad7498 )
by Zack
20:17
created
future/includes/class-gv-template-entry-legacy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 		global $post;
35 35
 
36 36
 		if ( $post ) {
37
-			$context['post'] = $post;
37
+			$context[ 'post' ] = $post;
38 38
 		}
39 39
 
40 40
 		\GV\Mocks\Legacy_Context::push( $context );
Please login to merge, or discard this patch.
future/includes/class-gv-collection-entry-sort.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
 		if ( $this->field ) {
79 79
 			return array(
80 80
 				'key' => $this->field->ID,
81
-				'direction' => $this->direction ? : self::ASC,
81
+				'direction' => $this->direction ?: self::ASC,
82 82
 				'is_numeric' => self::ALPHA ? true : false,
83 83
 			);
84 84
 		}
Please login to merge, or discard this patch.
future/includes/class-gv-wrappers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,8 @@
 block discarded – undo
50 50
 		/**
51 51
 		 * By array.
52 52
 		 */
53
-		if ( is_array( $view ) && ! empty( $view['id'] ) ) {
54
-			return $this->get( $view['id'] );
53
+		if ( is_array( $view ) && ! empty( $view[ 'id' ] ) ) {
54
+			return $this->get( $view[ 'id' ] );
55 55
 		}
56 56
 
57 57
 		/**
Please login to merge, or discard this patch.
future/includes/rest/class-gv-rest-core.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 		require_once gravityview()->plugin->dir( 'future/includes/rest/class-gv-rest-route.php' );
22 22
 		require_once gravityview()->plugin->dir( 'future/includes/rest/class-gv-rest-views-route.php' );
23 23
 
24
-		self::$routes['views'] = $views = new Views_Route();
24
+		self::$routes[ 'views' ] = $views = new Views_Route();
25 25
 		$views->register_routes();
26 26
 	}
27 27
 
Please login to merge, or discard this patch.
future/includes/class-gv-shortcode-gvfield.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
 		 */
44 44
 		$atts = apply_filters( 'gravityview/shortcodes/gvfield/atts', $atts );
45 45
 
46
-		if ( ! $view = \GV\View::by_id( $atts['view_id'] ) ) {
47
-			gravityview()->log->error( 'View #{view_id} not found', array( 'view_id' => $atts['view_id'] ) );
46
+		if ( ! $view = \GV\View::by_id( $atts[ 'view_id' ] ) ) {
47
+			gravityview()->log->error( 'View #{view_id} not found', array( 'view_id' => $atts[ 'view_id' ] ) );
48 48
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, null, null, $atts );
49 49
 		}
50 50
 
51
-		switch( $atts['entry_id'] ):
51
+		switch ( $atts[ 'entry_id' ] ):
52 52
 			case 'last':
53 53
 				if ( gravityview()->plugin->supports( \GV\Plugin::FEATURE_GFQUERY ) ) {
54 54
 					/**
@@ -57,17 +57,17 @@  discard block
 block discarded – undo
57 57
 					 * Since we're using \GF_Query shorthand initialization we have to reverse the order parameters here.
58 58
 					 */
59 59
 					add_filter( 'gravityview_get_entries', $filter = function( $parameters, $args, $form_id ) {
60
-						if ( ! empty( $parameters['sorting'] ) ) {
60
+						if ( ! empty( $parameters[ 'sorting' ] ) ) {
61 61
 							/**
62 62
 							 * Reverse existing sorts.
63 63
 							 */
64
-							$sort = &$parameters['sorting'];
65
-							$sort['direction'] = $sort['direction'] == 'RAND' ? : ( $sort['direction'] == 'ASC' ? 'DESC' : 'ASC' );
64
+							$sort = &$parameters[ 'sorting' ];
65
+							$sort[ 'direction' ] = $sort[ 'direction' ] == 'RAND' ?: ( $sort[ 'direction' ] == 'ASC' ? 'DESC' : 'ASC' );
66 66
 						} else {
67 67
 							/**
68 68
 							 * Otherwise, sort by date_created.
69 69
 							 */
70
-							$parameters['sorting'] = array(
70
+							$parameters[ 'sorting' ] = array(
71 71
 								'key' => 'id',
72 72
 								'direction' => 'ASC',
73 73
 								'is_numeric' => true
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
 					/** If a sort already exists, reverse it. */
84 84
 					if ( $sort = end( $entries->sorts ) ) {
85
-						$entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ? : ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode );
85
+						$entries = $entries->sort( new \GV\Entry_Sort( $sort->field, $sort->direction == \GV\Entry_Sort::RAND ?: ( $sort->direction == \GV\Entry_Sort::ASC ? \GV\Entry_Sort::DESC : \GV\Entry_Sort::ASC ) ), $sort->mode );
86 86
 					} else {
87 87
 						/** Otherwise, sort by date_created */
88 88
 						$entries = $entries->sort( new \GV\Entry_Sort( \GV\Internal_Field::by_id( 'id' ), \GV\Entry_Sort::ASC ), \GV\Entry_Sort::NUMERIC );
@@ -99,20 +99,20 @@  discard block
 block discarded – undo
99 99
 				}
100 100
 				break;
101 101
 			default:
102
-				if ( ! $entry = \GV\GF_Entry::by_id( $atts['entry_id'] ) ) {
103
-					gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts['view_id'] ) );
102
+				if ( ! $entry = \GV\GF_Entry::by_id( $atts[ 'entry_id' ] ) ) {
103
+					gravityview()->log->error( 'Entry #{entry_id} not found', array( 'view_id' => $atts[ 'view_id' ] ) );
104 104
 					return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, null, $atts );
105 105
 				}
106 106
 		endswitch;
107 107
 
108
-		$field = is_numeric( $atts['field_id'] ) ? \GV\GF_Field::by_id( $view->form, $atts['field_id'] ) : \GV\Internal_Field::by_id( $atts['field_id'] );
108
+		$field = is_numeric( $atts[ 'field_id' ] ) ? \GV\GF_Field::by_id( $view->form, $atts[ 'field_id' ] ) : \GV\Internal_Field::by_id( $atts[ 'field_id' ] );
109 109
 
110 110
 		if ( ! $field ) {
111
-			gravityview()->log->error( 'Field #{field_id} not found', array( 'view_id' => $atts['field_id'] ) );
111
+			gravityview()->log->error( 'Field #{field_id} not found', array( 'view_id' => $atts[ 'field_id' ] ) );
112 112
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, $field, $atts );
113 113
 		}
114 114
 
115
-		if ( $view->form->ID != $entry['form_id'] ) {
115
+		if ( $view->form->ID != $entry[ 'form_id' ] ) {
116 116
 			gravityview()->log->error( 'Entry does not belong to view (form mismatch)' );
117 117
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, $atts );
118 118
 		}
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', get_the_password_form( $view->ID ), $view, $entry, $atts );
123 123
 		}
124 124
 
125
-		if ( ! $view->form  ) {
125
+		if ( ! $view->form ) {
126 126
 			gravityview()->log->notice( 'View #{id} has no form attached to it.', array( 'id' => $view->ID ) );
127 127
 
128 128
 			/**
@@ -145,13 +145,13 @@  discard block
 block discarded – undo
145 145
 		}
146 146
 
147 147
 		/** Unapproved entries. */
148
-		if ( $entry['status'] != 'active' ) {
148
+		if ( $entry[ 'status' ] != 'active' ) {
149 149
 			gravityview()->log->notice( 'Entry ID #{entry_id} is not active', array( 'entry_id' => $entry->ID ) );
150 150
 			return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, $atts );
151 151
 		}
152 152
 
153 153
 		if ( $view->settings->get( 'show_only_approved' ) ) {
154
-			if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) )  ) {
154
+			if ( ! \GravityView_Entry_Approval_Status::is_approved( gform_get_meta( $entry->ID, \GravityView_Entry_Approval::meta_key ) ) ) {
155 155
 				gravityview()->log->error( 'Entry ID #{entry_id} is not approved for viewing', array( 'entry_id' => $entry->ID ) );
156 156
 				return apply_filters( 'gravityview/shortcodes/gvfield/output', '', $view, $entry, $atts );
157 157
 			}
Please login to merge, or discard this patch.
future/includes/class-gv-context-template.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,8 +86,8 @@
 block discarded – undo
86 86
 		 */
87 87
 		$context->view = Utils::get( $template, 'view' );
88 88
 		$context->source = Utils::get( $template, 'source' );
89
-		$context->field = Utils::get( $template, 'field' ) ? : Utils::get( $data, 'field' );
90
-		$context->entry = Utils::get( $template, 'entry' ) ? : Utils::get( $data, 'entry' );
89
+		$context->field = Utils::get( $template, 'field' ) ?: Utils::get( $data, 'field' );
90
+		$context->entry = Utils::get( $template, 'entry' ) ?: Utils::get( $data, 'entry' );
91 91
 		$context->request = Utils::get( $template, 'request' );
92 92
 
93 93
 		$context->entries = Utils::get( $template, 'entries' ) ? $template->entries : null;
Please login to merge, or discard this patch.
gravityview.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 	 * @deprecated use gravityview()->log
245 245
      * @return void
246 246
      */
247
-    public static function log_debug( $message, $data = null ){
247
+    public static function log_debug( $message, $data = null ) {
248 248
 		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
249 249
 		gravityview()->log->debug( $message, $data );
250 250
     }
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 	 * @deprecated use gravityview()->log
256 256
      * @return void
257 257
      */
258
-    public static function log_error( $message, $data = null ){
258
+    public static function log_error( $message, $data = null ) {
259 259
 		gravityview()->log->notice( '\GravityView_Plugin is deprecated. Use \GV\Plugin instead.' );
260 260
 		gravityview()->log->error( $message, $data );
261 261
     }
Please login to merge, or discard this patch.
class-gravityview-plugin-hooks-gravity-forms-survey.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
 		$return = $input_type;
47 47
 
48
-		if( 'survey' === $field_type ) {
48
+		if ( 'survey' === $field_type ) {
49 49
 			$return = 'select';
50 50
 		}
51 51
 
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
 	public function fix_survey_fields( $fields ) {
66 66
 
67 67
 		/** @var GF_Field $field */
68
-		foreach( $fields as &$field ) {
69
-			if( 'survey' === $field->type ) {
68
+		foreach ( $fields as &$field ) {
69
+			if ( 'survey' === $field->type ) {
70 70
 				$field->allowsPrepopulate = true;
71 71
 			}
72 72
 		}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @return void
83 83
 	 */
84 84
 	function add_render_hooks() {
85
-		add_filter( 'gform_field_value', array( $this, 'fix_survey_field_value'), 10, 3 );
85
+		add_filter( 'gform_field_value', array( $this, 'fix_survey_field_value' ), 10, 3 );
86 86
 	}
87 87
 
88 88
 	/**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 * @return void
96 96
 	 */
97 97
 	function remove_render_hooks() {
98
-		remove_filter( 'gform_field_value', array( $this, 'fix_survey_field_value'), 10 );
98
+		remove_filter( 'gform_field_value', array( $this, 'fix_survey_field_value' ), 10 );
99 99
 	}
100 100
 
101 101
 	/**
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 	 */
114 114
 	public function fix_survey_field_value( $value, $field, $name ) {
115 115
 
116
-		if( 'survey' === $field->type ) {
116
+		if ( 'survey' === $field->type ) {
117 117
 
118
-			$entry = GravityView_Edit_Entry::getInstance()->instances['render']->get_entry();
118
+			$entry = GravityView_Edit_Entry::getInstance()->instances[ 'render' ]->get_entry();
119 119
 
120 120
 			// We need to run through each survey row until we find a match for expected values
121 121
 			foreach ( $entry as $field_id => $field_value ) {
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 					list( $row_val, $col_val ) = explode( ':', $field_value, 2 );
129 129
 
130 130
 					// If the $name matches the $row_val, we are processing the correct row
131
-					if( $row_val === $name ) {
131
+					if ( $row_val === $name ) {
132 132
 						$value = $field_value;
133 133
 						break;
134 134
 					}
Please login to merge, or discard this patch.
includes/class-gravityview-entry-approval-status.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -113,16 +113,16 @@  discard block
 block discarded – undo
113 113
 		$new_value = $old_value;
114 114
 
115 115
 		// Meta value does not exist yet
116
-		if( false === $old_value ) {
116
+		if ( false === $old_value ) {
117 117
 			return self::UNAPPROVED;
118 118
 		}
119 119
 
120 120
 		// Meta value does not exist yet
121
-		if( true === $old_value ) {
121
+		if ( true === $old_value ) {
122 122
 			return self::APPROVED;
123 123
 		}
124 124
 
125
-		switch ( (string) $old_value ) {
125
+		switch ( (string)$old_value ) {
126 126
 
127 127
 			// Approved values
128 128
 			case 'Approved':
@@ -248,9 +248,9 @@  discard block
 block discarded – undo
248 248
 		foreach ( $choices as $key => $choice ) {
249 249
 
250 250
 			// Is the passed status value the same as the choice value or key?
251
-			if ( $status === $choice['value'] || $status === $key ) {
251
+			if ( $status === $choice[ 'value' ] || $status === $key ) {
252 252
 
253
-				if( 'key' === $attr_key ) {
253
+				if ( 'key' === $attr_key ) {
254 254
 					return $key;
255 255
 				} else {
256 256
 					return \GV\Utils::get( $choice, $attr_key, false );
Please login to merge, or discard this patch.