rossriley / php-scalar-objects

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

Class names (singular/plural) #7

Closed mnapoli closed 10 years ago

mnapoli commented 10 years ago

Current class names:

This is inconsistent, some are singular, some plurals.

I suggest the following naming:

rossriley commented 10 years ago

Hey. This is purely due to protected keywords. See: https://github.com/rossriley/php-scalar-objects/issues/1

mnapoli commented 10 years ago

Damn, I forgot about that. Would suffixing the names with something like ArrayHandler, or ArrayClass be a solution? At least it would be consistent, Arrays really makes no sense because it can be interpreted as "array of array".

rossriley commented 10 years ago

Yes, I agree. It's not crucial since when we make an RFC for this the classes will be implemented as native zend_class types just like the Spl... classes so I imagine we'll rename them something like ScalarStringHandler unless PHP core is going to implement namespaces for internal classes (which I doubt will happen).

However it'll be good to make the code sane in this project in the meantime, it will give us less hassle when we get it to RFC stage too.

rossriley commented 10 years ago

Fixed with: https://github.com/rossriley/php-scalar-objects/commit/260b2b3c15e29b7156fc40ee59ff618f606414d8