src/Terion/PackageInstaller/PackageInstallCommand.php
protected function choosePackage($packages)
    {
        $choose = $this->ask('Select package by number [1]:', '1');
        if (!is_numeric($choose) or !isset($packages[$choose - 1])) {
            $this->error('Incorrect value given!');
            $this->choosePackage($packages);
        } else {
            $index = $choose - 1;
            $result = $packages[$index];
            $this->comment('Your choice: ' . $result->getName());
            $package = $this->getPackage($result->getName());
        }
    }
protected function choosePackage($packages)
    {
        $choose = $this->ask('Select package by number [1]:', '1');
        if (!is_numeric($choose) or !isset($packages[$choose - 1])) {
            $this->error('Incorrect value given!');
            $this->choosePackage($packages);
        } else {
            $index = $choose - 1;
            $result = $packages[$index];
            $this->comment('Your choice: ' . $result->getName());
            $package = $this->getPackage($result->getName());
        }
    }
protected function choosePackage ( $ packages ) { $ choose = $ this -> ask ( 'Select package by number [1]:' , '1' ) ; if ( ! is_numeric ( $ choose ) or ! isset ( $ packages [ $ choose - 1 ] ) ) { $ this -> error ( 'Incorrect value given!' ) ; $ this -> choosePackage ( $ packages ) ; } else { $ index = $ choose - 1 ; $ result = $ packages [ $ index ] ; $ this -> comment ( 'Your choice: ' . $ result -> getName ( ) ) ; $ package = $ this -> getPackage ( $ result -> getName ( ) ) ; } }
Ask package select from a list.

@param $packages
Ask package select from a list .