- gitlist.git
- src
- Gitter
- Statistics
- Hour.php
This file ( 485B ) exceeds the allowed full mode (48 kb) size.
The editor full hight is disabled, only scrolling is allowed..
If you wish to edit a file, it is recommended to use the scroll mode as some users do not like the full height
mode, although some users like it.
<?php
namespace Gitter\Statistics;
use Gitter\Util\Collection;
use Gitter\Model\Commit\Commit;
/**
* Aggregate statistics based on hour
*/
class Hour extends Collection implements StatisticsInterface
{
/**
* @param Commit $commit
*/
public function addCommit(Commit $commit)
{
$hour = $commit->getCommiterDate()->format('H');
$this->items[$hour][] = $commit;
}
public function sortCommits()
{
ksort($this->items);
}
}