Ejemplo n.º 1
0
 /**
  * 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));
 }
Ejemplo n.º 2
0
 /**
  * @dataProvider repositoryNames
  */
 public function testGetName($path, $expected)
 {
     $repo = new Repository($path, $this->client);
     $this->assertEquals($expected, $repo->getName(), 'Returned incorrect repository name');
 }
Ejemplo n.º 3
0
 /**
  * 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;
     }
 }