Skip to content

Commit

Permalink
Prevent runtime error.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Mar 11, 2024
1 parent 781ae3c commit 73a281e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Command/FixtureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,10 +438,12 @@ protected function _generateRecords(TableSchemaInterface $table, int $recordCoun
}
} else {
$cases = $reflectionEnum->getCases();
$firstCase = array_shift($cases);
/** @var \BackedEnum $firstValue */
$firstValue = $firstCase->getValue();
$insert = $firstValue->value;
if ($cases) {
$firstCase = array_shift($cases);

Check warning on line 442 in src/Command/FixtureCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/FixtureCommand.php#L440-L442

Added lines #L440 - L442 were not covered by tests
/** @var \BackedEnum $firstValue */
$firstValue = $firstCase->getValue();
$insert = $firstValue->value;

Check warning on line 445 in src/Command/FixtureCommand.php

View check run for this annotation

Codecov / codecov/patch

src/Command/FixtureCommand.php#L444-L445

Added lines #L444 - L445 were not covered by tests
}
}
}
}
Expand Down

0 comments on commit 73a281e

Please sign in to comment.