Skip to content

Commit 1ef8ab4

Browse files
committed
Minor code adjustments based on Scrutinizer feedback.
1 parent bd841f7 commit 1ef8ab4

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

class-tgm-plugin-activation.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,11 @@ public function maybe_adjust_source_dir( $source, $remote_source, $upgrader ) {
10151015
$subdir_name = untrailingslashit( str_replace( trailingslashit( $remote_source ), '', $source ) );
10161016

10171017
if ( ! empty( $subdir_name ) && $subdir_name !== $desired_slug ) {
1018-
$from = untrailingslashit( $source );
1019-
$to = trailingslashit( $remote_source ) . $desired_slug;
1018+
$from_path = untrailingslashit( $source );
1019+
$to_path = trailingslashit( $remote_source ) . $desired_slug;
10201020

1021-
if ( true === $GLOBALS['wp_filesystem']->move( $from, $to ) ) {
1022-
return trailingslashit( $to );
1021+
if ( true === $GLOBALS['wp_filesystem']->move( $from_path, $to_path ) ) {
1022+
return trailingslashit( $to_path );
10231023
} else {
10241024
return new WP_Error( 'rename_failed', esc_html__( 'The remote plugin package does not contain a folder with the desired slug and renaming did not work.', 'tgmpa' ) . ' ' . esc_html__( 'Please contact the plugin provider and ask them to package their plugin according to the WordPress guidelines.', 'tgmpa' ), array( 'found' => $subdir_name, 'expected' => $desired_slug ) );
10251025
}
@@ -1452,13 +1452,13 @@ public function sanitize_key( $key ) {
14521452
$key = preg_replace( '`[^A-Za-z0-9_-]`', '', $key );
14531453

14541454
/**
1455-
* Filter a sanitized key string.
1456-
*
1457-
* @since 2.5.0
1458-
*
1459-
* @param string $key Sanitized key.
1460-
* @param string $raw_key The key prior to sanitization.
1461-
*/
1455+
* Filter a sanitized key string.
1456+
*
1457+
* @since 2.5.0
1458+
*
1459+
* @param string $key Sanitized key.
1460+
* @param string $raw_key The key prior to sanitization.
1461+
*/
14621462
return apply_filters( 'tgmpa_sanitize_key', $key, $raw_key );
14631463
}
14641464

@@ -1501,7 +1501,7 @@ public function config( $config ) {
15011501
* @since 2.0.0
15021502
*
15031503
* @param array $install_actions Existing array of actions.
1504-
* @return array Amended array of actions.
1504+
* @return false|array Amended array of actions.
15051505
*/
15061506
public function actions( $install_actions ) {
15071507
// Remove action links on the TGMPA install page.
@@ -2069,7 +2069,7 @@ public function show_tgmpa_version() {
20692069
*
20702070
* @since 2.4.0
20712071
*
2072-
* @return object The TGM_Plugin_Activation object.
2072+
* @return \TGM_Plugin_Activation The TGM_Plugin_Activation object.
20732073
*/
20742074
public static function get_instance() {
20752075
if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
@@ -2275,7 +2275,7 @@ protected function _gather_plugin_data() {
22752275
if ( ! empty( $upgrade_notice ) ) {
22762276
$table_data[ $i ]['upgrade_notice'] = $upgrade_notice;
22772277

2278-
add_action( "tgmpa_after_plugin_row_$slug", array( $this, 'wp_plugin_update_row' ), 10, 2 );
2278+
add_action( "tgmpa_after_plugin_row_{$slug}", array( $this, 'wp_plugin_update_row' ), 10, 2 );
22792279
}
22802280

22812281
$table_data[ $i ] = apply_filters( 'tgmpa_table_data_item', $table_data[ $i ], $plugin );

0 commit comments

Comments
 (0)