Fix codestyle
This commit is contained in:
parent
8b9a3e8865
commit
220d75558a
|
@ -34,14 +34,14 @@ class PullsModel extends ListModel
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
protected $context;
|
protected $context;
|
||||||
/**
|
/**
|
||||||
* Array of fields the list can be sorted on
|
* Array of fields the list can be sorted on
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
* @since 2.0
|
* @since 2.0
|
||||||
*/
|
*/
|
||||||
protected $sortFields = array('pulls.pull_id', 'pulls.title');
|
protected $sortFields = array('pulls.pull_id', 'pulls.title');
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param array $config An optional associative array of configuration settings.
|
* @param array $config An optional associative array of configuration settings.
|
||||||
|
@ -155,9 +155,9 @@ class PullsModel extends ListModel
|
||||||
{
|
{
|
||||||
// Capture the last store id used.
|
// Capture the last store id used.
|
||||||
static $lastStoreId;
|
static $lastStoreId;
|
||||||
// Compute the current store id.
|
// Compute the current store id.
|
||||||
$currentStoreId = $this->getStoreId();
|
$currentStoreId = $this->getStoreId();
|
||||||
// If the last store id is different from the current, refresh the query.
|
// If the last store id is different from the current, refresh the query.
|
||||||
if ($lastStoreId != $currentStoreId || empty($this->query)) {
|
if ($lastStoreId != $currentStoreId || empty($this->query)) {
|
||||||
$lastStoreId = $currentStoreId;
|
$lastStoreId = $currentStoreId;
|
||||||
$this->query = $this->getListQuery();
|
$this->query = $this->getListQuery();
|
||||||
|
@ -293,7 +293,7 @@ class PullsModel extends ListModel
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// TODO - Option to configure the batch size
|
// TODO - Option to configure the batch size
|
||||||
$batchSize = 100;
|
$batchSize = 100;
|
||||||
$pullsResponse = Helper::initializeGithub()->getOpenPulls($this->getState()->get('github_user'), $this->getState()->get('github_repo'), $page, $batchSize);
|
$pullsResponse = Helper::initializeGithub()->getOpenPulls($this->getState()->get('github_user'), $this->getState()->get('github_repo'), $page, $batchSize);
|
||||||
$pulls = json_decode($pullsResponse->body);
|
$pulls = json_decode($pullsResponse->body);
|
||||||
|
@ -303,11 +303,11 @@ class PullsModel extends ListModel
|
||||||
|
|
||||||
// If this is page 1, let's check to see if we need to paginate
|
// If this is page 1, let's check to see if we need to paginate
|
||||||
if ($page === 1) {
|
if ($page === 1) {
|
||||||
// Default this to being a single page of results
|
// Default this to being a single page of results
|
||||||
$lastPage = 1;
|
$lastPage = 1;
|
||||||
if (isset($pullsResponse->headers['link'])) {
|
if (isset($pullsResponse->headers['link'])) {
|
||||||
$linkHeader = $pullsResponse->headers['link'];
|
$linkHeader = $pullsResponse->headers['link'];
|
||||||
// The `joomla/http` 2.0 package uses PSR-7 Responses which has a different format for headers, check for this
|
// The `joomla/http` 2.0 package uses PSR-7 Responses which has a different format for headers, check for this
|
||||||
if (is_array($linkHeader)) {
|
if (is_array($linkHeader)) {
|
||||||
$linkHeader = $linkHeader[0];
|
$linkHeader = $linkHeader[0];
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,7 @@ class PullsModel extends ListModel
|
||||||
$data = [];
|
$data = [];
|
||||||
$labels = [];
|
$labels = [];
|
||||||
foreach ($pulls as $pull) {
|
foreach ($pulls as $pull) {
|
||||||
// Check if this PR is RTC and has a `PR-` branch label
|
// Check if this PR is RTC and has a `PR-` branch label
|
||||||
$isRTC = false;
|
$isRTC = false;
|
||||||
$isNPM = false;
|
$isNPM = false;
|
||||||
$branch = $pull->base->ref;
|
$branch = $pull->base->ref;
|
||||||
|
|
Loading…
Reference in New Issue