Open dpi opened 22 hours ago
An iterable collection (Weakmap or SplObjectStorage) cannot have objects and strings as keys simultaneously, so default values could be iterable values. Another object is required to capture whether the slot needs a default value. This object should also be an attribute which can be used on the [#Slots]
entry point in order for it to become a explicit opt in of parameters to slots. Where at least one parameter having this attribute forces the opt in.
Currently only reflection is supported.
Instead we should support an iterable parameter on
#[Slots]
, which may take enums or strings, alongside default values.E.g