Composer\Satis\Console\Command\InitCommand::interact PHP Method

interact() protected method

Interact with user
protected interact ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function interact(InputInterface $input, OutputInterface $output)
    {
        $this->prompt($input, $output, 'Repository name', 'name', function ($value) {
            if (!$value) {
                throw new \InvalidArgumentException('Repository name should not be empty');
            }
            return $value;
        });
        $this->prompt($input, $output, 'Home page', 'homepage', function ($value) {
            if (!preg_match('/https?:\\/\\/.+/', $value)) {
                throw new \InvalidArgumentException('Enter a valid URL it will be used for building your repository');
            }
            return $value;
        });
    }