private function show() { $width = 25; $progress = round($this->step / $this->totalSteps * $width); $left = $width - $progress; $percentage = round($this->step / $this->totalSteps * 100.0); Out::writeSticky('[' . str_repeat('#', $progress) . str_repeat('.', $left) . '] ' . $percentage . '% ' . $this->text); if ($this->step >= $this->totalSteps) { Out::writeSticky(''); } }
/** * Runs all combinations and returns results grouped by method name. * * @return UnitResult */ public function run() { $this->result = new UnitResult(); Out::writeLine('Unit: ' . $this->getName()); foreach ($this->methods as $method) { $this->fetchMethodResults($method); } $this->sortByMethodScore(); return $this->result; }
/** * @param $data */ private function render($data) { $outputDir = $this->config['output_dir']; if (!is_dir($outputDir)) { mkdir($outputDir, 0777, true); } $path = Path::join($outputDir, 'index.html'); Out::writeLine('Saving HTML report to ' . $path); $html = $this->twig->render('report.twig', $data); file_put_contents($path, $html); }