function upload(string $coverage, Configuration $configuration = null): void {
    $report = trim($coverage);
    if (!mb_strlen($report)) throw new \InvalidArgumentException('The specified coverage report is empty.');

    $job = null;
    $isClover = mb_substr($report, 0, 5) == '<?xml' || mb_substr($report, 0, 10) == '<coverage';
    if ($isClover) $job = Clover::parseReport($report);
    else {
      $token = mb_substr($report, 0, 3);
      if ($token == 'TN:' || $token == 'SF:') $job = Lcov::parseReport($report);
    }

    if (!$job) throw new \InvalidArgumentException('The specified coverage format is not supported.');
    $this->updateJob($job, $configuration ?? Configuration::loadDefaults());
    if (!$job->getRunAt()) $job->setRunAt(new \DateTime);

    try {
      which('git');
      $git = GitData::fromRepository();
      $branch = ($gitData = $job->getGit()) ? $gitData->getBranch() : '';
      if ($git->getBranch() == 'HEAD' && mb_strlen($branch)) $git->setBranch($branch);
      $job->setGit($git);
    }

    catch (FinderException $e) {}
    $this->uploadJob($job);
  }