Add Id::for(string-class): callable(string): Id
shortcut
#21
Labels
enhancement
New feature or request
Id::for(string-class): callable(string): Id
shortcut
#21
When wrapping a string id from outside of the app (user input or external service) to an
Id
the methodId::of(MyAggregate::class, $id)
is used and it's enough.However when wrapping a
Set
/Sequence
of ids then the call has to be made inside amap
resulting in the notation$set->map(static fn(string $id) => Id::of(MyAggregate::class, $id))
which is a bit verbose.By introducing the method
Id::for(string-class): (callable(string): Id)
the map can be written as$set->map(Id::of(MyAggregate::class))
.The text was updated successfully, but these errors were encountered: