Skip to content

Commit

Permalink
Fix CS
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Mar 7, 2024
1 parent 9fc0da0 commit 781ae3c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Command/FixtureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,18 +430,17 @@ protected function _generateRecords(TableSchemaInterface $table, int $recordCoun
$class = $dbType->getEnumClassName();
$reflectionEnum = new ReflectionEnum($class);
$backingType = (string)$reflectionEnum->getBackingType();
$isInt = $backingType === 'int';

if ($fieldInfo['default'] !== null) {
$insert = $fieldInfo['default'];
if ($isInt) {
if ($backingType === 'int') {
$insert = (int)$insert;
}
} else {
$cases = $reflectionEnum->getCases();
$firstCase = array_shift($cases);

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

View check run for this annotation

Codecov / codecov/patch

src/Command/FixtureCommand.php#L440-L441

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

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

View check run for this annotation

Codecov / codecov/patch

src/Command/FixtureCommand.php#L443-L444

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

0 comments on commit 781ae3c

Please sign in to comment.