X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fparser%2FParserDiffTest.php;h=93f4246e027be9e92d84f7f9f98ce7d51925b2a2;hb=63f1b4ee690d7ea2d40c7e0873a24a4cb5bd60ff;hp=d0b66f8061fbb4178c8815503806f6305f8e7af7;hpb=fb7b3eebeb8de47eb42e8d6ccf204106a2d6d9e4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/parser/ParserDiffTest.php b/includes/parser/ParserDiffTest.php index d0b66f8061..93f4246e02 100644 --- a/includes/parser/ParserDiffTest.php +++ b/includes/parser/ParserDiffTest.php @@ -24,8 +24,7 @@ /** * @ingroup Parser */ -class ParserDiffTest -{ +class ParserDiffTest { public $parsers; public $conf; public $shortOutput = false; @@ -62,12 +61,9 @@ class ParserDiffTest $results = []; $mismatch = false; $lastResult = null; - $first = true; - foreach ( $this->parsers as $i => $parser ) { - $currentResult = call_user_func_array( [ &$this->parsers[$i], $name ], $args ); - if ( $first ) { - $first = false; - } else { + foreach ( $this->parsers as $parser ) { + $currentResult = $parser->$name( ...$args ); + if ( count( $results ) > 0 ) { if ( is_object( $lastResult ) ) { if ( $lastResult != $currentResult ) { $mismatch = true; @@ -78,7 +74,7 @@ class ParserDiffTest } } } - $results[$i] = $currentResult; + $results[] = $currentResult; $lastResult = $currentResult; } if ( $mismatch ) {