Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 10
CRAP
0.00% covered (danger)
0.00%
0 / 1
RecentSignificantEdit
0.00% covered (danger)
0.00%
0 / 16
0.00% covered (danger)
0.00%
0 / 10
110
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 setId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getUserId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getPageWikidataId
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getPageTitle
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getLanguage
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getSectionTitles
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getTimestamp
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 mergeSectionTitles
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare( strict_types=1 );
4
5namespace ContentTranslation\Entity;
6
7class RecentSignificantEdit {
8    /** @var int|null */
9    private $id;
10
11    /** @var int */
12    private $userId;
13
14    /** @var int */
15    private $pageWikidataId;
16
17    /**
18     * @var string language code (e.g. "en")
19     */
20    private $language;
21
22    /** @var string */
23    private $pageTitle;
24
25    /** @var string[] */
26    private $sectionTitles;
27
28    /** @var string|null */
29    private $timestamp;
30
31    public function __construct(
32        ?int $id,
33        int $userId,
34        int $pageWikidataId,
35        string $language,
36        string $pageTitle,
37        array $sectionTitles,
38        ?string $timestamp
39    ) {
40        $this->id = $id;
41        $this->userId = $userId;
42        $this->pageWikidataId = $pageWikidataId;
43        $this->language = $language;
44        $this->pageTitle = $pageTitle;
45        $this->sectionTitles = $sectionTitles;
46        $this->timestamp = $timestamp;
47    }
48
49    public function setId( int $id ): void {
50        $this->id = $id;
51    }
52
53    public function getId(): ?int {
54        return $this->id;
55    }
56
57    public function getUserId(): int {
58        return $this->userId;
59    }
60
61    public function getPageWikidataId(): int {
62        return $this->pageWikidataId;
63    }
64
65    public function getPageTitle(): string {
66        return $this->pageTitle;
67    }
68
69    public function getLanguage(): string {
70        return $this->language;
71    }
72
73    /** @return string[] */
74    public function getSectionTitles(): array {
75        return $this->sectionTitles;
76    }
77
78    public function getTimestamp(): ?string {
79        return $this->timestamp;
80    }
81
82    /**
83     * @param string[] $newSectionTitles
84     */
85    public function mergeSectionTitles( array $newSectionTitles ): void {
86        $this->sectionTitles = array_unique( array_merge( $this->sectionTitles, $newSectionTitles ) );
87    }
88}