Knp\Bundle\KnpBundlesBundle\Entity\Bundle::getDaysSinceLastCommit PHP Method

getDaysSinceLastCommit() public method

Returns the number of days elapsed since the last commit on the master branch
public getDaysSinceLastCommit ( ) : integer
return integer
    public function getDaysSinceLastCommit()
    {
        return date_create()->diff($this->lastCommitAt)->days;
    }

Usage Example

Example #1
0
 public function testGetDaysSinceLastCommit()
 {
     $bundle = new Bundle('knplabs/KnpMenuBundle');
     $bundle->setLastCommitAt(new \Datetime('-31 days'));
     $this->assertEquals(31, $bundle->getDaysSinceLastCommit());
 }
All Usage Examples Of Knp\Bundle\KnpBundlesBundle\Entity\Bundle::getDaysSinceLastCommit