protected function api()
    {
        if (!isset($this->api)) {
            $this->api = $this->getService('api');
            $this->api
                ->dispatcher
                ->addListener('login_required', [$this, 'login']);
            $this->api
                ->dispatcher
                ->addListener('environments_changed', [$this, 'updateDrushAliases']);
        }

        return $this->api;
    }
protected function api()
    {
        if (!isset($this->api)) {
            $this->api = $this->getService('api');
            $this->api
                ->dispatcher
                ->addListener('login_required', [$this, 'login']);
            $this->api
                ->dispatcher
                ->addListener('environments_changed', [$this, 'updateDrushAliases']);
        }

        return $this->api;
    }
protected function api ( ) { if ( ! isset ( $ this -> api ) ) { $ this -> api = $ this -> getService ( 'api' ) ; $ this -> api -> dispatcher -> addListener ( 'login_required' , [ $ this , 'login' ] ) ; $ this -> api -> dispatcher -> addListener ( 'environments_changed' , [ $ this , 'updateDrushAliases' ] ) ; } return $ this -> api ; }
Set up the API object.

@return \Platformsh\Cli\Service\Api
Set up the API object .