Skip to content

Commit 3417708

Browse files
committed
Clean up namespaces
1 parent c53af87 commit 3417708

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

phpcs.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
4646
<properties>
4747
<property name="prefixes" type="array" extend="true">
48-
<element value="WP_CLI"/><!-- Namespaces. -->
49-
<element value="wpcli"/><!-- Global variables and such. -->
48+
<element value="WP_CLI\Shell"/><!-- Namespaces. -->
49+
<element value="wpcli_shell"/><!-- Global variables and such. -->
5050
</property>
5151
</properties>
5252
</rule>

src/Shell_Command.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22

3-
class Shell_Command extends \WP_CLI_Command {
3+
use WP_CLI\Utils;
4+
5+
class Shell_Command extends WP_CLI_Command {
46

57
/**
68
* Opens an interactive PHP console for running and testing PHP code.
@@ -26,13 +28,13 @@ class Shell_Command extends \WP_CLI_Command {
2628
*/
2729
public function __invoke( $_, $assoc_args ) {
2830
$implementations = array(
29-
'\\Psy\\Shell',
30-
'\\Boris\\Boris',
31-
'\\WP_CLI\\REPL',
31+
'Psy\\Shell',
32+
'Boris\\Boris',
33+
'WP_CLI\\Shell\\REPL',
3234
);
3335

34-
if ( \WP_CLI\Utils\get_flag_value( $assoc_args, 'basic' ) ) {
35-
$class = '\\WP_CLI\\REPL';
36+
if ( Utils\get_flag_value( $assoc_args, 'basic' ) ) {
37+
$class = 'WP_CLI\\Shell\\REPL';
3638
} else {
3739
foreach ( $implementations as $candidate ) {
3840
if ( class_exists( $candidate ) ) {
@@ -42,8 +44,8 @@ public function __invoke( $_, $assoc_args ) {
4244
}
4345
}
4446

45-
if ( '\\Psy\\Shell' === $class ) {
46-
\Psy\Shell::debug();
47+
if ( 'Psy\\Shell' === $class ) {
48+
Psy\Shell::debug();
4749
} else {
4850
$repl = new $class( 'wp> ' );
4951
$repl->start();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace WP_CLI;
3+
namespace WP_CLI\Shell;
44

55
use WP_CLI;
66

0 commit comments

Comments
 (0)