54 '@phan-var PPFrame_Hash $parent';
61 $this->titleCache =
$parent->titleCache;
62 $this->titleCache[] = $pdbk;
63 $this->loopCheckHash =
$parent->loopCheckHash;
64 if ( $pdbk !==
false ) {
65 $this->loopCheckHash[$pdbk] =
true;
67 $this->depth =
$parent->depth + 1;
68 $this->numberedExpansionCache = $this->namedExpansionCache = [];
75 foreach ( $args as $name => $value ) {
81 $s .=
"\"$name\":\"" .
82 str_replace(
'"',
'\\"', $value->__toString() ) .
'"';
96 if ( isset( $this->parent->childExpansionCache[$key] ) ) {
97 return $this->parent->childExpansionCache[$key];
99 $retval = $this->
expand( $root, $flags );
101 $this->parent->childExpansionCache[$key] = $retval;
112 return !count( $this->numberedArgs ) && !count( $this->namedArgs );
120 foreach ( array_merge(
121 array_keys( $this->numberedArgs ),
122 array_keys( $this->namedArgs ) ) as $key ) {
133 foreach ( array_keys( $this->numberedArgs ) as $key ) {
144 foreach ( array_keys( $this->namedArgs ) as $key ) {
155 if ( !isset( $this->numberedArgs[$index] ) ) {
158 if ( !isset( $this->numberedExpansionCache[$index] ) ) {
159 # No trimming for unnamed arguments
160 $this->numberedExpansionCache[$index] = $this->parent->expand(
161 $this->numberedArgs[$index],
165 return $this->numberedExpansionCache[$index];
173 if ( !isset( $this->namedArgs[$name] ) ) {
176 if ( !isset( $this->namedExpansionCache[$name] ) ) {
177 # Trim named arguments post-expand, for backwards compatibility
178 $this->namedExpansionCache[$name] = trim(
181 return $this->namedExpansionCache[$name];
190 if ( $text ===
false ) {
206 parent::setVolatile( $flag );
207 $this->parent->setVolatile( $flag );
211 parent::setTTL( $ttl );
212 $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)
cachedExpand( $key, $root, $flags=0)
array $numberedExpansionCache
isEmpty()
Returns true if there are no arguments in this frame.
array $namedExpansionCache
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)