getDaysSinceLastCommit() public method

Returns the number of days elapsed since the last commit on the master branch
public getDaysSinceLastCommit ( ) : integer
return integer
Ejemplo n.º 1
0
 public function testGetDaysSinceLastCommit()
 {
     $bundle = new Bundle('knplabs/KnpMenuBundle');
     $bundle->setLastCommitAt(new \Datetime('-31 days'));
     $this->assertEquals(31, $bundle->getDaysSinceLastCommit());
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function updateScore(Bundle $bundle)
 {
     $bundle->addScoreDetail('activity', $bundle->getDaysSinceLastCommit() < 30 ? (30 - $bundle->getDaysSinceLastCommit()) / 5 : 0);
 }