Skip to content

Commit 4c6e609

Browse files
committed
remove unused parameters
1 parent 22acfad commit 4c6e609

File tree

8 files changed

+16
-20
lines changed

8 files changed

+16
-20
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* update `printf()` in `class Branches`
77
* fix old `git-updater-pro` and `git-updater-additions` textdomains
88
* update `Base::upgrader_source_selection()` when trying to update `$source` and `$new_source` when destination directories are identical
9+
* remove unused parameters in certain functions
910

1011
#### 12.4.0 / 2024-03-04
1112
* update `freemius/wordpress-sdk`

git-updater.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Plugin Name: Git Updater
1313
* Plugin URI: https://git-updater.com
1414
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
15-
* Version: 12.4.0.6
15+
* Version: 12.4.0.7
1616
* Author: Andy Fragen
1717
* License: MIT
1818
* Domain Path: /languages

src/Git_Updater/Base.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,13 @@ public function upgrader_source_selection( $source, $remote_source, $upgrader, $
508508

509509
if ( trailingslashit( strtolower( $source ) ) !== trailingslashit( strtolower( $new_source ) ) ) {
510510
$result = move_dir( $source, $new_source, true );
511-
if ( \is_wp_error( $result ) ) {
511+
if ( is_wp_error( $result ) ) {
512512
return $result;
513513
}
514514
}
515515

516516
// Clean up $new_source directory.
517-
add_action( 'upgrader_install_package_result', [ $this, 'delete_upgrade_source' ], 10, 2 );
517+
add_action( 'upgrader_install_package_result', [ $this, 'delete_upgrade_source' ], 10, 1 );
518518

519519
return trailingslashit( $new_source );
520520
}

src/Git_Updater/Branch.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,11 @@ public function set_branch_on_install( $install ) {
205205
/**
206206
* Add branch switch row to plugins page.
207207
*
208-
* @param string $plugin_file Plugin file.
209-
* @param \stdClass $plugin_data Plugin repo data.
208+
* @param string $plugin_file Plugin file.
210209
*
211210
* @return bool
212211
*/
213-
public function plugin_branch_switcher( $plugin_file, $plugin_data ) {
212+
public function plugin_branch_switcher( $plugin_file ) {
214213
if ( empty( self::$options['branch_switch'] ) ) {
215214
return false;
216215
}
@@ -260,11 +259,10 @@ public function plugin_branch_switcher( $plugin_file, $plugin_data ) {
260259
* Create branch switcher row for theme multisite installation.
261260
*
262261
* @param string $theme_key Theme slug.
263-
* @param array $theme Array of theme data.
264262
*
265263
* @return bool
266264
*/
267-
public function multisite_branch_switcher( $theme_key, $theme ) {
265+
public function multisite_branch_switcher( $theme_key ) {
268266
if ( empty( self::$options['branch_switch'] ) ) {
269267
return false;
270268
}

src/Git_Updater/Install.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ private function get_upgrader( $type, $url ) {
291291
'install_theme_complete_actions',
292292
],
293293
10,
294-
3
294+
1
295295
);
296296
}
297297

@@ -454,12 +454,10 @@ public function install_api() {
454454
* Fix activation links after theme installation, no method to get proper theme name.
455455
*
456456
* @param array $install_actions Array of theme actions.
457-
* @param mixed $api Unused.
458-
* @param mixed $theme_info Theme slug.
459457
*
460458
* @return mixed
461459
*/
462-
public function install_theme_complete_actions( $install_actions, $api, $theme_info ) {
460+
public function install_theme_complete_actions( $install_actions ) {
463461
if ( isset( $install_actions['preview'] ) ) {
464462
unset( $install_actions['preview'] );
465463
}

src/Git_Updater/Plugin.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public function get_remote_plugin_meta() {
292292
if ( 'init' === current_filter()
293293
&& ( ! is_multisite() || is_network_admin() )
294294
) {
295-
add_action( "after_plugin_row_{$plugin->file}", [ new Branch(), 'plugin_branch_switcher' ], 15, 3 );
295+
add_action( "after_plugin_row_{$plugin->file}", [ new Branch(), 'plugin_branch_switcher' ], 15, 1 );
296296
}
297297
}
298298

src/Git_Updater/Theme.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,10 @@ public function get_remote_theme_meta() {
254254
* Add update row to theme row, only in multisite.
255255
*/
256256
if ( is_multisite() ) {
257-
add_action( 'after_theme_row', [ $this, 'remove_after_theme_row' ], 10, 2 );
257+
add_action( 'after_theme_row', [ $this, 'remove_after_theme_row' ], 10, 1 );
258258
if ( ! $this->tag ) {
259259
add_action( "after_theme_row_{$theme->slug}", [ $this, 'wp_theme_update_row' ], 10, 2 );
260-
add_action( "after_theme_row_{$theme->slug}", [ new Branch(), 'multisite_branch_switcher' ], 15, 2 );
260+
add_action( "after_theme_row_{$theme->slug}", [ new Branch(), 'multisite_branch_switcher' ], 15, 1 );
261261
}
262262
}
263263
}
@@ -426,9 +426,8 @@ public function wp_theme_update_row( $theme_key, $theme ) {
426426
* @author @grappler
427427
*
428428
* @param string $theme_key Theme slug.
429-
* @param array $theme Array of theme data.
430429
*/
431-
public function remove_after_theme_row( $theme_key, $theme ) {
430+
public function remove_after_theme_row( $theme_key ) {
432431
$themes = $this->get_theme_configs();
433432

434433
if ( array_key_exists( $theme_key, $themes ) ) {

src/Git_Updater/Traits/GU_Trait.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -817,11 +817,11 @@ final protected function get_repo_requirements( $repo ) {
817817
*
818818
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
819819
*
820-
* @param array|WP_Error $result Result from WP_Upgrader::install_package().
821-
* @param array $hook_extra Extra arguments passed to hooked filters.
820+
* @param array|WP_Error $result Result from WP_Upgrader::install_package().
821+
822822
* @return bool
823823
*/
824-
final public function delete_upgrade_source( $result, $hook_extra ) {
824+
final public function delete_upgrade_source( $result ) {
825825
global $wp_filesystem;
826826

827827
if ( ! is_wp_error( $result ) && ! empty( $result['destination_name'] ) ) {

0 commit comments

Comments
 (0)