diff --git a/src/Cite.php b/src/Cite.php index e0097eb1f..ddc1ce3c1 100644 --- a/src/Cite.php +++ b/src/Cite.php @@ -409,7 +409,7 @@ class Cite { * * @param Parser $parser * @param ?string $text Raw, untrimmed wikitext content of the tag, if any - * @param string[] $argv Arguments as given in , already trimmed + * @param string[] $argv Arguments as given in , already trimmed * * @return string|false False in case a tag is not allowed in the current context */ @@ -429,7 +429,7 @@ class Cite { * * @param Parser $parser * @param ?string $text Raw, untrimmed wikitext content of the tag, if any - * @param string[] $argv Arguments as given in , already trimmed + * @param string[] $argv Arguments as given in , already trimmed * * @return string HTML */ diff --git a/src/ReferenceStack.php b/src/ReferenceStack.php index 45c6c1d08..000d2d47d 100644 --- a/src/ReferenceStack.php +++ b/src/ReferenceStack.php @@ -424,10 +424,6 @@ class ReferenceStack { * @param string $text */ public function appendText( string $group, string $name, string $text ) { - if ( !isset( $this->refs[$group][$name] ) ) { - throw new LogicException( "Unknown ref \"$name\" in group \"$group\"" ); - } - if ( isset( $this->refs[$group][$name]['text'] ) ) { $this->refs[$group][$name]['text'] .= $text; } else { diff --git a/tests/phpunit/unit/ReferenceStackTest.php b/tests/phpunit/unit/ReferenceStackTest.php index fa9936925..182259cd7 100644 --- a/tests/phpunit/unit/ReferenceStackTest.php +++ b/tests/phpunit/unit/ReferenceStackTest.php @@ -1050,22 +1050,11 @@ class ReferenceStackTest extends \MediaWikiUnitTestCase { $this->assertSame( [], $stack->getGroupRefs( 'empty' ) ); } - /** - * @covers ::appendText - */ - public function testAppendText_failure() { - $stack = $this->newStack(); - - $this->expectException( LogicException::class ); - $stack->appendText( 'group', 'name', 'the-text' ); - } - /** * @covers ::appendText */ public function testAppendText() { $stack = $this->newStack(); - $stack->refs = [ 'group' => [ 'name' => [] ] ]; $stack->appendText( 'group', 'name', 'set' ); $this->assertSame( [ 'text' => 'set' ], $stack->refs['group']['name'] );