private function askPathToModify()
    {
        $names = $this->resolver->names();
        $count = count($names);

        $question = new Question('Enter # or name to modify or empty to continue');
        $question->setValidator(function ($value) use ($names, $count) {
            if ($value === null) {
                return $value;
            }

            if (!is_numeric($value) && array_search($value, $names) !== false) {
                return $value;
            } elseif ($value > 0 && $value <= $count) {
                return $names[$value - 1];
            }

            throw new \Exception("Please enter a name or a number between 1 and $count.");
        });
        $question->setAutocompleterValues($names);

        return $this->io->askQuestionThenRemove($question);
    }
private function askPathToModify()
    {
        $names = $this->resolver->names();
        $count = count($names);

        $question = new Question('Enter # or name to modify or empty to continue');
        $question->setValidator(function ($value) use ($names, $count) {
            if ($value === null) {
                return $value;
            }

            if (!is_numeric($value) && array_search($value, $names) !== false) {
                return $value;
            } elseif ($value > 0 && $value <= $count) {
                return $names[$value - 1];
            }

            throw new \Exception("Please enter a name or a number between 1 and $count.");
        });
        $question->setAutocompleterValues($names);

        return $this->io->askQuestionThenRemove($question);
    }
private function askPathToModify ( ) { $ names = $ this -> resolver -> names ( ) ; $ count = count ( $ names ) ; $ question = new Question ( 'Enter # or name to modify or empty to continue' ) ; $ question -> setValidator ( function ( $ value ) use ( $ names , $ count ) { if ( $ value === null ) { return $ value ; } if ( ! is_numeric ( $ value ) && array_search ( $ value , $ names ) !== false ) { return $ value ; } elseif ( $ value > 0 && $ value <= $ count ) { return $ names [ $ value - 1 ] ; } throw new \ Exception ( "Please enter a name or a number between 1 and $count." ) ; } ) ; $ question -> setAutocompleterValues ( $ names ) ; return $ this -> io -> askQuestionThenRemove ( $ question ) ; }
Ask which path to modify.

@return string|null the path name to modify or null to finish
Ask which path to modify .