Rewrite Term class

- Move term type constants from TERM_* to Term::*
- Move term object type constants from TERM_OBJ_* to Term::OBJECT_TYPE_*
- Add Term::isType() method
- Add Strings::startsWith()  method
This commit is contained in:
Hypolite Petovan 2019-02-22 19:15:35 -05:00
parent cd53585101
commit 1917f04153
3 changed files with 209 additions and 108 deletions

View file

@ -331,4 +331,19 @@ class Strings
return $uri;
}
/**
* Check if the trimmed provided string is starting with one of the provided characters
*
* @param string $string
* @param array $chars
* @return bool
*/
public static function startsWith($string, array $chars)
{
$return = in_array(substr(trim($string), 0, 1), $chars);
return $return;
}
}