krakjoe / ustring

UnicodeString for PHP7
Other
64 stars 7 forks source link

Change "Iterable" interface to "Traversable" #16

Closed Rican7 closed 9 years ago

Rican7 commented 9 years ago

The interface originally implemented in the UString class documented in the README.md file was an invalid "Iterable" interface.

PHP has no "Iterable" interface, however a "Traversable" interface does exist (and seems to have been the intended choice.

Rican7 commented 9 years ago

Also, I've noticed that the class was marked as abstract.

Understanding that this is just a class signature, with the method signatures defined without their actual bodies, I thought it was a strange way to document the class, as it makes it seem as if the class isn't directly instantiable itself.

Should the abstract keyword in the README.md class documentation also be removed?

hikari-no-yume commented 9 years ago

@Rican7 The reason it has abstract might be to represent the fact that the back-end can be changed. But yeah, that's kinda weird.

Rican7 commented 9 years ago

@TazeTSchnitzel that's what I was thinking at first, but the backend is something controlled by the C library/implementation compiled into PHP, is it not? The class' signature shouldn't change if the low-level implementation is changed.

hikari-no-yume commented 9 years ago

Yeah.

krakjoe commented 9 years ago

Agree, yeah, remove abstract too and then one of us will merge it ... thanks :)

Rican7 commented 9 years ago

Done.

Rican7 commented 9 years ago

Thanks for the merge!