mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-18 02:51:26 +00:00
Merge "CommentItem/HeadingItem: Make more constructor args required"
This commit is contained in:
commit
452c6401d7
|
@ -20,12 +20,12 @@ class CommentItem extends ThreadItem {
|
|||
* timestamps) for this comment. There is always at least one signature, but there may be
|
||||
* multiple. The author and timestamp of the comment is determined from the first signature.
|
||||
* The last node in every signature range is a node containing the timestamp.
|
||||
* @param string|null $timestamp
|
||||
* @param string|null $author Comment author's username
|
||||
* @param string $timestamp
|
||||
* @param string $author Comment author's username
|
||||
*/
|
||||
public function __construct(
|
||||
int $level, ImmutableRange $range,
|
||||
array $signatureRanges = [], ?string $timestamp = null, ?string $author = null
|
||||
array $signatureRanges, string $timestamp, string $author
|
||||
) {
|
||||
parent::__construct( 'comment', $level, $range );
|
||||
$this->signatureRanges = $signatureRanges;
|
||||
|
|
|
@ -25,8 +25,7 @@ class ThreadItemTest extends CommentTestCase {
|
|||
|
||||
$makeThreadItem = function ( array $arr ) use ( &$makeThreadItem, $range ) : ThreadItem {
|
||||
if ( $arr['type'] === 'comment' ) {
|
||||
$item = new CommentItem( 1, $range );
|
||||
$item->setAuthor( $arr['author'] );
|
||||
$item = new CommentItem( 1, $range, [], 'TIMESTAMP', $arr['author'] );
|
||||
} else {
|
||||
$item = new HeadingItem( $range, 2 );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue