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) 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 = ''; $branch = '';
foreach ($pull->labels as $label) foreach ($pull->labels as $label)
{
if (strtolower($label->name) === 'rtc')
{ {
if (strtolower($label->name) === 'rtc') $isRTC = true;
{ }
$isRTC = true; elseif (strpos($label->name, 'PR-') === 0)
} {
elseif (strpos($label->name, 'PR-') === 0) $branch = substr($label->name, 3);
{ }
$branch = substr($label->name, 3); elseif (in_array(
} strtolower($label->name),
elseif (in_array( ['npm resource changed', 'composer dependency changed'],
strtolower($label->name), true
['npm resource changed', 'composer dependency changed'], ))
true {
)) $isNPM = true;
{
$isNPM = true;
}
$labels[] = implode(
',',
[
(int) $pull->number,
$this->getDb()->quote($label->name),
$this->getDb()->quote($label->color),
]
);
} }
// Build the data object to store in the database $labels[] = implode(
$pullData = [ ',',
(int) $pull->number, [
$this->getDb()->quote( (int) $pull->number,
HTMLHelper::_('string.truncate', $pull->title, 150) $this->getDb()->quote($label->name),
), $this->getDb()->quote($label->color),
$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); // 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 // If there are no pulls to insert then bail, assume we're finished