/** * Display an error message using red color on the console to make it * easier to spot. * * @param string $error * @returns RendererInterface */ public function error($error) { echo PHP_EOL; $this->console->writeLine('ERROR: ' . $error . PHP_EOL, Color::calculate('ff0000')); echo PHP_EOL; return $this; }
/** * @param $question * @param ConsoleAdapter $console * * @return string|null */ private function askUrlQuestion($question, ConsoleAdapter $console) { $console->writeLine($question . ' (URL)', ColorInterface::CYAN); $prompt = new Line(''); $prompt->setConsole($console); $url = $prompt->show(); if (!(new Uri(['allowRelative' => false]))->isValid($url)) { $console->writeLine('The provided URL "' . $url . '" doesn\'t seem to be valid!', ColorInterface::RED); return null; } return $url; }