From 657ed77dd0226a876293b46e2d71966228787fda Mon Sep 17 00:00:00 2001 From: Giuseppe Mazzapica Date: Thu, 29 Aug 2024 10:14:13 +0200 Subject: [PATCH] Restructuring Package::hasReachedStatus() Co-authored-by: Thorsten Frommen Signed-off-by: Giuseppe Mazzapica --- src/Package.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Package.php b/src/Package.php index 5792e9e..2c6fbfa 100644 --- a/src/Package.php +++ b/src/Package.php @@ -653,11 +653,11 @@ public function hasFailed(): bool */ public function hasReachedStatus(int $status): bool { - if (!isset(self::SUCCESS_STATUSES[$status])) { + if ($this->hasFailed()) { return false; } - return !$this->hasFailed() && $this->checkStatus($status, '>='); + return isset(self::SUCCESS_STATUSES[$status]) && $this->checkStatus($status, '>='); } /**