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

Closed
opened 2026-09-03 17:18:33 +02:00 by c.fahner · 1 comment
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.
Author
Owner

No longer relevant due to #61.

No longer relevant due to #61.
c.fahner 2026-09-17 07:43:27 +02:00
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.