Commit 7894217c by Qiang Xue

renamed method names.

parent a9003015
...@@ -50,7 +50,7 @@ class HelpController extends Controller ...@@ -50,7 +50,7 @@ class HelpController extends Controller
public function actionIndex($args = array()) public function actionIndex($args = array())
{ {
if (empty($args)) { if (empty($args)) {
$status = $this->helpIndex(); $status = $this->getHelp();
} else { } else {
$result = \Yii::$application->createController($args[0]); $result = \Yii::$application->createController($args[0]);
if ($result === false) { if ($result === false) {
...@@ -61,9 +61,9 @@ class HelpController extends Controller ...@@ -61,9 +61,9 @@ class HelpController extends Controller
list($controller, $action) = $result; list($controller, $action) = $result;
if ($action === '') { if ($action === '') {
$status = $this->helpController($controller); $status = $this->getControllerHelp($controller);
} else { } else {
$status = $this->helpAction($controller, $action); $status = $this->getActionHelp($controller, $action);
} }
} }
return $status; return $status;
...@@ -90,6 +90,7 @@ class HelpController extends Controller ...@@ -90,6 +90,7 @@ class HelpController extends Controller
$actions = array_keys($controller->actions); $actions = array_keys($controller->actions);
$class = new \ReflectionClass($controller); $class = new \ReflectionClass($controller);
foreach ($class->getMethods() as $method) { foreach ($class->getMethods() as $method) {
/** @var $method \ReflectionMethod */
$name = $method->getName(); $name = $method->getName();
if ($method->isPublic() && !$method->isStatic() && strpos($name, 'action') === 0) { if ($method->isPublic() && !$method->isStatic() && strpos($name, 'action') === 0) {
$actions[] = lcfirst(substr($name, 6)); $actions[] = lcfirst(substr($name, 6));
...@@ -140,7 +141,7 @@ class HelpController extends Controller ...@@ -140,7 +141,7 @@ class HelpController extends Controller
* Displays all available commands. * Displays all available commands.
* @return integer the exit status * @return integer the exit status
*/ */
protected function helpIndex() protected function getHelp()
{ {
$commands = $this->getCommands(); $commands = $this->getCommands();
if ($commands !== array()) { if ($commands !== array()) {
...@@ -162,7 +163,7 @@ class HelpController extends Controller ...@@ -162,7 +163,7 @@ class HelpController extends Controller
* @param Controller $controller the controller instance * @param Controller $controller the controller instance
* @return integer the exit status * @return integer the exit status
*/ */
protected function helpController($controller) protected function getControllerHelp($controller)
{ {
$class = new \ReflectionClass($controller); $class = new \ReflectionClass($controller);
$comment = strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($class->getDocComment(), '/'))), "\r", ''); $comment = strtr(trim(preg_replace('/^\s*\**( |\t)?/m', '', trim($class->getDocComment(), '/'))), "\r", '');
...@@ -213,7 +214,7 @@ class HelpController extends Controller ...@@ -213,7 +214,7 @@ class HelpController extends Controller
* @param string $actionID action ID * @param string $actionID action ID
* @return integer the exit status * @return integer the exit status
*/ */
protected function helpAction($controller, $actionID) protected function getActionHelp($controller, $actionID)
{ {
$action = $controller->createAction($actionID); $action = $controller->createAction($actionID);
if ($action === null) { if ($action === null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment