Doccomment can now override context command name
This commit is contained in:
		@@ -17,6 +17,7 @@ class MyCommand extends Command
 | 
			
		||||
class MyContext extends Context
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * @command testme
 | 
			
		||||
     * @args
 | 
			
		||||
     * @help Useful test!
 | 
			
		||||
     */
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,8 @@ class Context
 | 
			
		||||
                    $info[$key] = $value; 
 | 
			
		||||
                }
 | 
			
		||||
                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;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user