[Console] added __get() to Command to have shorter and more readable code in commands
This commit is contained in:
parent
7c727355d1
commit
d229ce584f
@ -423,6 +423,20 @@ class Command
|
|||||||
return $this->application->getHelperSet()->get($name);
|
return $this->application->getHelperSet()->get($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a helper instance by name.
|
||||||
|
*
|
||||||
|
* @param string $name The helper name
|
||||||
|
*
|
||||||
|
* @return mixed The helper value
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException if the helper is not defined
|
||||||
|
*/
|
||||||
|
public function __get($name)
|
||||||
|
{
|
||||||
|
return $this->application->getHelperSet()->get($name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a text representation of the command.
|
* Returns a text representation of the command.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user