10 #[\AllowDynamicProperties] 23 public static function endsWith($haystack, $needle)
49 return Regex::matchAll($patt, $this->raw,
$offset);
56 array_keys($replacements),
57 array_values($replacements),
66 $this->raw = preg_replace(
67 array_keys($replacements),
68 array_values($replacements),
76 $this->raw = preg_replace_callback($patt, $callback, $this->raw);
82 $this->raw .= $append;
88 $this->raw = $prepend . $this->raw;
100 $this->raw =
trim($this->raw);
106 $this->raw =
rtrim($this->raw);
112 $this->raw = ltrim($this->raw);
116 public function restore($types, $release =
false, $callback = null)
118 $this->raw = Crush::$process->tokens->restore($this->raw, $types, $release, $callback);
125 if (is_array($directive)) {
126 $directive =
'(?:' .
implode(
'|', $directive) .
')';
131 'lowercase_keys' =>
true,
132 'ignore_directives' =>
true,
137 if ($parse_options[
'singles']) {
138 $patt = Regex::make(
'~@(?i)' . $directive .
'(?-i)(?:\s*{{ block }}|\s+(?<name>{{ ident }})\s+(?<value>[^;]+)\s*;)~S');
141 $patt = Regex::make(
'~@(?i)' . $directive .
'(?-i)\s*{{ block }}~S');
144 $captured_directives = [];
145 $this->pregReplaceCallback($patt,
function ($m) use (&$captured_directives, $parse_options) {
146 if (isset($m[
'name'])) {
147 $name = $parse_options[
'lowercase_keys'] ? strtolower($m[
'name']) : $m[
'name'];
148 $captured_directives[
$name] = $m[
'value'];
151 $captured_directives = DeclarationList::parse($m[
'block_content'], $parse_options) + $captured_directives;
156 return $captured_directives;
restore($types, $release=false, $callback=null)
captureDirectives($directive, $parse_options=[])
if(!$user||!$user->canDelete()) $name
if(!$item instanceof\ElggEntity) $length
matchAll($patt, $offset=0)
pregReplaceHash($replacements)
Balanced bracket matching on string objects.
foreach($notification_settings as $purpose=> $prefered_methods) if((bool) elgg_get_config('enable_delayed_email')) $start
replaceHash($replacements)
pregReplaceCallback($patt, $callback)
substr($start, $length=null)
static endsWith($haystack, $needle)
splice($replacement, $offset, $length=null)