Fix Phan warning in TexVC class

Required-For: If0429485941c19eb0e88896cb1ada66a5320bafe
Change-Id: I77f4d552b63b7ed935502e2d45cfa97e5310927c
This commit is contained in:
thiemowmde 2022-11-23 11:03:33 +01:00
parent bb39263f59
commit 14647fa3b1
2 changed files with 12 additions and 3 deletions

View file

@ -7,6 +7,11 @@ namespace MediaWiki\Extension\Math\TexVC;
use MediaWiki\Extension\Math\TexVC\Nodes\TexArray;
class ParserUtil {
/**
* @param TexArray|null $l
* @return TexArray
*/
public static function lst2arr( $l ) {
$arr = new TexArray();
@ -21,6 +26,10 @@ class ParserUtil {
return $arr;
}
/**
* @param array|null $options
* @return array
*/
public static function createOptions( $options ) {
# get reference of the options for usage in functions and initialize with default values.
$optionsBase = [

View file

@ -52,13 +52,13 @@ class TexVC {
* command ...
* @param string|TexArray|stdClass $input tex to be checked as string,
* can also be the output of former parser call
* @param null|array $options array options for settings of the check
* @param array $options array options for settings of the check
* @param array &$warnings reference on warnings occurring during the check
* @return array|string[] output with information status (see above)
* @throws Exception in case of a major problem with the check and activated debug option.
*/
public function check( $input, $options = null, &$warnings = [] ) {
try{
public function check( $input, $options = [], &$warnings = [] ) {
try {
$options = ParserUtil::createOptions( $options );
if ( is_string( $input ) ) {
$input = $this->parser->parse( $input, $options );