Fixed codestyle

Signed-off-by: Roland Dalmulder <contact@rolandd.com>
This commit is contained in:
Roland Dalmulder 2021-03-04 19:53:13 +01:00
parent ef98862329
commit d322461e6c
No known key found for this signature in database
GPG Key ID: FD49814C56AE3AF9
1 changed files with 45 additions and 45 deletions

View File

@ -573,56 +573,56 @@ class PullsModel extends AbstractModel
foreach ($pulls as $pull)
{
// Check if this PR is RTC and has a `PR-` branch label
$isRTC = false;
$isNPM = false;
$branch = '';
// Check if this PR is RTC and has a `PR-` branch label
$isRTC = false;
$isNPM = false;
$branch = '';
foreach ($pull->labels as $label)
foreach ($pull->labels as $label)
{
if (strtolower($label->name) === 'rtc')
{
if (strtolower($label->name) === 'rtc')
{
$isRTC = true;
}
elseif (strpos($label->name, 'PR-') === 0)
{
$branch = substr($label->name, 3);
}
elseif (in_array(
strtolower($label->name),
['npm resource changed', 'composer dependency changed'],
true
))
{
$isNPM = true;
}
$labels[] = implode(
',',
[
(int) $pull->number,
$this->getDb()->quote($label->name),
$this->getDb()->quote($label->color),
]
);
$isRTC = true;
}
elseif (strpos($label->name, 'PR-') === 0)
{
$branch = substr($label->name, 3);
}
elseif (in_array(
strtolower($label->name),
['npm resource changed', 'composer dependency changed'],
true
))
{
$isNPM = true;
}
// Build the data object to store in the database
$pullData = [
(int) $pull->number,
$this->getDb()->quote(
HTMLHelper::_('string.truncate', $pull->title, 150)
),
$this->getDb()->quote(
HTMLHelper::_('string.truncate', $pull->body, 100)
),
$this->getDb()->quote($pull->html_url),
(int) $isRTC,
(int) $isNPM,
$this->getDb()->quote($branch),
];
$labels[] = implode(
',',
[
(int) $pull->number,
$this->getDb()->quote($label->name),
$this->getDb()->quote($label->color),
]
);
}
$data[] = implode(',', $pullData);
// Build the data object to store in the database
$pullData = [
(int) $pull->number,
$this->getDb()->quote(
HTMLHelper::_('string.truncate', $pull->title, 150)
),
$this->getDb()->quote(
HTMLHelper::_('string.truncate', $pull->body, 100)
),
$this->getDb()->quote($pull->html_url),
(int) $isRTC,
(int) $isNPM,
$this->getDb()->quote($branch),
];
$data[] = implode(',', $pullData);
}
// If there are no pulls to insert then bail, assume we're finished