danielstjules / Stringy

A PHP string manipulation library with multibyte support
MIT License
2.46k stars 216 forks source link

Add toString() method #199

Closed simPod closed 5 years ago

simPod commented 5 years ago

I like to work with my objects in clean OOP way and therefore also trying to avoid using magic methods as __toString().

So I added toString() method so the API is nicer, more fluent and expressive

- (string) Stringy::create($name)->camelize();
+ Stringy::create($name)->camelize()->toString();
voku commented 5 years ago

In my fork there is already the "toString" method: https://github.com/voku/Stringy#tostring

... maybe you give it a try. :)

simPod commented 5 years ago

@voku Thanks! I'd prefer to use original repo tho if possible. However, it seems it's not maintained anymore :/