Skip to content

Commit

Permalink
[Console] added __get() to Command to have shorter and more readable …
Browse files Browse the repository at this point in the history
…code in commands
  • Loading branch information
fabpot committed Mar 10, 2010
1 parent 7c72735 commit d229ce5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Symfony/Components/Console/Command/Command.php
Expand Up @@ -423,6 +423,20 @@ protected function getHelper($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.
*
Expand Down

0 comments on commit d229ce5

Please sign in to comment.