Skip to content

Commit 8d05c78

Browse files
authored
Merge pull request #5885 from wp-cli/fix/remove-unneeded-compat
2 parents 9c1f144 + 0558d66 commit 8d05c78

File tree

5 files changed

+13
-62
lines changed

5 files changed

+13
-62
lines changed

php/WP_CLI/Compat/FeedbackMethodTrait.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

php/WP_CLI/Compat/Min_PHP_5_4/FeedbackMethodTrait.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

php/WP_CLI/Compat/Min_PHP_5_6/FeedbackMethodTrait.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

php/WP_CLI/UpgraderSkin.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
*/
1313
class UpgraderSkin extends WP_Upgrader_Skin {
1414

15-
use WP_CLI\Compat\FeedbackMethodTrait;
16-
1715
public $api;
1816

1917
public function header() {}
@@ -41,6 +39,19 @@ public function error( $error ) {
4139
WP_CLI::warning( $error );
4240
}
4341

42+
/**
43+
* @param string $string
44+
* @param mixed ...$args Optional text replacements.
45+
*/
46+
public function feedback( $string, ...$args ) {
47+
$args_array = [];
48+
foreach ( $args as $arg ) {
49+
$args_array[] = $args;
50+
}
51+
52+
$this->process_feedback( $string, $args );
53+
}
54+
4455
/**
4556
* Process the feedback collected through the compat indirection.
4657
*

phpcs.xml.dist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@
115115
<!-- Exclude existing classes from the protected parameter names rule as it would break BC to change these now. -->
116116
<rule ref="Universal.NamingConventions.NoReservedKeywordParameterNames">
117117
<exclude-pattern>*/php/WP_CLI/Iterators/Transform\.php</exclude-pattern>
118-
<exclude-pattern>*/php/WP_CLI/Compat/Min_PHP_5_4/FeedbackMethodTrait\.php</exclude-pattern>
119-
<exclude-pattern>*/php/WP_CLI/Compat/Min_PHP_5_6/FeedbackMethodTrait\.php</exclude-pattern>
120118
<exclude-pattern>*/php/WP_CLI/Inflector\.php</exclude-pattern>
121119
<exclude-pattern>*/php/WP_CLI/Autoloader\.php</exclude-pattern>
122120
<exclude-pattern>*/php/WP_CLI/Dispatcher/CommandFactory\.php</exclude-pattern>

0 commit comments

Comments
 (0)