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