Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
5 / 5
CRAP
100.00% covered (success)
100.00%
1 / 1
Editor
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
5 / 5
5
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
1
 getUserText
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getNumEditsInData
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getFirstEditInData
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLastEditInData
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\Extension\SimilarEditors;
4
5class Editor {
6
7    /**
8     * User name from the query usertext parameter. Reformatted according to mediawiki's "User" naming convention.
9     *
10     * @var string|null
11     */
12    private $userText;
13
14    /**
15     * Number of in-scope edits made by the user in the data
16     *
17     * @var int|null
18     */
19    private $numEditsInData;
20
21    /**
22     * Timestamp of the first (oldest) edit made by the user in the data
23     *
24     * @var string|null
25     */
26    private $firstEditInData;
27
28    /**
29     * Timestamp of the last (most recent) edit made by the user in the data
30     *
31     * @var string|null
32     */
33    private $lastEditInData;
34
35    /**
36     * @param string|null $userText
37     * @param int|null $numEditsInData
38     * @param string|null $firstEditInData
39     * @param string|null $lastEditInData
40     */
41    public function __construct(
42        $userText = null,
43        $numEditsInData = null,
44        $firstEditInData = null,
45        $lastEditInData = null
46    ) {
47        $this->userText = $userText;
48        $this->numEditsInData = $numEditsInData;
49        $this->firstEditInData = $firstEditInData;
50        $this->lastEditInData = $lastEditInData;
51    }
52
53    /**
54     * @return string|null
55     */
56    public function getUserText(): ?string {
57        return $this->userText;
58    }
59
60    /**
61     * @return int|null
62     */
63    public function getNumEditsInData(): ?int {
64        return $this->numEditsInData;
65    }
66
67    /**
68     * @return string|null
69     */
70    public function getFirstEditInData(): ?string {
71        return $this->firstEditInData;
72    }
73
74    /**
75     * @return string|null
76     */
77    public function getLastEditInData(): ?string {
78        return $this->lastEditInData;
79    }
80}