aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser/ParserTestParserHook.php
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@cscott.net>2022-09-15 09:03:07 -0400
committerC. Scott Ananian <cscott@cscott.net>2022-09-19 23:44:56 -0400
commit398e86f7c787e10bc745b9a72c4961b9edf5453a (patch)
treed37ec032874d9fedbe14304293edec11d04ac6e5 /tests/parser/ParserTestParserHook.php
parente31f436a21f522c8551cb6090a1e365823e43c32 (diff)
downloadmediawikicore-398e86f7c787e10bc745b9a72c4961b9edf5453a.tar.gz
mediawikicore-398e86f7c787e10bc745b9a72c4961b9edf5453a.zip
Make private deprecated public properties of Parser
This prepares for a split of the parser class. These properties were deprecated for public use in 1.35. Some adjustments to phan annotations were necessary, as phan seems to have a stronger analysis of the Parser class after this patch. Bug: T236810 Bug: T236812 Change-Id: I66ad07d004a081096edec641141e787fc2cc0958
Diffstat (limited to 'tests/parser/ParserTestParserHook.php')
-rw-r--r--tests/parser/ParserTestParserHook.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/parser/ParserTestParserHook.php b/tests/parser/ParserTestParserHook.php
index 05b7a73109e3..a77915053d47 100644
--- a/tests/parser/ParserTestParserHook.php
+++ b/tests/parser/ParserTestParserHook.php
@@ -43,6 +43,14 @@ class ParserTestParserHook {
"</pre>";
}
+ /**
+ * @param string $in
+ * @param array $argv
+ * @param Parser $parser
+ * @return string
+ * @suppress PhanUndeclaredProperty static_tag_buf is deliberately dynamic
+ * @suppress SecurityCheck-XSS
+ */
public static function staticTagHook( $in, $argv, $parser ) {
if ( !count( $argv ) ) {
$parser->static_tag_buf = $in;
@@ -53,10 +61,8 @@ class ParserTestParserHook {
// Clear the buffer, we probably don't need to
$tmp = $parser->static_tag_buf ?? '';
$parser->static_tag_buf = null;
- // @phan-suppress-next-line SecurityCheck-XSS
return $tmp;
} else { // wtf?
- // @phan-suppress-next-line SecurityCheck-XSS
return "\nCall this extension as <statictag>string</statictag> or as" .
" <statictag action=flush/>, not in any other way.\n" .
"text: " . var_export( $in, true ) . "\n" .