Field::$defaultValue should only allow insertable types #37

Open
opened 2026-09-03 17:18:33 +02:00 by c.fahner · 0 comments
Owner

Currently the $defaultValue property of Schema\Field has a mixed type hint, however not every type can be inserted.

The type hint should be changed to string|float|int|bool|null. Perhaps in the future array could also be allowed as a default for JSON fields.

An exception should be thrown if the given default is not compatible with the storage class of the fields' type.

Currently the `$defaultValue` property of `Schema\Field` has a `mixed` type hint, however not every type can be inserted. The type hint should be changed to `string|float|int|bool|null`. Perhaps in the future `array` could also be allowed as a default for `JSON` fields. An exception should be thrown if the given default is not compatible with the storage class of the fields' type.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
slendium/ocd#37
No description provided.