danielstjules / Stringy

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

Extending Base Component #140

Closed heera closed 7 years ago

heera commented 8 years ago

When I tried to extent the base Stringy class I've noticed some issues. These are:

class StringyExtended extends Stringy {
    public function hasUpperCase()
    {
        // Match uppercase anywhere in the string
        $patternForUpperCase = ".*([[:upper:]])";
        return (bool) mb_ereg_match($patternForUpperCase, $this->str);
    }
}

I couldn't use Stringy::matchesPattern because it's a private method and the $str is also declared as private so consider these issues. Otherwise, it's a great library. Probably, protected would solve these issues but it's still possible other way.

danielstjules commented 7 years ago

Thanks! This has since been fixed :)