From 5f32bb6e1458d24de6bab202d11c1aede3bf4b79 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 11:07:23 -0600
Subject: [PATCH 01/15] Update LST.php
---
includes/LST.php | 67 ++++++++++++++++++++++++++++++++++++------------
1 file changed, 51 insertions(+), 16 deletions(-)
diff --git a/includes/LST.php b/includes/LST.php
index b82d6900..78069989 100644
--- a/includes/LST.php
+++ b/includes/LST.php
@@ -33,16 +33,17 @@
use Title;
class LST {
- # #############################################################
- # To do transclusion from an extension, we need to interact with the parser
- # at a low level. This is the general transclusion functionality
- ##############################################################
+
+ /*
+ * To do transclusion from an extension, we need to interact with the parser
+ * at a low level. This is the general transclusion functionality
+ */
/**
* Register what we're working on in the parser, so we don't fall into a trap.
*
* @param Parser $parser
- * @param $part1
+ * @param string $part1
* @return bool
*
* @suppress PhanUndeclaredProperty Use of Parser::mTemplatePath
@@ -64,7 +65,7 @@ public static function open( $parser, $part1 ) {
* Finish processing the function.
*
* @param Parser $parser
- * @param $part1
+ * @param string $part1
*
* @suppress PhanUndeclaredProperty Use of Parser::mTemplatePath
*/
@@ -80,6 +81,16 @@ public static function close( $parser, $part1 ) {
/**
* Handle recursive substitution here, so we can break cycles, and set up
* return values so that edit sections will resolve correctly.
+ *
+ * @param Parser $parser
+ * @param string $text
+ * @param string $part1
+ * @param int $skiphead
+ * @param bool $recursionCheck
+ * @param int $maxLength
+ * @param string $link
+ * @param bool $trim
+ * @param array $skipPattern
*/
private static function parse( $parser, $text, $part1, $skiphead = 0, $recursionCheck = true, $maxLength = -1, $link = '', $trim = false, $skipPattern = [] ) {
// if someone tries something like
@@ -112,11 +123,17 @@ private static function parse( $parser, $text, $part1, $skiphead = 0, $recursion
}
}
- ##############################################################
- # And now, the labeled section transclusion
- ##############################################################
+ /*
+ * And now, the labeled section transclusion
+ */
- // Generate a regex to match the section(s) we're interested in.
+ /**
+ * Generate a regex to match the section(s) we're interested in.
+ *
+ * @param string $sec
+ * @param string $to
+ * @param bool &$any
+ */
private static function createSectionPattern( $sec, $to, &$any ) {
$any = false;
$to_sec = ( $to == '' ) ? $sec : $to;
@@ -154,8 +171,8 @@ private static function createSectionPattern( $sec, $to, &$any ) {
* prevent wrong heading links.
*
* @param string $text
- * @param int $limit
- * @return int
+ * @param int $limit Cutoff point in the text to stop searching
+ * @return int Number of matches
*/
private static function countHeadings( $text, $limit ) {
$pat = '^(={1,6}).+\1\s*$()';
@@ -176,6 +193,16 @@ private static function countHeadings( $text, $limit ) {
return $count;
}
+ /**
+ * Fetches content of target page if valid and found, otherwise
+ * produces wikitext of a link to the target page.
+ *
+ * @param Parser $parser
+ * @param string $page title text of target page
+ * @param Title &$title normalized title object
+ * @param string &$text wikitext output
+ * @return bool true if returning text, false if target not found
+ */
public static function text( $parser, $page, &$title, &$text ) {
$title = Title::newFromText( $page );
@@ -195,7 +222,15 @@ public static function text( $parser, $page, &$title, &$text ) {
}
}
- // section inclusion - include all matching sections
+ /**
+ * section inclusion - include all matching sections
+ *
+ * @param Parser $parser
+ * @param string $page
+ * @param string $sec
+ * @param string $to
+ * @return array
+ */
public static function includeSection( $parser, $page = '', $sec = '', $to = '', $recursionCheck = true, $trim = false, $skipPattern = [] ) {
$output = [];
@@ -230,9 +265,9 @@ public static function includeSection( $parser, $page = '', $sec = '', $to = '',
* ... it is cut at a word boundary (white space) if possible
* ... can be used as content of a wikitable field without spoiling the whole surrounding wikitext structure
*
- * @param $text the wikitext to be truncated
- * @param $limit limit of character count for the result
- * @param $link an optional link which will be appended to the text if it was truncated
+ * @param string $text the wikitext to be truncated
+ * @param int $limit limit of character count for the result
+ * @param string $link an optional link which will be appended to the text if it was truncated
*
* @return string the truncated text;
* note that the returned text may be longer than the limit if this is necessary
From f1cd019d1cfc1f52dfb1383431f12e97a3fed248 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 12:23:28 -0600
Subject: [PATCH 02/15] Update LST.php
---
includes/LST.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/includes/LST.php b/includes/LST.php
index 78069989..adb2bb53 100644
--- a/includes/LST.php
+++ b/includes/LST.php
@@ -199,7 +199,7 @@ private static function countHeadings( $text, $limit ) {
*
* @param Parser $parser
* @param string $page title text of target page
- * @param Title &$title normalized title object
+ * @param Title|string &$title normalized title object
* @param string &$text wikitext output
* @return bool true if returning text, false if target not found
*/
From 8541695503cd2a11311c5141175fbb9ca6f787b0 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 12:26:19 -0600
Subject: [PATCH 03/15] Update .phpcs.xml
---
.phpcs.xml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.phpcs.xml b/.phpcs.xml
index b1738cfd..95c1a741 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -3,7 +3,6 @@
.
-
From 110870d3ca1f2dd51e9d50603e53b8347b90db70 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 12:36:56 -0600
Subject: [PATCH 04/15] Update LST.php
---
includes/LST.php | 38 +++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/includes/LST.php b/includes/LST.php
index adb2bb53..da656d58 100644
--- a/includes/LST.php
+++ b/includes/LST.php
@@ -229,6 +229,9 @@ public static function text( $parser, $page, &$title, &$text ) {
* @param string $page
* @param string $sec
* @param string $to
+ * @param bool $recursionCheck
+ * @param bool $trim
+ * @param array $skipPattern
* @return array
*/
public static function includeSection( $parser, $page = '', $sec = '', $to = '', $recursionCheck = true, $trim = false, $skipPattern = [] ) {
@@ -386,6 +389,19 @@ public static function limitTranscludedText( $text, $limit, $link = '' ) {
}
}
+ /**
+ * @param Parser $parser
+ * @param string $page
+ * @param string $sec
+ * @param string $to
+ * @param array &$sectionHeading
+ * @param bool $recursionCheck
+ * @param int $maxLength
+ * @param string $link
+ * @param bool $trim
+ * @param array $skipPattern
+ * @return array
+ */
public static function includeHeading( $parser, $page, $sec, $to, &$sectionHeading, $recursionCheck, $maxLength, $link, $trim, $skipPattern ) {
$output = [];
@@ -401,7 +417,23 @@ public static function includeHeading( $parser, $page, $sec, $to, &$sectionHeadi
return self::extractHeadingFromText( $parser, $page, $title, $text, $sec, $to, $sectionHeading, $recursionCheck, $maxLength, $link, $trim, $skipPattern );
}
- // section inclusion - include all matching sections (return array)
+ /**
+ * Section inclusion - include all matching sections
+ *
+ * @param Parser $parser
+ * @param string $page
+ * @param Title|string $title
+ * @param string $text
+ * @param string $sec
+ * @param string $to
+ * @param array &$sectionHeading
+ * @param bool $recursionCheck
+ * @param int $maxLength
+ * @param string $clink
+ * @param bool $trim
+ * @param array $skipPattern
+ * @return array
+ */
public static function extractHeadingFromText( $parser, $page, $title, $text, $sec, $to, &$sectionHeading, $recursionCheck, $maxLength, $cLink, $trim, $skipPattern = [] ) {
$continueSearch = true;
$output = [];
@@ -830,6 +862,10 @@ public static function includeTemplate( $parser, Lister $lister, $dplNr, $articl
return $output;
}
+ /**
+ * @param string $pattern
+ * @return string
+ */
public static function spaceOrUnderscore( $pattern ) {
// returns a pettern that matches underscores as well as spaces
return str_replace( ' ', '[ _]', $pattern );
From 0c8ca2a7ae348e5626241739db32c529417e3f32 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 12:39:00 -0600
Subject: [PATCH 05/15] Update Parse.php
---
includes/Parse.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/includes/Parse.php b/includes/Parse.php
index f366af7c..b6775a3a 100644
--- a/includes/Parse.php
+++ b/includes/Parse.php
@@ -334,7 +334,7 @@ public function parse( $input, Parser $parser, &$reset, &$eliminate, $isParserTa
/**
* Process Query Results
*
- * @param $rows
+ * @param array $rows
* @param Parser $parser
* @return array
*/
From 5ed37871bd657cd80437da3153f306741cd56b95 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 12:48:03 -0600
Subject: [PATCH 06/15] Update Variables.php
---
includes/Variables.php | 36 ++++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)
diff --git a/includes/Variables.php b/includes/Variables.php
index 6a8ba556..6cd6a269 100644
--- a/includes/Variables.php
+++ b/includes/Variables.php
@@ -17,8 +17,13 @@ class Variables {
*/
public static $memoryArray = [];
- // expects pairs of 'variable name' and 'value'
- // if the first parameter is empty it will be ignored {{#vardefine:|a|b}} is the same as {{#vardefine:a|b}}
+ /**
+ * Expects pairs of 'variable name' and 'value'
+ * if the first parameter is empty it will be ignored {{#vardefine:|a|b}} is the same as {{#vardefine:a|b}}
+ *
+ * @param array $arg
+ * @return string
+ */
public static function setVar( $arg ) {
$numargs = count( $arg );
@@ -41,6 +46,10 @@ public static function setVar( $arg ) {
return '';
}
+ /**
+ * @param array $arg
+ * @return string
+ */
public static function setVarDefault( $arg ) {
$numargs = count( $arg );
@@ -59,6 +68,10 @@ public static function setVarDefault( $arg ) {
return '';
}
+ /**
+ * @param string $var
+ * @return string
+ */
public static function getVar( $var ) {
if ( array_key_exists( $var, self::$memoryVar ) ) {
return self::$memoryVar[$var];
@@ -67,6 +80,10 @@ public static function getVar( $var ) {
return '';
}
+ /**
+ * @param array $arg
+ * @return string
+ */
public static function setArray( $arg ) {
$numargs = count( $arg );
@@ -84,7 +101,7 @@ public static function setArray( $arg ) {
if ( $value == '' ) {
self::$memoryArray[$var] = [];
- return;
+ return '';
}
if ( $delimiter == '' ) {
@@ -92,7 +109,7 @@ public static function setArray( $arg ) {
$value
];
- return;
+ return '';
}
if ( strpos( $delimiter, '/' ) !== 0 || ( strlen( $delimiter ) - 1 ) !== strrpos( $delimiter, '/' ) ) {
@@ -104,6 +121,10 @@ public static function setArray( $arg ) {
return "value={$value}, delimiter={$delimiter}," . count( self::$memoryArray[$var] );
}
+ /**
+ * @param array $arg
+ * @return string
+ */
public static function dumpArray( $arg ) {
$numargs = count( $arg );
@@ -128,6 +149,13 @@ public static function dumpArray( $arg ) {
return $text . "}\n";
}
+ /**
+ * @param string $var
+ * @param string $delimiter
+ * @param string $search
+ * @param string $subject
+ * @return array|string
+ */
public static function printArray( $var, $delimiter, $search, $subject ) {
$var = trim( $var );
From 0513adb7190bb35d0d2c3c92c8417fa95547e36e Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 12:51:53 -0600
Subject: [PATCH 07/15] Update Query.php
---
includes/Query.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/includes/Query.php b/includes/Query.php
index d51f3d09..879782c1 100644
--- a/includes/Query.php
+++ b/includes/Query.php
@@ -624,6 +624,9 @@ public function addJoin( $tableAlias, $joinConditions ) {
return true;
}
+ /**
+ * @param array $joins
+ */
public function addJoins( array $joins ) {
foreach ( $joins as $alias => $conds ) {
$this->addJoin( $alias, $conds );
@@ -1737,6 +1740,7 @@ private function _ordercollation( $option ) {
* Set SQL for 'ordermethod' parameter.
*
* @param mixed $option
+ * @return bool
*/
private function _ordermethod( $option ) {
if ( $this->parameters->getParameter( 'goal' ) == 'categories' ) {
From f9e7cc3d1802f0945eb0cd8ae541725d20bf524b Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 13:06:24 -0600
Subject: [PATCH 08/15] Update Hooks.php
---
includes/Hooks.php | 50 +++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 49 insertions(+), 1 deletion(-)
diff --git a/includes/Hooks.php b/includes/Hooks.php
index 772d06aa..b0f3e798 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -310,6 +310,11 @@ public static function dplNumParserFunction( $parser, $text = '' ) {
return $num;
}
+ /**
+ * @param Parser &$parser
+ * @param string $cmd
+ * @return string
+ */
public static function dplVarParserFunction( &$parser, $cmd ) {
$parser->addTrackingCategory( 'dplvar-parserfunc-tracking-category' );
$args = func_get_args();
@@ -323,6 +328,10 @@ public static function dplVarParserFunction( &$parser, $cmd ) {
return Variables::getVar( $cmd );
}
+ /**
+ * @param string $needle
+ * @return bool
+ */
private static function isRegexp( $needle ) {
if ( strlen( $needle ) < 3 ) {
return false;
@@ -344,6 +353,13 @@ private static function isRegexp( $needle ) {
return false;
}
+ /**
+ * @param Parser &$parser
+ * @param string $text
+ * @param string $pat
+ * @param string $repl
+ * @return string
+ */
public static function dplReplaceParserFunction( &$parser, $text, $pat = '', $repl = '' ) {
$parser->addTrackingCategory( 'dplreplace-parserfunc-tracking-category' );
if ( $text == '' || $pat == '' ) {
@@ -362,12 +378,31 @@ public static function dplReplaceParserFunction( &$parser, $text, $pat = '', $re
return @preg_replace( $pat, $repl, $text );
}
+ /**
+ * @param Parser &$parser
+ * @param string $text
+ * @param string $heading
+ * @param int $maxLength
+ * @param string $page
+ * @param string $link
+ * @param bool $trim
+ * @return string
+ */
public static function dplChapterParserFunction( &$parser, $text = '', $heading = ' ', $maxLength = -1, $page = '?page?', $link = 'default', $trim = false ) {
$parser->addTrackingCategory( 'dplchapter-parserfunc-tracking-category' );
$output = LST::extractHeadingFromText( $parser, $page, '?title?', $text, $heading, '', $sectionHeading, true, $maxLength, $link, $trim );
return $output[0];
}
+ /**
+ * @param Parser &$parser
+ * @param string $name
+ * @param string $yes
+ * @param string $no
+ * @param string $flip
+ * @param string $matrix
+ * @return string
+ */
public static function dplMatrixParserFunction( &$parser, $name = '', $yes = '', $no = '', $flip = '', $matrix = '' ) {
$parser->addTrackingCategory( 'dplmatrix-parserfunc-tracking-category' );
$lines = explode( "\n", $matrix );
@@ -476,6 +511,10 @@ public static function dplMatrixParserFunction( &$parser, $name = '', $yes = '',
}
}
+ /**
+ * @param string $cat
+ * @return string
+ */
public static function fixCategory( $cat ) {
if ( $cat != '' ) {
self::$fixedCategories[$cat] = 1;
@@ -500,7 +539,12 @@ public static function getDebugLevel() {
return self::$debugLevel;
}
- // reset everything; some categories may have been fixed, however via fixcategory=
+ /**
+ * Reset everything; some categories may have been fixed, however via fixcategory=
+ *
+ * @param Parser $parser
+ * @param string $text
+ */
public static function endReset( $parser, $text ) {
if ( !self::$createdLinks['resetdone'] ) {
self::$createdLinks['resetdone'] = true;
@@ -531,6 +575,10 @@ public static function endReset( $parser, $text ) {
}
}
+ /**
+ * @param Parser $parser
+ * @param string &$text
+ */
public static function endEliminate( $parser, &$text ) {
// called during the final output phase; removes links created by DPL
if ( isset( self::$createdLinks ) ) {
From 9a39e3cbc33cceaa653594401b83e3e966038bce Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 13:18:23 -0600
Subject: [PATCH 09/15] Update UpdateArticle.php
---
includes/UpdateArticle.php | 46 +++++++++++++++++++++++++++++++++++---
1 file changed, 43 insertions(+), 3 deletions(-)
diff --git a/includes/UpdateArticle.php b/includes/UpdateArticle.php
index 58bf071e..34122684 100644
--- a/includes/UpdateArticle.php
+++ b/includes/UpdateArticle.php
@@ -13,13 +13,18 @@
class UpdateArticle {
/**
- * this fucntion hast three tasks (depending on $exec):
+ * This fucntion hast three tasks (depending on $exec):
* (1) show an edit dialogue for template fields (exec = edit)
* (2) set template parameters to values specified in the query (exec=set)v
* (2) preview the source code including any changes of these parameters made in the edit form or with other changes (exec=preview)
* (3) save the article with the changed value set or with other changes (exec=save)
* "other changes" means that a regexp can be applied to the source text or arbitrary text can be
* inserted before or after a pattern occuring in the text
+ *
+ * @param string $title
+ * @param string $text
+ * @param string $rulesText
+ * @return string
*/
public static function updateArticleByRule( $title, $text, $rulesText ) {
// we use ; as command delimiter; \; stands for a semicolon
@@ -380,6 +385,12 @@ public static function updateArticleByRule( $title, $text, $rulesText ) {
return "exec must be one of the following: edit, preview, set";
}
+ /**
+ * @param string $title
+ * @param string $text
+ * @param string $summary
+ * @return string
+ */
private static function doUpdateArticle( $title, $text, $summary ) {
$context = RequestContext::getMain();
$request = $context->getRequest();
@@ -426,6 +437,17 @@ private static function doUpdateArticle( $title, $text, $summary ) {
}
}
+ /**
+ * @param string $call
+ * @param string $parameter
+ * @param string $type
+ * @param string $value
+ * @param string $format
+ * @param string $legend
+ * @param string $instruction
+ * @param string $fieldFormat
+ * @return string
+ */
private static function editTemplateCall( $call, $parameter, $type, $value, $format, $legend, $instruction, $fieldFormat ) {
$matches = [];
$nlCount = preg_match_all( '/\n/', $value, $matches );
@@ -451,7 +473,9 @@ private static function editTemplateCall( $call, $parameter, $type, $value, $for
}
/**
- * return an array of template invocations; each element is an associative array of parameter and value
+ * @param string $text
+ * @param string $template
+ * @return array template invocations; each element is an associative array of parameter and value
*/
private static function getTemplateParmValues( $text, $template ) {
$matches = [];
@@ -526,8 +550,18 @@ private static function getTemplateParmValues( $text, $template ) {
return $tval;
}
- /*
+ /**
* Changes a single parameter value within a certain call of a template
+ *
+ * @param int &$matchCount
+ * @param string $text
+ * @param string $template
+ * @param string $call
+ * @param string $parameter
+ * @param string $value
+ * @param string $afterParm
+ * @param bool $optional
+ * @return string
*/
private static function updateTemplateCall( &$matchCount, $text, $template, $call, $parameter, $value, $afterParm, $optional ) {
// if parameter is optional and value is empty we leave everything as it is (i.e. we do not remove the parm)
@@ -668,6 +702,12 @@ private static function updateTemplateCall( &$matchCount, $text, $template, $cal
return substr( $text, 0, $beginSubst ) . ( $substitution ?? '' ) . substr( $text, $endSubst );
}
+ /**
+ * @param string $title
+ * @param string $text
+ * @param string $rulesText
+ * @return string
+ */
public static function deleteArticleByRule( $title, $text, $rulesText ) {
// return "deletion of articles by DPL is disabled.";
From 7c32bf35b6b0cc683db07ae555df7eac90089ea3 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 13:28:01 -0600
Subject: [PATCH 10/15] Update LST.php
---
includes/LST.php | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/includes/LST.php b/includes/LST.php
index da656d58..bd8be9bf 100644
--- a/includes/LST.php
+++ b/includes/LST.php
@@ -91,6 +91,7 @@ public static function close( $parser, $part1 ) {
* @param string $link
* @param bool $trim
* @param array $skipPattern
+ * @return string
*/
private static function parse( $parser, $text, $part1, $skiphead = 0, $recursionCheck = true, $maxLength = -1, $link = '', $trim = false, $skipPattern = [] ) {
// if someone tries something like
@@ -133,6 +134,7 @@ private static function parse( $parser, $text, $part1, $skiphead = 0, $recursion
* @param string $sec
* @param string $to
* @param bool &$any
+ * @return string
*/
private static function createSectionPattern( $sec, $to, &$any ) {
$any = false;
@@ -429,7 +431,7 @@ public static function includeHeading( $parser, $page, $sec, $to, &$sectionHeadi
* @param array &$sectionHeading
* @param bool $recursionCheck
* @param int $maxLength
- * @param string $clink
+ * @param string $cLink
* @param bool $trim
* @param array $skipPattern
* @return array
@@ -596,11 +598,26 @@ public static function extractHeadingFromText( $parser, $page, $title, $text, $s
return $output;
}
- // template inclusion - find the place(s) where template1 is called,
- // replace its name by template2, then expand template2 and return the result
- // we return an array containing all occurences of the template call which match the condition "$mustMatch"
- // and do NOT match the condition "$mustNotMatch" (if specified)
- // we use a callback function to format retrieved parameters, accessible via $lister->formatTemplateArg()
+ /**
+ * Template inclusion - find the place(s) where template1 is called,
+ * replace its name by template2, then expand template2 and return the result
+ * we return an array containing all occurences of the template call which match the condition "$mustMatch"
+ * and do NOT match the condition "$mustNotMatch" (if specified)
+ * we use a callback function to format retrieved parameters, accessible via $lister->formatTemplateArg()
+ *
+ * @param Parser $parser
+ * @param Lister $lister
+ * @param mixed $dplNr
+ * @param Article $article
+ * @param string $template1
+ * @param string $template2
+ * @param string $defaultTemplate
+ * @param bool $mustMatch
+ * @param bool $mustNotMatch
+ * @param bool $matchParsed
+ * @param string $catlist
+ * @return array
+ */
public static function includeTemplate( $parser, Lister $lister, $dplNr, $article, $template1, $template2, $defaultTemplate, $mustMatch, $mustNotMatch, $matchParsed, $catlist ) {
$page = $article->mTitle->getPrefixedText();
$date = $article->myDate;
From c5f3a5c4866b9d9da826b84b960c1b7197842333 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 13:31:20 -0600
Subject: [PATCH 11/15] Update DPLIntegrationTestCase.php
---
tests/phpunit/DPLIntegrationTestCase.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/phpunit/DPLIntegrationTestCase.php b/tests/phpunit/DPLIntegrationTestCase.php
index be64e87b..2eb6ca5b 100644
--- a/tests/phpunit/DPLIntegrationTestCase.php
+++ b/tests/phpunit/DPLIntegrationTestCase.php
@@ -111,6 +111,7 @@ private function newUserFromName( string $name ): ?User {
/**
* Convenience function to return the list of page titles matching a DPL query
* @param array $params - DPL invocation parameters
+ * @param string $format
* @return string[]
*/
protected function getDPLQueryResults( array $params, string $format = '%PAGE%' ): array {
From e16d57d670c6a7a48ce2027055f4188618bdfe6c Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 13:35:16 -0600
Subject: [PATCH 12/15] Update Hooks.php
---
includes/Hooks.php | 1 -
1 file changed, 1 deletion(-)
diff --git a/includes/Hooks.php b/includes/Hooks.php
index b0f3e798..2ca084bc 100644
--- a/includes/Hooks.php
+++ b/includes/Hooks.php
@@ -513,7 +513,6 @@ public static function dplMatrixParserFunction( &$parser, $name = '', $yes = '',
/**
* @param string $cat
- * @return string
*/
public static function fixCategory( $cat ) {
if ( $cat != '' ) {
From dc8b4f4693bea6e1d8acb71ef460d72fbad2b467 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 13:41:38 -0600
Subject: [PATCH 13/15] Update LST.php
---
includes/LST.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/includes/LST.php b/includes/LST.php
index bd8be9bf..886d19d0 100644
--- a/includes/LST.php
+++ b/includes/LST.php
@@ -250,7 +250,7 @@ public static function includeSection( $parser, $page = '', $sec = '', $to = '',
preg_match_all( $pat, $text, $m, PREG_PATTERN_ORDER );
foreach ( $m[2] as $nr => $piece ) {
- $piece = self::parse( $parser, $piece, "#lst:${page}|${sec}", 0, $recursionCheck, $trim, $skipPattern );
+ $piece = self::parse( $parser, $piece, "#lst:${page}|${sec}", 0, $recursionCheck, -1, '', $trim, $skipPattern );
if ( $any ) {
$output[] = $m[1][$nr] . '::' . $piece;
@@ -612,8 +612,8 @@ public static function extractHeadingFromText( $parser, $page, $title, $text, $s
* @param string $template1
* @param string $template2
* @param string $defaultTemplate
- * @param bool $mustMatch
- * @param bool $mustNotMatch
+ * @param string $mustMatch
+ * @param string $mustNotMatch
* @param bool $matchParsed
* @param string $catlist
* @return array
From 1929ebd11b2931b33a9cd66f9b0f5f41ebae7a8a Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 13:48:23 -0600
Subject: [PATCH 14/15] Update UpdateArticle.php
---
includes/UpdateArticle.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/includes/UpdateArticle.php b/includes/UpdateArticle.php
index 34122684..963ac223 100644
--- a/includes/UpdateArticle.php
+++ b/includes/UpdateArticle.php
@@ -438,7 +438,7 @@ private static function doUpdateArticle( $title, $text, $summary ) {
}
/**
- * @param string $call
+ * @param string|int $call
* @param string $parameter
* @param string $type
* @param string $value
@@ -475,7 +475,7 @@ private static function editTemplateCall( $call, $parameter, $type, $value, $for
/**
* @param string $text
* @param string $template
- * @return array template invocations; each element is an associative array of parameter and value
+ * @return array|string
*/
private static function getTemplateParmValues( $text, $template ) {
$matches = [];
@@ -559,7 +559,7 @@ private static function getTemplateParmValues( $text, $template ) {
* @param string $call
* @param string $parameter
* @param string $value
- * @param string $afterParm
+ * @param array $afterParm
* @param bool $optional
* @return string
*/
From dd43d68a6236a35aa4fb961a2140b29d4ad39f30 Mon Sep 17 00:00:00 2001
From: Universal Omega <54654040+Universal-Omega@users.noreply.github.com>
Date: Tue, 22 Mar 2022 13:53:16 -0600
Subject: [PATCH 15/15] Update UpdateArticle.php
---
includes/UpdateArticle.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/includes/UpdateArticle.php b/includes/UpdateArticle.php
index 963ac223..5c0678c7 100644
--- a/includes/UpdateArticle.php
+++ b/includes/UpdateArticle.php
@@ -438,7 +438,7 @@ private static function doUpdateArticle( $title, $text, $summary ) {
}
/**
- * @param string|int $call
+ * @param int $call
* @param string $parameter
* @param string $type
* @param string $value
@@ -556,7 +556,7 @@ private static function getTemplateParmValues( $text, $template ) {
* @param int &$matchCount
* @param string $text
* @param string $template
- * @param string $call
+ * @param int $call
* @param string $parameter
* @param string $value
* @param array $afterParm