44 '@phan-var PPFrame_Hash $parent';
51 $this->titleCache =
$parent->titleCache;
52 $this->titleCache[] = $pdbk;
53 $this->loopCheckHash =
$parent->loopCheckHash;
54 if ( $pdbk !==
false ) {
55 $this->loopCheckHash[$pdbk] =
true;
57 $this->depth =
$parent->depth + 1;
58 $this->numberedExpansionCache = $this->namedExpansionCache = [];
65 foreach (
$args as $name => $value ) {
71 $s .=
"\"$name\":\"" .
72 str_replace(
'"',
'\\"', $value->__toString() ) .
'"';
86 if ( isset( $this->parent->childExpansionCache[$key] ) ) {
87 return $this->parent->childExpansionCache[$key];
89 $retval = $this->
expand( $root, $flags );
91 $this->parent->childExpansionCache[$key] = $retval;
102 return !count( $this->numberedArgs ) && !count( $this->namedArgs );
110 foreach ( array_merge(
111 array_keys( $this->numberedArgs ),
112 array_keys( $this->namedArgs ) ) as $key ) {
123 foreach ( array_keys( $this->numberedArgs ) as $key ) {
134 foreach ( array_keys( $this->namedArgs ) as $key ) {
145 if ( !isset( $this->numberedArgs[$index] ) ) {
148 if ( !isset( $this->numberedExpansionCache[$index] ) ) {
149 # No trimming for unnamed arguments
150 $this->numberedExpansionCache[$index] = $this->parent->expand(
151 $this->numberedArgs[$index],
155 return $this->numberedExpansionCache[$index];
163 if ( !isset( $this->namedArgs[$name] ) ) {
166 if ( !isset( $this->namedExpansionCache[$name] ) ) {
167 # Trim named arguments post-expand, for backwards compatibility
168 $this->namedExpansionCache[$name] = trim(
171 return $this->namedExpansionCache[$name];
180 if ( $text ===
false ) {
196 parent::setVolatile( $flag );
197 $this->parent->setVolatile( $flag );
201 parent::setTTL(
$ttl );
202 $this->parent->setTTL(
$ttl );
An expansion frame, used as a context to expand the result of preprocessToObj()
Preprocessor $preprocessor
isVolatile()
Get the volatile flag.
Expansion frame with template arguments.
getNumberedArgument( $index)
setTTL( $ttl)
Set the TTL.
cachedExpand( $key, $root, $flags=0)
isEmpty()
Returns true if there are no arguments in this frame.
isTemplate()
Return true if the frame is a template frame.
setVolatile( $flag=true)
Set the volatile flag.
__construct( $preprocessor, $parent=false, $numberedArgs=[], $namedArgs=[], $title=false)
getPrefixedDBkey()
Get the prefixed database key form.