From: scribu Date: Thu, 1 Aug 2013 19:40:34 +0000 (+0300) Subject: pass string to DocParser (makes it easier to unit test) X-Git-Tag: v0.11.0~7^2~11 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=f7cc325d74074311d2df0f194eeefee569e824cb;p=wvm%2Fwvm.git pass string to DocParser (makes it easier to unit test) --- diff --git a/php/WP_CLI/Dispatcher/CommandFactory.php b/php/WP_CLI/Dispatcher/CommandFactory.php index 72eb104f..4e7a0aae 100644 --- a/php/WP_CLI/Dispatcher/CommandFactory.php +++ b/php/WP_CLI/Dispatcher/CommandFactory.php @@ -21,7 +21,7 @@ class CommandFactory { } private static function create_subcommand( $parent, $name, $class_name, $method ) { - $docparser = new \WP_CLI\DocParser( $method ); + $docparser = new \WP_CLI\DocParser( $method->getDocComment() ); if ( !$name ) $name = $docparser->get_tag( 'subcommand' ); @@ -39,7 +39,7 @@ class CommandFactory { } private static function create_composite_command( $parent, $name, $reflection ) { - $docparser = new \WP_CLI\DocParser( $reflection ); + $docparser = new \WP_CLI\DocParser( $reflection->getDocComment() ); $container = new CompositeCommand( $parent, $name, $docparser ); diff --git a/php/WP_CLI/DocParser.php b/php/WP_CLI/DocParser.php index 4d597a63..c5bfb164 100644 --- a/php/WP_CLI/DocParser.php +++ b/php/WP_CLI/DocParser.php @@ -6,8 +6,8 @@ class DocParser { protected $docComment; - function __construct( $reflection ) { - $this->docComment = $reflection->getDocComment(); + function __construct( $docComment ) { + $this->docComment = $docComment; } function get_shortdesc() {