/**
* Returns file last commit infos
*
* @param string $fileName
* @param bool $useCache
* @return mixed
* @throws gitHubException
*/
public function getFileLastCommit($fileName, $useCache = TRUE)
{
if (!$useCache) {
$this->cache->remove($fileName);
}
return $this->cache->load($fileName, function () use($fileName) {
$path = $this->subdir ? $this->subdir . '/' : '';
$url = self::GITHUB_URL . '/' . $this->user . '/' . $this->repo . '/commits?path=' . $path . $fileName;
$tree = $this->run($url);
return count($tree) === 0 ? NULL : $tree[0];
});
}