Centipede\Console\Command\Run::execute PHP Method

execute() protected method

protected execute ( 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 execute(InputInterface $input, OutputInterface $output)
    {
        (new Crawler($input->getArgument('url'), $input->getArgument('depth')))->crawl(function ($url, ResponseInterface $response) use($output) {
            $tag = 'info';
            if (200 != $response->getStatusCode()) {
                $this->exitCode = 1;
                $tag = 'error';
            }
            $output->writeln(sprintf('<%s>%d</%s> %s', $tag, $response->getStatusCode(), $tag, $url));
        });
        return $this->exitCode;
    }