Closed Insolita closed 5 years ago
So instead of
<?php
$labels = iterator_to_array($domain, false);
you would like
<?php
$labels = $domain->labels();
am I correct ?
yes - is more clear
I'll create the PR for that this evening it's easy to add I don't recall why this one was not added 🤔 . But I was not convince to add it back then. And also for resolving it is not really needed ... only iteration is needed maybe that's the reason 😄
but just like the new method this one won't be present in the interface after addition
when we need it - we are forced to make additional manipulations
Now I remember why this one was not added. The fact that DomainInterface
rendered having this method not so much needed. Do you have a simple scenario where the current API fell short 🤔 . For which the array representation would be superior ?
The current public API covers most of its use case. I'd say maybe adding a Domain::createfromIterable
would do but apart from that I have to wonder ?
I have no issue adding this method but these where the reason why the method was not added I believe at some point during the v5 development the method was present but was subsequently removed to avoid duplication.
Domain has methods for get Label by key, and for get key by label, but we can't get whole array with labels, and when we need it - we are forced to make additional manipulations