mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-30 18:35:12 +00:00
Fix Phan warning in TexVC class
Required-For: If0429485941c19eb0e88896cb1ada66a5320bafe Change-Id: I77f4d552b63b7ed935502e2d45cfa97e5310927c
This commit is contained in:
parent
bb39263f59
commit
14647fa3b1
|
@ -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 = [
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue