From ccc2e44affe8f5526eada76e82ed83eedd281c86 Mon Sep 17 00:00:00 2001 From: Pascal Chevrel Date: Tue, 14 Mar 2023 17:57:54 +0100 Subject: [PATCH] Suppress a warning when the cf_status_firefox field is not set for a bug --- src/pchevrel/BzKarma/Scoring.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/pchevrel/BzKarma/Scoring.php b/src/pchevrel/BzKarma/Scoring.php index c963e38..ddb6e3a 100644 --- a/src/pchevrel/BzKarma/Scoring.php +++ b/src/pchevrel/BzKarma/Scoring.php @@ -146,22 +146,25 @@ public function getBugScoreDetails(int $bug): array return $this->zeroBugScore(); } - /* - Beta and release are not affected, not a candidate for uplifting - */ - if (in_array($this->bugsData[$bug]['cf_status_firefox' . $this->beta], ['unaffected', 'disabled']) - && in_array($this->bugsData[$bug]['cf_status_firefox' . $this->release], ['unaffected', 'disabled'])) { - return $this->zeroBugScore(); - } - - if ($this->nightlyScoreOnly === false) { + if (array_key_exists('cf_status_firefox' . $this->beta, $this->bugsData[$bug]) + && array_key_exists('cf_status_firefox' . $this->beta, $this->bugsData[$bug])) { /* - Bug already uplifted, uplift value is 0 + Beta and release are not affected, not a candidate for uplifting */ - if (in_array($this->bugsData[$bug]['cf_status_firefox' . $this->beta], ['fixed', 'verified']) - && in_array($this->bugsData[$bug]['cf_status_firefox' . $this->release], ['fixed', 'verified', 'unaffected'])) { + if (in_array($this->bugsData[$bug]['cf_status_firefox' . $this->beta], ['unaffected', 'disabled']) + && in_array($this->bugsData[$bug]['cf_status_firefox' . $this->release], ['unaffected', 'disabled'])) { return $this->zeroBugScore(); } + + if ($this->nightlyScoreOnly === false) { + /* + Bug already uplifted, uplift value is 0 + */ + if (in_array($this->bugsData[$bug]['cf_status_firefox' . $this->beta], ['fixed', 'verified']) + && in_array($this->bugsData[$bug]['cf_status_firefox' . $this->release], ['fixed', 'verified', 'unaffected'])) { + return $this->zeroBugScore(); + } + } } /*