mediawiki-extensions-Discus.../tests/phpunit/MockCommentFormatter.php
Ed Sanders 4accd2fc7e Add some missing typehints
Change-Id: Idb111dd907972d9e02dab4b26c3fc106b12b1035
2022-06-29 15:15:52 +00:00

35 lines
743 B
PHP

<?php
namespace MediaWiki\Extension\DiscussionTools\Tests;
use Language;
use MediaWiki\Extension\DiscussionTools\CommentFormatter;
use MediaWiki\Extension\DiscussionTools\CommentParser;
use MediaWiki\User\UserIdentity;
use MWTimestamp;
class MockCommentFormatter extends CommentFormatter {
/**
* @var CommentParser
*/
public static $parser;
/**
* @return CommentParser
*/
protected static function getParser(): CommentParser {
return static::$parser;
}
/**
* @inheritDoc
*/
public static function getSignatureRelativeTime(
MWTimestamp $timestamp, Language $lang, UserIdentity $user
): string {
// Relative times can't be used in tests, so just return a plain timestamp
return $timestamp->getTimestamp();
}
}