RSS Git Download  Clone
Raw View History
Blames found: 8 Mode: php Binary: false


Hang on, we reloading big blames...
<?php
namespace Gitter\Statistics; use Gitter\Util\Collection; use Gitter\Model\Commit\Commit; /** * Aggregate statistics based on contributor */ class Contributors extends Collection implements StatisticsInterface { /** * @param Commit $commit */ public function addCommit(Commit $commit) {
$email = $commit->getAuthor()->getEmail();
$commitDate = $commit->getCommiterDate()->format('Y-m-d'); if (!isset($this->items[$email])) { $this->items[$email] = new Collection; } $this->items[$email]->items[$commitDate][] = $commit; ksort($this->items[$email]->items); } public function sortCommits() {
uasort($this->items, function ($sortA, $sortB) {
if (count($sortA) === count($sortB)) { return 0; } return count($sortA) > count($sortB) ? -1 : 1; }); }
}