SensioLabs\Insight\Cli\Helper\ConfigurationHelper::resolveValue PHP Method

resolveValue() private method

private resolveValue ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output, Configuration $configuration, $varName, $default = null )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
$configuration SensioLabs\Insight\Cli\Configuration
    private function resolveValue(InputInterface $input, OutputInterface $output, Configuration $configuration, $varName, $default = null)
    {
        $configurationProperty = str_replace(' ', '', $varName);
        $value = $this->getValue($input, $varName);
        if (!$value) {
            $value = $configuration->{'get' . $configurationProperty}();
        }
        if (!$value) {
            $value = $default;
        }
        if (!$value && $input->isInteractive()) {
            $value = $this->askValue($input, $output, $varName);
        }
        if (!$value) {
            throw new \InvalidArgumentException(sprintf('You should provide your %s.', $varName));
        }
        $configuration->{'set' . $configurationProperty}($value);
    }