$headers, 'user_agent' => 'LBRY', 'json_response' => true, 'cache' => $cache === true ? $twoHoursInSeconds : $cache] ); } public static function listRoadmapItems($year, $cache = true) { $year = $year ?: date('Y'); $apiResponse = Config::get(Config::GITHUB_PERSONAL_AUTH_TOKEN) ? static::get('/repos/lbryio/internal-issues/issues?labels=' . $year . '&filter=all') : include ROOT_DIR . '/data/dummy/githubroadmap.php'; $issues = array_reduce($apiResponse, function ($issues, $issue) use ($year) { return array_merge($issues, [[ 'name' => $issue['title'], 'quarter_date' => array_reduce($issue['labels'], function ($carry, $label) use ($year) { if ($carry) { return $carry; } return $label['name'][0] === 'Q' ? ($label['name'] . ' ' . $year) : ''; }, ''), 'body' => $issue['body_html'] ]]); }, []); usort($issues, function ($a, $b) { if ($a['quarter_date'] === $b['quarter_date']) { return $a['name'] < $b['name'] ? -1 : 1; } return $a['quarter_date'] < $b['quarter_date'] ? -1 : 1; }); return $issues; } }