Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 10 |
CRAP | |
0.00% |
0 / 1 |
| RecentSignificantEdit | |
0.00% |
0 / 10 |
|
0.00% |
0 / 10 |
110 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getUserId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPageWikidataId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPageTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getLanguage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSectionTitles | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getTimestamp | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| mergeSectionTitles | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types=1 ); |
| 4 | |
| 5 | namespace ContentTranslation\Entity; |
| 6 | |
| 7 | class RecentSignificantEdit { |
| 8 | |
| 9 | public function __construct( |
| 10 | private ?int $id, |
| 11 | private readonly int $userId, |
| 12 | private readonly int $pageWikidataId, |
| 13 | private readonly string $language, |
| 14 | private readonly string $pageTitle, |
| 15 | /** @var string[] */ |
| 16 | private array $sectionTitles, |
| 17 | private readonly ?string $timestamp |
| 18 | ) { |
| 19 | } |
| 20 | |
| 21 | public function setId( int $id ): void { |
| 22 | $this->id = $id; |
| 23 | } |
| 24 | |
| 25 | public function getId(): ?int { |
| 26 | return $this->id; |
| 27 | } |
| 28 | |
| 29 | public function getUserId(): int { |
| 30 | return $this->userId; |
| 31 | } |
| 32 | |
| 33 | public function getPageWikidataId(): int { |
| 34 | return $this->pageWikidataId; |
| 35 | } |
| 36 | |
| 37 | public function getPageTitle(): string { |
| 38 | return $this->pageTitle; |
| 39 | } |
| 40 | |
| 41 | public function getLanguage(): string { |
| 42 | return $this->language; |
| 43 | } |
| 44 | |
| 45 | /** @return string[] */ |
| 46 | public function getSectionTitles(): array { |
| 47 | return $this->sectionTitles; |
| 48 | } |
| 49 | |
| 50 | public function getTimestamp(): ?string { |
| 51 | return $this->timestamp; |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * @param string[] $newSectionTitles |
| 56 | */ |
| 57 | public function mergeSectionTitles( array $newSectionTitles ): void { |
| 58 | $this->sectionTitles = array_unique( array_merge( $this->sectionTitles, $newSectionTitles ) ); |
| 59 | } |
| 60 | } |