コード例 #1
0
ファイル: Unit.php プロジェクト: nochso/benchmark
 /**
  * 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;
 }
コード例 #2
0
ファイル: Report.php プロジェクト: nochso/benchmark
 /**
  * @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);
 }