/**
  * Add a redirect
  *
  * Creates a new custom redirect. The optional argument ``host`` is used to define a specific redirect only valid
  * for a certain domain If no ``host`` argument is supplied, the redirect will act as a fallback redirect for all
  * domains in use. If any redirect exists with the same ``source`` property, it will be replaced if the ``force``
  * property has been set.
  *
  * @param string $source The relative URI path that should trigger the redirect
  * @param string $target The relative URI path that the redirect should point to
  * @param integer $statusCode The status code of the redirect header
  * @param string $host (optional) The host the redirect is valid for. If none is set, the redirect is valid for all
  * @param boolean $force Replace existing redirect (based on the source URI)
  * @return void
  */
 public function addCommand($source, $target, $statusCode, $host = null, $force = false)
 {
     $this->outputLine();
     $this->outputLine('<b>Create a redirect ...</b>');
     $this->outputLine();
     $redirect = $this->redirectStorage->getOneBySourceUriPathAndHost($source, $host, false);
     $isSame = $this->isSame($source, $target, $host, $statusCode, $redirect);
     if ($redirect !== null && $isSame === false && $force === false) {
         $this->outputLine('A redirect with the same source URI exist, see below:');
         $this->outputLine();
         $this->outputRedirectLine('<error>!!</error>', $redirect);
         $this->outputLine();
         $this->outputLine('Use --force to replace it');
         $this->outputLine();
         $this->sendAndExit(1);
     } elseif ($redirect !== null && $isSame === false && $force === true) {
         $this->redirectStorage->removeOneBySourceUriPathAndHost($source, $host);
         $this->outputRedirectLine('<info>--</info>', $redirect);
         $this->persistenceManager->persistAll();
     } elseif ($redirect !== null && $isSame === true) {
         $this->outputRedirectLine('<comment>~~</comment>', $redirect);
         $this->outputLine();
         $this->outputLegend();
         $this->sendAndExit();
     }
     $redirects = $this->redirectStorage->addRedirect($source, $target, $statusCode, [$host]);
     $redirect = reset($redirects);
     $this->outputRedirectLine('<info>++</info>', $redirect);
     $this->outputLine();
     $this->outputLegend();
 }