Get the last year of commit activity data

@link https://developer.github.com/v3/repos/statistics/#commit-activity
@return array
972880
public function getCommitActivity(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/stats/commit_activity',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()));
    }
678533
protected function getPersistent()
    {
        $values = [];
        if ($this->getSessionStorage()->has('filter')) {
            $values = $this->getSessionStorage()->get('filter');
        }

        if (\array_key_exists($this->getEnvironment()->getDataDefinition()->getName(), $values)) {
            $values = $values[$this->getEnvironment()->getDataDefinition()->getName()];

            if (\array_key_exists($this->getPropertyName(), $values)) {
                return $values[$this->getPropertyName()];
            }
        }

        return null;
    }
1254428
public function getGitVersion()
    {
        try {
            return $this->getGitTag();
        } catch (RuntimeException $exception) {
            try {
                return $this->getGitHash(true);
            } catch (RuntimeException $exception) {
                throw new RuntimeException(
                    sprintf(
                        'The tag or commit hash could not be retrieved from "%s": %s',
                        dirname($this->file),
                        $exception->getMessage()
                    ),
                    0,
                    $exception
                );
            }
        }
    }
1308123
private function getActualLastModifiedTime()
    {
        if (empty($this->objectList)) return;

        foreach ($this->objectList as $object) {
            $modifiedTime = $object->getLastModifiedTimestamp();

            if (!empty($modifiedTime) && $modifiedTime > $this->lastModifiedTime) {
                $this->lastModifiedTime = $modifiedTime;
            }
        }
    }
704589
public function get_activities_list() {
        $activities = array();

        // For site just return site errors option.
        $sitecontext = context_system::instance();
        if ($this->course->id == SITEID && has_capability('report/log:view', $sitecontext)) {
            $activities["site_errors"] = get_string("siteerrors");
            return $activities;
        }

        $modinfo = get_fast_modinfo($this->course);
        if (!empty($modinfo->cms)) {
            $section = 0;
            $thissection = array();
            foreach ($modinfo->cms as $cm) {
                if (!$cm->uservisible || !$cm->has_view()) {
                    continue;
                }
                if ($cm->sectionnum > 0 and $section <> $cm->sectionnum) {
                    $activities[] = $thissection;
                    $thissection = array();
                }
                $section = $cm->sectionnum;
                $modname = strip_tags($cm->get_formatted_name());
                if (core_text::strlen($modname) > 55) {
                    $modname = core_text::substr($modname, 0, 50)."...";
                }
                if (!$cm->visible) {
                    $modname = "(".$modname.")";
                }
                $key = get_section_name($this->course, $cm->sectionnum);
                if (!isset($thissection[$key])) {
                    $thissection[$key] = array();
                }
                $thissection[$key][$cm->id] = $modname;
            }
            if (!empty($thissection)) {
                $activities[] = $thissection;
            }
        }
        return $activities;
    }
668487
public function getLastSequenceNumber()
    {
        if (count($this->events) === 0) {
            return $this->lastCommittedSequenceNumber;
        }
        if ($this->lastSequenceNumber === null) {
            $event = end($this->events);
            $this->lastSequenceNumber = $event->getSequenceNumber();
        }
        return $this->lastSequenceNumber;
    }
237101
protected function get_legacy_logdata() {
        return array($this->courseid, 'scorm', 'userreportinteractions', 'report/userreportinteractions.php?id=' .
                $this->contextinstanceid . '&user=' . $this->relateduserid . '&attempt=' . $this->other['attemptid'],
                $this->other['instanceid'], $this->contextinstanceid);
    }
143158
protected function get_activity() {
        if ($this->activity === false) {
            $this->activity = $this->reorder_activities();
        }
        return $this->activity;
    }
639106
public function getSnapshotData() {
        if($this->isAfterSave() && method_exists($this->getEntity(), 'getOldSnapshotData')) {
            $data = $this->getEntity()->getOldSnapshotData();
        } else { //Legacy
            $data = $this->getEntity()->getSnapshotData();
        }
        if(is_null($data)) {
            $data = [];
        }
        return $data;
    }
841273
public function last ()
	{
		if (!is_array($this->data)) return $this->data;
		if (!count($this->data)) return null;
		end($this->data);
		return $this->data[key($this->data)];
	}
1335794
public function getLongVersion()
    {
        $version = explode('-', $this->getVersion());
        $commit = "({$version[1]})";

        return trim(
            sprintf(
                '%s <info>%s</info> by <comment>Andres Gutierrez</comment> and <comment>Serghei Iakovlev</comment> %s',
                $this->getName(),
                $version[0],
                $commit
            )
        );
    }
1118691
public function get_activities() {
        $modinfo = get_fast_modinfo($this->course);
        $result = array();
        foreach ($modinfo->get_cms() as $cm) {
            if ($cm->completion != COMPLETION_TRACKING_NONE && !$cm->deletioninprogress) {
                $result[$cm->id] = $cm;
            }
        }
        return $result;
    }
1207869
protected function getLastMonth() {
        if (!$this->_lastMonth) {
            $this->_lastMonth = new LastMonthList($this->version, $this->solution['accountSid']);
        }

        return $this->_lastMonth;
    }
693971
protected function get_legacy_logdata() {
        $chapter = $this->get_record_snapshot('book_chapters', $this->objectid);
        return array($this->courseid, 'book', 'update', 'view.php?id='.$this->contextinstanceid, $chapter->bookid, $this->contextinstanceid);
    }
894907
public function getActiveRecommItems()
    {
        if ($this->_oActiveRecommItems === null) {
            $this->_oActiveRecommItems = false;
            if ($oActiveRecommList = $this->getActiveRecommList()) {
                // sets active page
                $iActPage = (int) \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('pgNr');
                $iActPage = ($iActPage < 0) ? 0 : $iActPage;

                // load only lists which we show on screen
                $iNrofCatArticles = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('iNrofCatArticles');
                $iNrofCatArticles = $iNrofCatArticles ? $iNrofCatArticles : 10;

                $oList = $oActiveRecommList->getArticles($iNrofCatArticles * $iActPage, $iNrofCatArticles);

                if ($oList && $oList->count()) {
                    foreach ($oList as $oItem) {
                        $oItem->text = $oActiveRecommList->getArtDescription($oItem->getId());
                    }
                    $this->_oActiveRecommItems = $oList;
                }
            }
        }

        return $this->_oActiveRecommItems;
    }
1274565
public function getFiscalYears()
  {
    $fiscalYears = array();

    $this->FiscalYear->byOrganization($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($FiscalYear) use (&$fiscalYears)
    {
      array_push($fiscalYears, $FiscalYear->year);
    });

    return $fiscalYears;
  }
111265
public function committedVersion(): ?int
    {
        if ($this->committedVersion === null) {
            $this->committedVersion = $this->eventCollection()->committedSequence();
        }

        return $this->committedVersion;
    }