Completed
Pull Request — master (#601)
by Stephanie
42s
created
classes/models/FrmPluginSearch.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,16 +75,16 @@  discard block
 block discarded – undo
75 75
 			'name'                => sprintf(
76 76
 				/* translators: Formidable addon name */
77 77
 				esc_html_x( 'Formidable %s', 'Formidable Addon Name', 'formidable' ),
78
-				$addon_list[ $matching_addon ]['name']
78
+				$addon_list[$matching_addon]['name']
79 79
 			),
80
-			'addon'               => $addon_list[ $matching_addon ]['slug'],
81
-			'short_description'   => $addon_list[ $matching_addon ]['excerpt'],
80
+			'addon'               => $addon_list[$matching_addon]['slug'],
81
+			'short_description'   => $addon_list[$matching_addon]['excerpt'],
82 82
 			'slug'                => self::$slug,
83
-			'version'             => $addon_list[ $matching_addon ]['version'],
83
+			'version'             => $addon_list[$matching_addon]['version'],
84 84
 		);
85 85
 
86 86
 		// Splice in the base addon data.
87
-		$inject = array_merge( $inject, $addon_list[ $matching_addon ], $overrides );
87
+		$inject = array_merge( $inject, $addon_list[$matching_addon], $overrides );
88 88
 
89 89
 		// Add it to the top of the list.
90 90
 		array_unshift( $result->plugins, $inject );
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 	 * @return array
137 137
 	 */
138 138
 	private function get_addons() {
139
-		$api    = FrmFormApi::get_instance();
139
+		$api = FrmFormApi::get_instance();
140 140
 		return $api->get_api_info();
141 141
 	}
142 142
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
 		$all_plugins = get_plugins();
343 343
 
344
-		return isset( $all_plugins[ $plugin ] );
344
+		return isset( $all_plugins[$plugin] );
345 345
 	}
346 346
 
