Skip to content

Commit

Permalink
fix checks for loop iteration count
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Mar 9, 2022
1 parent 80e8b14 commit 913427e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Core/Executor/LoopExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function execute(MigrationStep $step)
protected function loopRepeat($dsl, $context)
{
$repeat = $this->referenceResolver->resolveReference($dsl['repeat']);
if (!ctype_digit($repeat) || $repeat < 0) {
throw new InvalidStepDefinitionException("Invalid step definition: 'repeat' is not a positive integer");
if ((!is_int($repeat) && !ctype_digit($repeat)) || $repeat < 0) {
throw new InvalidStepDefinitionException("Invalid step definition: '$repeat' is not a positive integer");
}

$stepExecutors = $this->validateSteps($dsl);
Expand Down

0 comments on commit 913427e

Please sign in to comment.