From 5395e91f60a9dc94ffbb47eb4d1d14b8a2a65511 Mon Sep 17 00:00:00 2001 From: Alex Toff Date: Sun, 30 Jul 2023 11:42:52 +0000 Subject: [PATCH] refactor: Make `next` and `previous` methods use instanced properties --- src/AIRACCycle.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AIRACCycle.php b/src/AIRACCycle.php index 3e4c92c..f14e69c 100644 --- a/src/AIRACCycle.php +++ b/src/AIRACCycle.php @@ -88,13 +88,13 @@ public static function current(): static /** Returns the next AIRAC cycle */ public static function next(): static { - return static::fromSerial(static::current()->getSerial() + 1); + return static::current()->nextCycle(); } /** Returns the previous AIRAC cycle */ public static function previous(): static { - return static::fromSerial(static::current()->getSerial() - 1); + return static::current()->previousCycle(); } /** Returns the serial of the AIRAC cycle at the given date. Whilst a float is always returned, note that this is an integer if exactly at an effective date, or a float otherwise*/