56 '@phan-var PPFrame_Hash $parent';
63 $this->titleCache =
$parent->titleCache;
64 $this->titleCache[] = $pdbk;
65 $this->loopCheckHash =
$parent->loopCheckHash;
66 if ( $pdbk !==
false ) {
67 $this->loopCheckHash[$pdbk] =
true;
69 $this->depth =
$parent->depth + 1;
70 $this->numberedExpansionCache = $this->namedExpansionCache = [];
77 foreach ( $args as $name => $value ) {
83 $s .=
"\"$name\":\"" .
84 str_replace(
'"',
'\\"', $value->__toString() ) .
'"';
97 if ( isset( $this->parent->childExpansionCache[$key] ) ) {
98 return $this->parent->childExpansionCache[$key];
100 $retval = $this->
expand( $root, $flags );
102 $this->parent->childExpansionCache[$key] = $retval;
113 return !count( $this->numberedArgs ) && !count( $this->namedArgs );
121 foreach ( array_merge(
122 array_keys( $this->numberedArgs ),
123 array_keys( $this->namedArgs ) ) as $key ) {
134 foreach ( $this->numberedArgs as $key => $_ ) {
145 foreach ( $this->namedArgs as $key => $_ ) {
156 if ( !isset( $this->numberedArgs[$index] ) ) {
159 if ( !isset( $this->numberedExpansionCache[$index] ) ) {
160 # No trimming for unnamed arguments
161 $this->numberedExpansionCache[$index] = $this->parent->expand(
162 $this->numberedArgs[$index],
166 return $this->numberedExpansionCache[$index];
174 if ( !isset( $this->namedArgs[$name] ) ) {
177 if ( !isset( $this->namedExpansionCache[$name] ) ) {
178 # Trim named arguments post-expand, for backwards compatibility
179 $this->namedExpansionCache[$name] = trim(
182 return $this->namedExpansionCache[$name];
191 if ( $text ===
false ) {
207 parent::setVolatile( $flag );
208 $this->parent->setVolatile( $flag );
212 parent::setTTL( $ttl );
213 $this->parent->setTTL( $ttl );
218class_alias( PPTemplateFrame_Hash::class,
'PPTemplateFrame_Hash' );