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.
When I tried to extent the base Stringy class I've noticed some issues. These are:
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.