Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
| DatabaseCommentItem | |
0.00% |
0 / 5 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getAuthor | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getTimestamp | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getHeading | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSubscribableHeading | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\DiscussionTools\ThreadItem; |
| 4 | |
| 5 | use DateTimeImmutable; |
| 6 | use MediaWiki\Page\ProperPageIdentity; |
| 7 | use MediaWiki\Revision\RevisionRecord; |
| 8 | |
| 9 | class DatabaseCommentItem extends DatabaseThreadItem implements CommentItem { |
| 10 | use CommentItemTrait { |
| 11 | getHeading as protected traitGetHeading; |
| 12 | getSubscribableHeading as protected traitGetSubscribableHeading; |
| 13 | } |
| 14 | |
| 15 | /** |
| 16 | * @param ProperPageIdentity $page |
| 17 | * @param RevisionRecord $rev |
| 18 | * @param string $name |
| 19 | * @param string $id |
| 20 | * @param DatabaseThreadItem|null $parent |
| 21 | * @param bool|string $transcludedFrom |
| 22 | * @param int $level |
| 23 | * @param string $timestamp |
| 24 | * @param string $author |
| 25 | */ |
| 26 | public function __construct( |
| 27 | ProperPageIdentity $page, RevisionRecord $rev, |
| 28 | string $name, string $id, ?DatabaseThreadItem $parent, $transcludedFrom, int $level, |
| 29 | private readonly string $timestamp, |
| 30 | private readonly string $author, |
| 31 | ) { |
| 32 | parent::__construct( $page, $rev, 'comment', $name, $id, $parent, $transcludedFrom, $level ); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * @inheritDoc |
| 37 | */ |
| 38 | public function getAuthor(): string { |
| 39 | return $this->author; |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * @inheritDoc |
| 44 | */ |
| 45 | public function getTimestamp(): DateTimeImmutable { |
| 46 | return new DateTimeImmutable( $this->timestamp ); |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * @inheritDoc CommentItemTrait::getHeading |
| 51 | * @suppress PhanTypeMismatchReturnSuperType |
| 52 | */ |
| 53 | public function getHeading(): DatabaseHeadingItem { |
| 54 | return $this->traitGetHeading(); |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * @inheritDoc CommentItemTrait::getSubscribableHeading |
| 59 | */ |
| 60 | public function getSubscribableHeading(): ?DatabaseHeadingItem { |
| 61 | return $this->traitGetSubscribableHeading(); |
| 62 | } |
| 63 | } |