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
Suggestion
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
 getPropertyId
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getProbability
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace PropertySuggester\Suggesters;
4
5use Wikibase\DataModel\Entity\NumericPropertyId;
6
7/**
8 * Suggestion returned by a SuggesterEngine
9 *
10 * @author BP2013N2
11 * @license GPL-2.0-or-later
12 */
13class Suggestion {
14
15    /**
16     * @var NumericPropertyId
17     */
18    private $propertyId;
19
20    /**
21     * @var float
22     * average probability that an already existing property is used with the suggested property
23     */
24    private $probability;
25
26    /**
27     * @param NumericPropertyId $propertyId
28     * @param float $probability
29     */
30    public function __construct( NumericPropertyId $propertyId, $probability ) {
31        $this->propertyId = $propertyId;
32        $this->probability = $probability;
33    }
34
35    /**
36     * @return NumericPropertyId
37     */
38    public function getPropertyId() {
39        return $this->propertyId;
40    }
41
42    /**
43     * average probability that an already existing property is used with the suggested property
44     * @return float
45     */
46    public function getProbability() {
47        return $this->probability;
48    }
49
50}