From 6fd519c1c6c54cc6b00bd28e330cbd9afbcf77b7 Mon Sep 17 00:00:00 2001 From: hguenot Date: Sat, 3 Sep 2022 08:02:29 +0200 Subject: [PATCH 1/2] Fix firstIncompleteStep when all step are done --- src/AbstractWizard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AbstractWizard.php b/src/AbstractWizard.php index 30881de..041a4d0 100644 --- a/src/AbstractWizard.php +++ b/src/AbstractWizard.php @@ -509,7 +509,7 @@ private function isLastStep(): bool private function firstIncompleteStep(): WizardStep { - return collect($this->availableSteps())->first(fn (WizardStep $step) => !$step->isComplete()); + return collect($this->availableSteps())->first(fn (WizardStep $step) => !$step->isComplete(), $this->steps[count($this->steps) - 1]); } /** From d7e05d082871e92038d32b4662c47492dd59f121 Mon Sep 17 00:00:00 2001 From: hguenot Date: Sun, 4 Sep 2022 09:19:16 +0200 Subject: [PATCH 2/2] Fix phpstan false positive typehinting error --- phpstan-baseline.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f1ab7fd..98e1ea1 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -6,7 +6,7 @@ parameters: path: src/AbstractWizard.php - - message: "#^Method Arcanist\\\\AbstractWizard\\:\\:firstIncompleteStep\\(\\) should return Arcanist\\\\WizardStep but returns Arcanist\\\\WizardStep\\|null\\.$#" + message: "#^Method Arcanist\\\\AbstractWizard\\:\\:firstIncompleteStep\\(\\) should return Arcanist\\\\WizardStep but returns mixed\\.$#" count: 1 path: src/AbstractWizard.php