Result::getAssociationPercent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Predictator\AssociationRule;
4
5
6
class Result implements ProductInterface
7
{
8
	/**
9
	 * @var ProductInterface
10
	 */
11
	private $product;
12
13
	/**
14
	 * @var int
15
	 */
16
	private $percent;
17
18
	/**
19
	 * @param ProductInterface $product
20
	 * @param int $percent
21
	 */
22
	public function __construct(ProductInterface $product, int $percent)
23
	{
24
		$this->product = $product;
25
		$this->percent = $percent;
26
	}
27
28
	/**
29
	 * @return int
30
	 */
31
	public function getAssociationPercent() :int
32
	{
33
		return $this->percent;
34
	}
35
36
	/**
37
	 * @return ProductInterface
38
	 */
39
	public function getProduct() :ProductInterface
40
	{
41
		return $this->product;
42
	}
43
44
	/**
45
	 * @return string
46
	 */
47
	public function getId(): string
48
	{
49
		return $this->product->getId();
50
	}
51
}