Data definition with compound types #4

Open
opened 2026-07-27 14:58:24 +02:00 by c.fahner · 0 comments
Owner

Expand the type system created by #1 to include DateTimeInterface|iterable|array. Needs an attribute to declare the "value" type parameter for iterables and (associative) arrays.

Declaring the value type is optional, as the underlying data structure would just be JSON strings that can contain anything.

Also add them as cases to the StorageClass enumeration and make sure TypeInfo still reports the most appropriate storage class.

Specifically for DateTimeInterface types some helper methods should be added to the Predicate\DocumentShape class (and documented in its PHPDoc):

  • before(DateTimeInterface)
  • onOrBefore(DateTimeInterface)
  • after(DateTimeInterface)
  • onOrAfter(DateTimeInterface)

DateTimeInterface should also be added to the relevant Predicate\Expr variants.

Expand the type system created by #1 to include `DateTimeInterface|iterable|array`. Needs an attribute to declare the "value" type parameter for iterables and (associative) arrays. Declaring the value type is optional, as the underlying data structure would just be `JSON` strings that can contain anything. Also add them as cases to the `StorageClass` enumeration and make sure `TypeInfo` still reports the most appropriate storage class. Specifically for `DateTimeInterface` types some helper methods should be added to the `Predicate\DocumentShape` class (and documented in its PHPDoc): * `before(DateTimeInterface)` * `onOrBefore(DateTimeInterface)` * `after(DateTimeInterface)` * `onOrAfter(DateTimeInterface)` `DateTimeInterface` should also be added to the relevant `Predicate\Expr` variants.
c.fahner added this to the v0.2 milestone 2026-08-20 19:51:07 +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#4
No description provided.