347 347
 	/**
Please login to merge, or discard this patch.
classes/models/FrmFormApi.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 		$class = get_called_class();
48 48
 		$key   = $class . $license;
49 49
 
50
-		if ( ! isset( self::$instances[ $key ] ) ) {
51
-			self::$instances[ $key ] = new $class( $license );
50
+		if ( ! isset( self::$instances[$key] ) ) {
51
+			self::$instances[$key] = new $class( $license );
52 52
 		}
53 53
 
54
-		return self::$instances[ $key ];
54
+		return self::$instances[$key];
55 55
 	}
56 56
 
57 57
 	/**
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		}
94 94
 
95 95
 		// Don't run the request again if it has already run and got no response.
96
-		if ( isset( $this->has_run[ $url ] ) ) {
96
+		if ( isset( $this->has_run[$url] ) ) {
97 97
 			return array();
98 98
 		}
99 99
 
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 			$agent = 'formidable-pro/' . FrmProDb::$plug_version;
104 104
 		}
105 105
 
106
-		$this->has_run[ $url ] = true;
106
+		$this->has_run[$url] = true;
107 107
 
108 108
 		$response = wp_remote_get(
109 109
 			$url,
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 				}
127 127
 				$cats = array_intersect( $this->skip_categories(), $addon['categories'] );
128 128
 				if ( ! empty( $cats ) ) {
129
-					unset( $addons[ $k ] );
129
+					unset( $addons[$k] );
130 130
 				}
131 131
 			}
132 132
 		}
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
 					return $addon;
174 174
 				}
175 175
 			}
176
-		} elseif ( isset( $addons[ $download_id ] ) ) {
177
-			$plugin = $addons[ $download_id ];
176
+		} elseif ( isset( $addons[$download_id] ) ) {
177
+			$plugin = $addons[$download_id];
178 178
 		}
179 179
 
180 180
 		return $plugin;
Please login to merge, or discard this patch.
classes/models/FrmAddon.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	}
42 42
 
43 43
 	public function insert_installed_addon( $plugins ) {
44
-		$plugins[ $this->plugin_slug ] = $this;
44
+		$plugins[$this->plugin_slug] = $this;
45 45
 
46 46
 		return $plugins;
47 47
 	}
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
 	public static function get_addon( $plugin_slug ) {
50 50
 		$plugins = apply_filters( 'frm_installed_addons', array() );
51 51
 		$plugin  = false;
52
-		if ( isset( $plugins[ $plugin_slug ] ) ) {
53
-			$plugin = $plugins[ $plugin_slug ];
52
+		if ( isset( $plugins[$plugin_slug] ) ) {
53
+			$plugin = $plugins[$plugin_slug];
54 54
 		}
55 55
 
56 56
 		return $plugin;
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 		} else {
110 110
 			$api     = FrmFormApi::get_instance( $this->license );
111 111
 			$plugins = $api->get_api_info();
112
-			$_data   = $plugins[ $item_id ];
112
+			$_data   = $plugins[$item_id];
113 113
 		}
114 114
 
115 115
 		$_data['sections'] = array(
@@ -331,19 +331,19 @@  discard block
 block discarded – undo
331 331
 
332 332
 		if ( $this->is_current_version( $transient ) ) {
333 333
 			//make sure it doesn't show there is an update if plugin is up-to-date
334
-			if ( isset( $transient->response[ $this->plugin_folder ] ) ) {
335
-				unset( $transient->response[ $this->plugin_folder ] );
334
+			if ( isset( $transient->response[$this->plugin_folder] ) ) {
335
+				unset( $transient->response[$this->plugin_folder] );
336 336
 			}
337
-		} elseif ( isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) ) {
338
-			$this->prepare_update_details( $transient->response[ $this->plugin_folder ] );
337
+		} elseif ( isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) ) {
338
+			$this->prepare_update_details( $transient->response[$this->plugin_folder] );
339 339
 
340 340
 			// if the transient has expired, clear the update and trigger it again
341
-			if ( $transient->response[ $this->plugin_folder ] === false ) {
341
+			if ( $transient->response[$this->plugin_folder] === false ) {
342 342
 				if ( ! $this->has_been_cleared() ) {
343 343
 					$this->cleared_plugins();
344 344
 					$this->manually_queue_update();
345 345
 				}
346
-				unset( $transient->response[ $this->plugin_folder ] );
346
+				unset( $transient->response[$this->plugin_folder] );
347 347
 			}
348 348
 		}
349 349
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 	}
432 432
 
433 433
 	private function is_current_version( $transient ) {
434
-		if ( empty( $transient->checked ) || ! isset( $transient->checked[ $this->plugin_folder ] ) ) {
434
+		if ( empty( $transient->checked ) || ! isset( $transient->checked[$this->plugin_folder] ) ) {
435 435
 			return false;
436 436
 		}
437 437
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 			return true;
441 441
 		}
442 442
 
443
-		return isset( $transient->response ) && isset( $transient->response[ $this->plugin_folder ] ) && $transient->checked[ $this->plugin_folder ] === $transient->response[ $this->plugin_folder ]->new_version;
443
+		return isset( $transient->response ) && isset( $transient->response[$this->plugin_folder] ) && $transient->checked[$this->plugin_folder] === $transient->response[$this->plugin_folder]->new_version;
444 444
 	}
445 445
 
446 446
 	private function has_been_cleared() {
@@ -531,8 +531,8 @@  discard block
 block discarded – undo
531 531
 			$response['message'] = $response['status'];
532 532
 		} else {
533 533
 			$messages = $this->get_messages();
534
-			if ( is_string( $response['status'] ) && isset( $messages[ $response['status'] ] ) ) {
535
-				$response['message'] = $messages[ $response['status'] ];
534
+			if ( is_string( $response['status'] ) && isset( $messages[$response['status']] ) ) {
535
+				$response['message'] = $messages[$response['status']];
536 536
 			} else {
537 537
 				$response['message'] = FrmAppHelper::kses( $response['status'], array( 'a' ) );
538 538
 			}
Please login to merge, or discard this patch.