From f8a02ecf697138f80e2ee9389f4bb83d5b892471 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Sat, 24 Sep 2022 13:51:01 +0100 Subject: [PATCH] Refactor else statment --- src/OnboardingSteps.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/OnboardingSteps.php b/src/OnboardingSteps.php index 18f8069..09369c0 100644 --- a/src/OnboardingSteps.php +++ b/src/OnboardingSteps.php @@ -15,12 +15,10 @@ public function addStep(string $title, string $model = null): OnboardingStep $step = new OnboardingStep($title); if ($model && new $model() instanceof Onboardable) { - $this->steps[$model][] = $step; - } else { - $this->steps['default'][] = $step; + return $this->steps[$model][] = $step; } - return $step; + return $this->steps['default'][] = $step; } public function steps(Onboardable $model): Collection