/** * Statistics for average commits per day * * @return array */ public function averageCommitsPerDay() { $commitsByDate = $this->statistics('date'); return array('title' => 'Average commits per day', 'value' => number_format(count($commitsByDate) / $this->repository->getTotalCommits(), 2)); }
/** * @dataProvider repositoryNames */ public function testGetName($path, $expected) { $repo = new Repository($path, $this->client); $this->assertEquals($expected, $repo->getName(), 'Returned incorrect repository name'); }
/** * Try to create repository from path * * @param str $path * @return false|Repository */ public function create($path, $includeStatistics = false) { try { $repository = new Repository($path); if ($includeStatistics === true) { $repository->addStatistics(array(new \Gitter\Statistics\Contributors(), new \Gitter\Statistics\Date(), new \Gitter\Statistics\Day(), new \Gitter\Statistics\Hour())); } return $repository; } catch (\Exception $e) { return false; } }