FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\Application\RepositoryApi Class Reference

Helper class to get the latest release and commits from GitHub API. More...

Collaboration diagram for Fossology\Lib\Application\RepositoryApi:
Collaboration graph

Public Member Functions

 __construct ($curlRequestService)
 
 getLatestRelease ()
 Get the latest release info from GitHub. More...
 
 getCommitsOfLastDays ($days=30)
 Get the commits from past n days. More...
 

Private Member Functions

 curlGet ($apiRequest)
 Send a curl request to apiRequest for resource. More...
 

Private Attributes

 $curlRequestService = null
 

Detailed Description

Helper class to get the latest release and commits from GitHub API.

Definition at line 17 of file RepositoryApi.php.

Constructor & Destructor Documentation

◆ __construct()

Fossology\Lib\Application\RepositoryApi::__construct (   $curlRequestService)

Constructor

Parameters
Fossology::Lib::Application::CurlRequestService$curlRequestService

Definition at line 29 of file RepositoryApi.php.

Member Function Documentation

◆ curlGet()

Fossology\Lib\Application\RepositoryApi::curlGet (   $apiRequest)
private

Send a curl request to apiRequest for resource.

Parameters
string$apiRequestRequired resource
Returns
array Response from GitHub API

Definition at line 39 of file RepositoryApi.php.

◆ getCommitsOfLastDays()

Fossology\Lib\Application\RepositoryApi::getCommitsOfLastDays (   $days = 30)

Get the commits from past n days.

Parameters
int$daysNumber of days commits are required.
Returns
array

Definition at line 77 of file RepositoryApi.php.

◆ getLatestRelease()

Fossology\Lib\Application\RepositoryApi::getLatestRelease ( )

Get the latest release info from GitHub.

Returns
array

Definition at line 67 of file RepositoryApi.php.

Member Data Documentation

◆ $curlRequestService

Fossology::Lib::Application::CurlRequestService Fossology\Lib\Application\RepositoryApi::$curlRequestService = null
private

Curl request service object for interation with GitHub API

Definition at line 23 of file RepositoryApi.php.


The documentation for this class was generated from the following file: