Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
TimeOverlap
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getCosineSimilarity
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLevel
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 TimeOverlap {
6    /**
7     * Similarity score
8     *
9     * @var float
10     */
11    private $cosineSimilarity;
12
13    /**
14     * Qualitative description of the similarity score
15     * possible values: no overlap, low, medium, high
16     *
17     * @var string
18     */
19    private $level;
20
21    /**
22     * @param float $cosineSimilarity
23     * @param string $level
24     */
25    public function __construct(
26        float $cosineSimilarity,
27        string $level
28    ) {
29        $this->cosineSimilarity = $cosineSimilarity;
30        $this->level = $level;
31    }
32
33    /**
34     * @return float
35     */
36    public function getCosineSimilarity(): float {
37        return $this->cosineSimilarity;
38    }
39
40    /**
41     * @return string
42     */
43    public function getLevel(): string {
44        return $this->level;
45    }
46}