Doccomment can now override context command name
This commit is contained in:
parent
ae17abb6c1
commit
81dea747b2
@ -17,6 +17,7 @@ class MyCommand extends Command
|
|||||||
class MyContext extends Context
|
class MyContext extends Context
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
* @command testme
|
||||||
* @args
|
* @args
|
||||||
* @help Useful test!
|
* @help Useful test!
|
||||||
*/
|
*/
|
||||||
|
@ -41,7 +41,8 @@ class Context
|
|||||||
$info[$key] = $value;
|
$info[$key] = $value;
|
||||||
}
|
}
|
||||||
if (count($info)>0) {
|
if (count($info)>0) {
|
||||||
$this->addCommand($method->getName(), [$this, $method->getName()], $info);
|
$cmdName = array_key_exists("command",$info)?$info["command"]:$method->getName();
|
||||||
|
$this->addCommand($cmdName, [$this, $method->getName()], $info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,4 +129,4 @@ class Context
|
|||||||
return $this->data;
|
return $this->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user