Robo\Robo::service PHP Méthode

service() public static méthode

Use this method if the desired service is not one of those with a dedicated accessor method below. If it is listed below, those methods are preferred as they can return useful type hints.
public static service ( string $id ) : mixed
$id string The ID of the service to retrieve.
Résultat mixed The specified service.
    public static function service($id)
    {
        return static::getContainer()->get($id);
    }

Usage Example

Exemple #1
0
 protected function _before()
 {
     $this->dialog = new Symfony\Component\Console\Helper\QuestionHelper();
     $this->setOutput(Robo::service('output'));
 }