krakjoe / ustring

UnicodeString for PHP7
Other
64 stars 7 forks source link

Replaced length function with virtual length property #14

Closed hikari-no-yume closed 9 years ago

datibbaw commented 9 years ago

Cool. Cool, cool, cool.

hikari-no-yume commented 9 years ago

Will this be merged? I could merge it myself, but...

datibbaw commented 9 years ago

Not sure; @krakjoe any concerns, comments?

hikari-no-yume commented 9 years ago

You're in favour and I'm in favour, it's only really @krakjoe I'm wondering about.

krakjoe commented 9 years ago

As mentioned the property docblock is in wrong place in readme ... when that's fixed, merge it ...

hikari-no-yume commented 9 years ago

@krakjoe It isn't in the wrong place, I checked. Properties defined with getters and setters are documented in the docblock above the class.

krakjoe commented 9 years ago

It's a public property isn't it ?

EDIT: wait, why haven't you declared the property ? it should be a declared public property, it's going to be a wtf moment to reflect on the class and see no obvious way to retrieve the length. I thought the point of this was to save the method call, that makes sense, it doesn't make sense to try and hide the fact that a UString has a length accessible via $ustring->length, does it ?

krakjoe commented 9 years ago

In addition, it doesn't make sense to prohibit the object from having properties, what about when a framework wants to extend the class, they are going to want/need the ability to have properties aren't they ?

Prohibit the length property from being unset or written, but do not stop other properties from being manipulated.

hikari-no-yume commented 9 years ago

@krakjoe OK, I fixed the issues you mentioned.