rossriley / php-scalar-objects

Experimental API for PHP Scalar Objects
70 stars 6 forks source link

ArrayHandler and StringHandler interface #16

Open eborden opened 10 years ago

eborden commented 10 years ago

Arrays and Strings can share some common ground in implementation details. For in reality a string is just a list of characters. This means many Array methods would have common application on strings.

ArrayHandler and StringHandler should share a common interface of ArrayLikeInterface. I'll put together a pull request for illustration.

eborden commented 10 years ago

By unifying these two APIs with an interface we decrease complexity in the often common verbiage we use to affect strings and arrays. IE has/contains, count/length, etc.