src/Question/Question.php
public function ask()
    {
        $this->drawer->open();

        $phkey = new Detector();
        $listener = $phkey->getListenerInstance();
        $event = $listener->getEventDispatcher();

        $event->addListener(
            'key:up',
            function () {
                $this->cursor->moveUp(count($this->choices));
                $this->draw();
            }
        );

        $event->addListener(
            'key:down',
            function () {
                $this->cursor->moveDown(count($this->choices));
                $this->draw();
            }
        );

        $event->addListener(
            'key:space',
            function () {
                $this->selectChoice();
                $this->draw();
            }
        );

        $event->addListener(
            'key:enter',
            function () use ($event) {
                $event->dispatch('key:stop:listening');
                $this->drawer->closeWindow();
            }
        );

        $this->draw();
        $listener->start();

        return $this->getAnswers();
    }
public function ask()
    {
        $this->drawer->open();

        $phkey = new Detector();
        $listener = $phkey->getListenerInstance();
        $event = $listener->getEventDispatcher();

        $event->addListener(
            'key:up',
            function () {
                $this->cursor->moveUp(count($this->choices));
                $this->draw();
            }
        );

        $event->addListener(
            'key:down',
            function () {
                $this->cursor->moveDown(count($this->choices));
                $this->draw();
            }
        );

        $event->addListener(
            'key:space',
            function () {
                $this->selectChoice();
                $this->draw();
            }
        );

        $event->addListener(
            'key:enter',
            function () use ($event) {
                $event->dispatch('key:stop:listening');
                $this->drawer->closeWindow();
            }
        );

        $this->draw();
        $listener->start();

        return $this->getAnswers();
    }
public function ask ( ) { $ this -> drawer -> open ( ) ; $ phkey = new Detector ( ) ; $ listener = $ phkey -> getListenerInstance ( ) ; $ event = $ listener -> getEventDispatcher ( ) ; $ event -> addListener ( 'key:up' , function ( ) { $ this -> cursor -> moveUp ( count ( $ this -> choices ) ) ; $ this -> draw ( ) ; } ) ; $ event -> addListener ( 'key:down' , function ( ) { $ this -> cursor -> moveDown ( count ( $ this -> choices ) ) ; $ this -> draw ( ) ; } ) ; $ event -> addListener ( 'key:space' , function ( ) { $ this -> selectChoice ( ) ; $ this -> draw ( ) ; } ) ; $ event -> addListener ( 'key:enter' , function ( ) use ( $ event ) { $ event -> dispatch ( 'key:stop:listening' ) ; $ this -> drawer -> closeWindow ( ) ; } ) ; $ this -> draw ( ) ; $ listener -> start ( ) ; return $ this -> getAnswers ( ) ; }
Asks the question

@return array
Asks the question