concrete/src/Console/Command/InstallCommand.php
private function getQuestion($row, InputInterface $input)
    {
        $definition = $this->getDefinition();

        // Define default values
        $row = (array) $row;
        $default = null;
        $mutator = null;

        // Grab the key which is always first
        $key = array_shift($row);

        // If there's more stuff, this is probably the default value
        if ($row) {
            $default = array_shift($row);
        }

        // If the default value is callable, it's probably actually the mutator
        if (is_callable($default)) {
            $mutator = $default;
            $default = array_shift($row);
            if (is_callable($default)) {
                $default = $default($input);
            }
        } elseif ($row) { // Otherwise if there's still items, the mutator is last.
            $mutator = array_shift($row);
        }

        // If a value is provided already, use that as the default
        if ($provided = $input->getOption($key)) {
            $default = $provided;
        }

        // If we don't have a default, use the default from the InputOption
        $option = $definition->getOption($key);
        if (!$default) {
            $default = $option->getDefault();
        }

        // Create the new question deriving the question from the info we have
        $question = new Question($this->getQuestionString($option, $default), $default);

        // If we have a callable mutator, lets let it modify or replace the question
        if (is_callable($mutator)) {
            $question = $mutator($question, $input, $option);
        }

        return $question;
    }
private function getQuestion($row, InputInterface $input)
    {
        $definition = $this->getDefinition();

        // Define default values
        $row = (array) $row;
        $default = null;
        $mutator = null;

        // Grab the key which is always first
        $key = array_shift($row);

        // If there's more stuff, this is probably the default value
        if ($row) {
            $default = array_shift($row);
        }

        // If the default value is callable, it's probably actually the mutator
        if (is_callable($default)) {
            $mutator = $default;
            $default = array_shift($row);
            if (is_callable($default)) {
                $default = $default($input);
            }
        } elseif ($row) { // Otherwise if there's still items, the mutator is last.
            $mutator = array_shift($row);
        }

        // If a value is provided already, use that as the default
        if ($provided = $input->getOption($key)) {
            $default = $provided;
        }

        // If we don't have a default, use the default from the InputOption
        $option = $definition->getOption($key);
        if (!$default) {
            $default = $option->getDefault();
        }

        // Create the new question deriving the question from the info we have
        $question = new Question($this->getQuestionString($option, $default), $default);

        // If we have a callable mutator, lets let it modify or replace the question
        if (is_callable($mutator)) {
            $question = $mutator($question, $input, $option);
        }

        return $question;
    }
private function getQuestion ( $ row , InputInterface $ input ) { $ definition = $ this -> getDefinition ( ) ; // Define default values $ row = ( array ) $ row ; $ default = null ; $ mutator = null ; // Grab the key which is always first $ key = array_shift ( $ row ) ; // If there's more stuff, this is probably the default value if ( $ row ) { $ default = array_shift ( $ row ) ; } // If the default value is callable, it's probably actually the mutator if ( is_callable ( $ default ) ) { $ mutator = $ default ; $ default = array_shift ( $ row ) ; if ( is_callable ( $ default ) ) { $ default = $ default ( $ input ) ; } } elseif ( $ row ) { // Otherwise if there's still items, the mutator is last. $ mutator = array_shift ( $ row ) ; } // If a value is provided already, use that as the default if ( $ provided = $ input -> getOption ( $ key ) ) { $ default = $ provided ; } // If we don't have a default, use the default from the InputOption $ option = $ definition -> getOption ( $ key ) ; if ( ! $ default ) { $ default = $ option -> getDefault ( ) ; } // Create the new question deriving the question from the info we have $ question = new Question ( $ this -> getQuestionString ( $ option , $ default ) , $ default ) ; // If we have a callable mutator, lets let it modify or replace the question if ( is_callable ( $ mutator ) ) { $ question = $ mutator ( $ question , $ input , $ option ) ; } return $ question ; }
Do some procedural work to a row in the wizard step list to turn it into a proper question.

@param $row
@param \Symfony\Component\Console\Input\InputInterface $input

@return \Symfony\Component\Console\Question\Question
Do some procedural work to a row in the wizard step list to turn it into a proper question .