From e47f267415a66e7868b1d7be1a6b5c9d40d2107b Mon Sep 17 00:00:00 2001 From: Pascal Chevrel Date: Mon, 6 Mar 2023 15:11:11 +0100 Subject: [PATCH] Styling nits --- src/pchevrel/BzKarma/Scoring.php | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/pchevrel/BzKarma/Scoring.php b/src/pchevrel/BzKarma/Scoring.php index b7a9d01..09a00b8 100644 --- a/src/pchevrel/BzKarma/Scoring.php +++ b/src/pchevrel/BzKarma/Scoring.php @@ -80,13 +80,15 @@ class Scoring */ public array $bugsData; - + /* + We need Firefox release numbers internally, the release train is provided in the constructor. + */ private string $release; private string $beta; private string $nightly; - /** - * We work from a dataset provided by the Bugzilla rest API + /* + We work from a dataset provided by the Bugzilla rest API */ public function __construct(array $bugsData, int $release) { @@ -104,8 +106,7 @@ public function getAllBugsScores(): array $bugs[$bug] = $this->getBugScore($bug); } - // We sort them in reverse order to list best nugs first - arsort($bugs); + arsort($bugs); // We sort in reverse order to list best bugs first return $bugs; } @@ -127,9 +128,9 @@ public function getBugScoreDetails(int $bug): array 'duplicates' => 0, 'regressions' => 0, 'webcompat' => 0, - 'tracking_firefox'. $this->nightly => 0, - 'tracking_firefox'. $this->beta => 0, - 'tracking_firefox'. $this->release => 0, + 'tracking_firefox' . $this->nightly => 0, + 'tracking_firefox' . $this->beta => 0, + 'tracking_firefox' . $this->release => 0, ]; } @@ -168,16 +169,16 @@ public function getBugScoreDetails(int $bug): array 'priority' => $this->karma['priority'][$this->bugsData[$bug]['priority']] ?? 0, 'severity' => $this->karma['severity'][$this->bugsData[$bug]['severity']] ?? 0, 'keywords' => $keywords_value, - 'duplicates' => count($this->bugsData[$bug]['duplicates']) * $this->karma['duplicates'], + 'duplicates' => count($this->bugsData[$bug]['duplicates']) * $this->karma['duplicates'], 'regressions' => count($this->bugsData[$bug]['regressions']) * $this->karma['regressions'], 'webcompat' => $webcompat, /* - If a bug is tracked across all our releases, it is likely higher value + If a bug is tracked across all our releases, it is likely higher value. */ - 'tracking_firefox'. $this->nightly => $nightly, - 'tracking_firefox'. $this->beta => $beta, - 'tracking_firefox'. $this->release => $release, + 'tracking_firefox' . $this->nightly => $nightly, + 'tracking_firefox' . $this->beta => $beta, + 'tracking_firefox' . $this->release => $release, ]; return $impact; @@ -186,7 +187,4 @@ public function getBugScoreDetails(int $bug): array public function getBugScore(int $bug): int { return array_sum($this->getBugScoreDetails($bug)); } -} - - - +} \ No newline at end of file