OSDN Git Service

move fetcher classes to their own directory; see #863
authorscribu <mail@scribu.net>
Sun, 10 Nov 2013 00:14:13 +0000 (02:14 +0200)
committerscribu <mail@scribu.net>
Sun, 10 Nov 2013 00:14:13 +0000 (02:14 +0200)
php/WP_CLI/Fetchers/Base.php [moved from php/WP_CLI/Fetcher.php with 94% similarity]
php/WP_CLI/Fetchers/Comment.php [moved from php/WP_CLI/FetcherComment.php with 81% similarity]
php/WP_CLI/Fetchers/Plugin.php [moved from php/WP_CLI/FetcherPlugin.php with 88% similarity]
php/WP_CLI/Fetchers/Post.php [moved from php/WP_CLI/FetcherPost.php with 70% similarity]
php/WP_CLI/Fetchers/Theme.php [moved from php/WP_CLI/FetcherTheme.php with 79% similarity]
php/WP_CLI/Fetchers/User.php [moved from php/WP_CLI/FetcherUser.php with 82% similarity]
php/commands/comment.php
php/commands/plugin.php
php/commands/post.php
php/commands/theme.php
php/commands/user.php

similarity index 94%
rename from php/WP_CLI/Fetcher.php
rename to php/WP_CLI/Fetchers/Base.php
index 0ef9f92..9e4ebc3 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-namespace WP_CLI;
+namespace WP_CLI\Fetchers;
 
-abstract class Fetcher {
+abstract class Base {
 
        /**
         * @param string $msg The message to display when an item is not found
similarity index 81%
rename from php/WP_CLI/FetcherComment.php
rename to php/WP_CLI/Fetchers/Comment.php
index cc02cbb..296b253 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-namespace WP_CLI;
+namespace WP_CLI\Fetchers;
 
-class FetcherComment extends Fetcher {
+class Comment extends Base {
 
        protected $msg = "Could not find the comment with ID %d.";
 
similarity index 88%
rename from php/WP_CLI/FetcherPlugin.php
rename to php/WP_CLI/Fetchers/Plugin.php
index bd68712..247192b 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-namespace WP_CLI;
+namespace WP_CLI\Fetchers;
 
-class FetcherPlugin extends Fetcher {
+class Plugin extends Base {
 
        protected $msg = "The '%s' plugin could not be found.";
 
similarity index 70%
rename from php/WP_CLI/FetcherPost.php
rename to php/WP_CLI/Fetchers/Post.php
index 62f1271..4944561 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-namespace WP_CLI;
+namespace WP_CLI\Fetchers;
 
-class FetcherPost extends Fetcher {
+class Post extends Base {
 
        protected $msg = "Could not find the post with ID %d.";
 
similarity index 79%
rename from php/WP_CLI/FetcherTheme.php
rename to php/WP_CLI/Fetchers/Theme.php
index 5066983..1c33805 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-namespace WP_CLI;
+namespace WP_CLI\Fetchers;
 
-class FetcherTheme extends Fetcher {
+class Theme extends Base {
 
        protected $msg = "The '%s' theme could not be found.";
 
similarity index 82%
rename from php/WP_CLI/FetcherUser.php
rename to php/WP_CLI/Fetchers/User.php
index e1111e0..81bbbc2 100644 (file)
@@ -1,8 +1,8 @@
 <?php
 
-namespace WP_CLI;
+namespace WP_CLI\Fetchers;
 
-class FetcherUser extends Fetcher {
+class User extends Base {
 
        protected $msg = "Invalid user ID or login: '%s'";
 
index aa73d16..06b4b64 100644 (file)
@@ -19,7 +19,7 @@ class Comment_Command extends \WP_CLI\CommandWithDBObject {
        );
 
        public function __construct() {
-               $this->fetcher = new \WP_CLI\FetcherComment;
+               $this->fetcher = new \WP_CLI\Fetchers\Comment;
        }
 
        /**
index ff90c5c..3edf31c 100644 (file)
@@ -24,7 +24,7 @@ class Plugin_Command extends \WP_CLI\CommandWithUpgrade {
 
                parent::__construct();
 
-               $this->fetcher = new \WP_CLI\FetcherPlugin;
+               $this->fetcher = new \WP_CLI\Fetchers\Plugin;
        }
 
        protected function get_upgrader_class( $force ) {
index 143b02e..ca9a156 100644 (file)
@@ -17,7 +17,7 @@ class Post_Command extends \WP_CLI\CommandWithDBObject {
        );
 
        public function __construct() {
-               $this->fetcher = new \WP_CLI\FetcherPost;
+               $this->fetcher = new \WP_CLI\Fetchers\Post;
        }
 
        /**
index d543778..87c806c 100644 (file)
@@ -21,7 +21,7 @@ class Theme_Command extends \WP_CLI\CommandWithUpgrade {
        function __construct() {
                parent::__construct();
 
-               $this->fetcher = new \WP_CLI\FetcherTheme;
+               $this->fetcher = new \WP_CLI\Fetchers\Theme;
        }
 
        protected function get_upgrader_class( $force ) {
index cf18fcb..ae1733a 100644 (file)
@@ -18,7 +18,7 @@ class User_Command extends \WP_CLI\CommandWithDBObject {
        );
 
        public function __construct() {
-               $this->fetcher = new \WP_CLI\FetcherUser;
+               $this->fetcher = new \WP_CLI\Fetchers\User;
        }
 
        /**