getDaysSinceLastCommit() public method

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