Closed gsteel closed 7 years ago
Thanks again @gsteel for your contribution!
What would be the use case of this?
In my case, I type hint against a slice fragment in view helpers so that helpers and views can be sure of what they are dealing with. As it's probable that the 'old' slice type will get deprecated, it's handy to maintain type safety where your repo may be sending you either type of slice…
So you want to support both in your code in case if the writer converts the old slice type to the new one?
Yes, in certain places, I want to be sure that I've got a slice - Say I have a helper that proxies different slices to different renderers/serializers based on the name of that slice - I want to be sure that whatever I'm proxying is 'Slice-Like' and leave it up the serializers to figure out whether the slice is composite or not.
Add SliceInterface to represent common traits of normal slices and composite slices.
Also added some missing properties to the Slice class declaration and type hinted FragmentInterface in the constructor.