Ask witch MetaData Source you want to use

@param  string                                 $choice
@throws ResponseExpectedException
@return \CrudGenerator\Metadata\MetaDataSource
482667
public function ask($choice = null)
    {
        $responseCollection         = new PredefinedResponseCollection();
        $sourceConfiguredCollection = $this->metadataSourceConfigDAO->retrieveAll();

        if ($sourceConfiguredCollection->count() === 0) {
            throw new \Exception('You must config a metadataSource');
        }

        foreach ($sourceConfiguredCollection as $backend) {
            /* @var $backend \CrudGenerator\Metadata\MetaDataSource */
            if (null === $backend->getFalseDependencies()) {
                $responseCollection->append(
                    new PredefinedResponse($backend->getUniqueName(), $backend->getUniqueName(), $backend)
                );
            }
        }

        $question = new QuestionWithPredefinedResponse(
            "Select configured source",
            self::QUESTION_KEY,
            $responseCollection
        );
        $question->setPreselectedResponse($choice);
        $question->setShutdownWithoutResponse(true);

        return $this->context->askCollection($question);
    }
1219473
protected function askOptions(string $description, array $options, int $default, $multiSelect = false)
    {
        $helper   = $this->getHelper('question');
        $question = new ChoiceQuestion(
            $description,
            $options,
            $default
        );
        if ($multiSelect) {
            $question->setMultiselect(true);
        }
        $question->setErrorMessage('Answer is invalid');
        $answer = $helper->ask($this->input, $this->output, $question);

        return $answer;
    }
1025877
protected function parseChoice($ident, $choice)
    {
        $choice = parent::parseChoice($ident, $choice);

        // Prevent choices from breaking their input types
        if (isset($choice['type'])) {
            unset($choice['type']);
        }

        $choice['inputId'] = $this->generateInputId();

        return $choice;
    }
113646
public static function getData(Request $request, AjaxChoiceLoaderInterface $choiceLoader, AjaxChoiceListFormatterInterface $formatter, $prefix = '')
    {
        $ajaxIds = $request->get($prefix.'ids', '');

        if (\is_string($ajaxIds) && '' !== $ajaxIds) {
            $ajaxIds = explode(',', $ajaxIds);
        } elseif (!\is_array($ajaxIds) || \in_array($ajaxIds, [null, ''])) {
            $ajaxIds = [];
        }

        $choiceLoader->setPageSize((int) ($request->get($prefix.'ps', $choiceLoader->getPageSize())));
        $choiceLoader->setPageNumber((int) ($request->get($prefix.'pn', $choiceLoader->getPageNumber())));
        $choiceLoader->setSearch($request->get($prefix.'s', ''));
        $choiceLoader->setIds($ajaxIds);
        $choiceLoader->reset();

        return $formatter->formatResponseData($choiceLoader);
    }
1209800
public function get(string $option)
    {
        if (!isset($this->options[$option])) {
            throw new \InvalidArgumentException(sprintf('Option "%s" does not exists.', $option));
        }

        return $this->options[$option];
    }
948767
public function choice($question, array $choices, $default = null, $attempts = null, $multiple = null)
    {
        return parent::choice($this->setTextPrompt($question), $choices, $default, $attempts, $multiple);
    }
591511
public static function fromOption($option)
    {
        $message = sprintf(
            'Could not add invalid Option of type "%1$s" to option repository.',
            is_object($option)
                ? get_class($option)
                : gettype($option)
        );

        return new static($message);
    }
332147
public function setName($name) {
        if ($name !== null && ! $this->argumentsParser->isOptionName($name)) {
            throw new InvalidOptionNameException(s(
                'A option name must have this format: "--option", got: "%s"', $name
            ));
        }

        $this->name = $name;

        return $this;
    }
690349
public function getOption(string $option, $default = null)
    {
        if (!$this->hasOption($option)) {
            return $default;
        }

        return $this->options[$option];
    }
126871
protected function parseChoice($ident, $choice)
    {
        if (!isset($choice['value'])) {
            $choice['value'] = $ident;
        }

        if (isset($choice['label'])) {
            $choice['label'] = (string)$this->translator()->translation($choice['label']);
        } else {
            $choice['label'] = (string)$this->translator()->translation($choice['value']);
        }

        $choice['checked'] = $this->isChoiceSelected($choice);
        $choice['selected'] = $choice['checked'];

        return $choice;
    }
1192789
final protected function get($option)
    {
        if (array_key_exists($key = "$option", $this->options)) {
            return $this->options[$key];
        }

        if (array_key_exists($key, $this->defaults)) {
            return $this->defaults[$key];
        }
    }
1159006
private function serializeChoices(ChoiceQuestion $choiceQuestion, array $options = [])
    {
        return array_map(function (Choice $choice) use ($options) {
            $choiceData = $this->contentSerializer->serialize($choice, $options);
            // TODO : finish content management. For now the choice id overlaps the content ID.
            $choiceData['id'] = $choice->getUuid();

            return $choiceData;
        }, $choiceQuestion->getChoices()->toArray());
    }
349965
protected function parseChoice($choice)
    {
        list($type, $value) = explode(': ', strip_tags($choice));

        if ($type === 'Provider') {
            $this->provider = $value;
        } elseif ($type === 'Tag') {
            $this->tags = [$value];
        }
    }
979164
public function hasMeta($option)
    {
        return (isset($this->metaData[$option])) ? $this->metaData[$option] : false;
    }
511838
public function addChoice($choice, $label = null)
    {
        $label ?: $label = $choice;
        $this->choices[$choice] = $label;
        return $this;
    }
471089
public function choice($question, array $choices, $default = null)
    {
        $helper = $this->getHelper('question');

        $question = new ChoiceQuestion($question, $choices, $default);

        $question->setMultiselect(true);

        return $helper->ask($this->input, $this->getOutputInterface(), $question);
    }
530355
public static function getCurlOptionFromResponse(Response $response, $option = 0)
    {
        switch ($option) {
            case 0: // 0 == array of all curl options
                $info = array();
                foreach (self::$curlInfoList as $option => $key) {
                    $info[$key] = $response->getCurlInfo($key);
                }
                break;
            case CURLINFO_HTTP_CODE:
                $info = (int)$response->getStatusCode();
                break;
            case CURLINFO_SIZE_DOWNLOAD:
                $info = $response->getHeader('Content-Length');
                break;
            case CURLINFO_HEADER_SIZE:
                $info =  mb_strlen(HttpUtil::formatAsStatusWithHeadersString($response), 'ISO-8859-1');
                break;
            default:
                $info = $response->getCurlInfo($option);
                break;
        }

        if (!is_null($info)) {
            return $info;
        }

        $constants = get_defined_constants(true);
        $constantNames = array_flip($constants['curl']);
        throw new \BadMethodCallException("Not implemented: {$constantNames[$option]} ({$option}) ");
    }