Skip to content

Commit 46412e3

Browse files
authored
Merge pull request #1 from MathisBurger/entity-default-value
Fixed pipeline errors
2 parents b561073 + 68724a4 commit 46412e3

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/DefaultValueValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ public static function validateBoolean(mixed $value): bool
6060
if (\in_array($value, ['true', 'false'])) {
6161
return 'true' === $value;
6262
}
63-
throw new RuntimeCommandException(sprintf('Value %s is invalid for type boolean', $value));
63+
throw new RuntimeCommandException(\sprintf('Value %s is invalid for type boolean', $value));
6464
}
6565

6666
public static function validateFloat(mixed $value): float
6767
{
6868
if (is_numeric($value)) {
6969
return (float) $value;
7070
}
71-
throw new RuntimeCommandException(sprintf('Value %s is invalid for type float', $value));
71+
throw new RuntimeCommandException(\sprintf('Value %s is invalid for type float', $value));
7272
}
7373

7474
public static function validateInt(mixed $value): int
@@ -81,6 +81,6 @@ public static function validateInt(mixed $value): int
8181
return $val;
8282
}
8383
}
84-
throw new RuntimeCommandException(sprintf('Value %s is invalid for type int', $value));
84+
throw new RuntimeCommandException(\sprintf('Value %s is invalid for type int', $value));
8585
}
8686
}

src/Util/ClassSource/Model/ClassProperty.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public static function createFromObject(FieldMapping|array $data): self
8080
precision: $data->precision,
8181
scale: $data->scale,
8282
unique: $data->unique ?? false,
83-
defaultValue: $data->defaultValue ?? null
83+
defaultValue: $data->defaultValue ?? null,
8484
enumType: $data->enumType,
8585
);
8686
}
@@ -101,7 +101,7 @@ enumType: $data->enumType,
101101
precision: $data['precision'] ?? null,
102102
scale: $data['scale'] ?? null,
103103
unique: $data['unique'] ?? false,
104-
defaultValue: $data['defaultValue'] ?? null
104+
defaultValue: $data['defaultValue'] ?? null,
105105
enumType: $data['enumType'] ?? null,
106106
);
107107
}

tests/Maker/MakeEntityTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,8 @@ public function getTestDetails(): \Generator
738738
'',
739739
// nullable
740740
'y',
741+
// no default value
742+
'',
741743
// finish adding fields
742744
'',
743745
]);

0 commit comments

Comments
 (0)