Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
8 / 8
CRAP
100.00% covered (success)
100.00%
1 / 1
Neighbor
100.00% covered (success)
100.00%
14 / 14
100.00% covered (success)
100.00%
8 / 8
8
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
7 / 7
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
 getEditOverlap
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getEditOverlapInv
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getDayOverlap
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getHourOverlap
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getFollowUp
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 Neighbor {
6
7    /**
8     * User name of the neighbor
9     * @var string
10     */
11    private $userText;
12
13    /**
14     * Number of edits made by the neighbor in the data
15     *
16     * @var int
17     */
18    private $numEditsInData;
19
20    /**
21     * Number of overlapping edited pages divided by number of pages edited by queried editor (between 0 and 1)
22     *
23     * @var float
24     */
25    private $editOverlap;
26
27    /**
28     * Number of overlapping edited pages divided by number of pages edited by the neighbor (between 0 and 1)
29     *
30     * @var float
31     */
32    private $editOverlapInv;
33
34    /**
35     * Level of temporal overlap (editing the same days of the week) with queried editor
36     *
37     * @var TimeOverlap
38     */
39    private $dayOverlap;
40
41    /**
42     * Level of temporal overlap (editing the same hours of the day) with queried editor
43     * @var TimeOverlap
44     */
45    private $hourOverlap;
46
47    /**
48     * Additional tool links in API response for follow-up on data
49     * @var string[]
50     */
51    private $followUp;
52
53    /**
54     * @param string $userText
55     * @param int $numEditsInData
56     * @param float $editOverlap
57     * @param float $editOverlapInv
58     * @param TimeOverlap $dayOverlap
59     * @param TimeOverlap $hourOverlap
60     * @param string[] $followUp
61     */
62    public function __construct(
63        $userText,
64        $numEditsInData,
65        $editOverlap,
66        $editOverlapInv,
67        $dayOverlap,
68        $hourOverlap,
69        $followUp
70    ) {
71        $this->userText = $userText;
72        $this->numEditsInData = $numEditsInData;
73        $this->editOverlap = $editOverlap;
74        $this->editOverlapInv = $editOverlapInv;
75        $this->dayOverlap = $dayOverlap;
76        $this->hourOverlap = $hourOverlap;
77        $this->followUp = $followUp;
78    }
79
80    /**
81     * @return string
82     */
83    public function getUserText(): string {
84        return $this->userText;
85    }
86
87    /**
88     * @return int
89     */
90    public function getNumEditsInData(): int {
91        return $this->numEditsInData;
92    }
93
94    /**
95     * @return float
96     */
97    public function getEditOverlap(): float {
98        return $this->editOverlap;
99    }
100
101    /**
102     * @return float
103     */
104    public function getEditOverlapInv(): float {
105        return $this->editOverlapInv;
106    }
107
108    /**
109     * @return TimeOverlap
110     */
111    public function getDayOverlap(): TimeOverlap {
112        return $this->dayOverlap;
113    }
114
115    /**
116     * @return TimeOverlap
117     */
118    public function getHourOverlap(): TimeOverlap {
119        return $this->hourOverlap;
120    }
121
122    /**
123     * @return string[]
124     */
125    public function getFollowUp(): array {
126        return $this->followUp;
127    }
128}