6 public static function contains($hay, $needle) {
7 return strpos($hay,
"$needle") !==
false;
11 return substr($hay, 0, strlen($needle)) === $needle;
14 public static function endswith($hay, $needle) {
15 return substr($hay, - strlen($needle)) === $needle;
19 return (! isset($s) || NULL === $s ||
"" === $s);
23 return (isset($s) && NULL !== $s &&
"" !== $s);
27 return \is_bool($value) || $value == 1 || $value == 0;
31 return $value == 1 || $value;
35 return $value == 0 || ! $value;
39 return strtolower(preg_replace(
'/(?<!^)[A-Z]/', $separator .
'$0', $input));
43 $from =
'/\A' . preg_quote($from,
'/') .
'/';
44 return \preg_replace($from, $to, $subject, 1);
48 $from =
'/' . preg_quote($from,
'/') .
'\z/';
49 return \preg_replace($from, $to, $subject, 1);
60 $_before = \preg_quote($before);
61 $_after = \preg_quote($after);
62 if (\preg_match(
'/' . $_before .
'(.*?)' . $_after .
'/s', $str, $matches) === 1) {
63 $result = $matches[1];
64 $str = \str_replace($before . $result . $after,
"", $str);
70 if (\is_string($value))
71 return \str_replace(
"\\",
"\\\\", $value);
76 return \preg_replace(
'/[^a-zA-Z0-9\-\_]/s',
'', $id);
static isBooleanTrue($value)
static startswith($hay, $needle)
static cleanIdentifier($id)
static getValueBetween(&$str, $before="{{", $after="}}")
static replaceAtFirstAndLast($subject, $fromFirst, $toFirst, $fromLast, $toLast)
static doubleBackSlashes($value)
static replaceAtFirst($subject, $from, $to)
static isBooleanFalse($value)
static endswith($hay, $needle)
static camelCaseToSeparated($input, $separator=" ")
static replaceAtLast($subject, $from, $to)
static contains($hay, $needle)