Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
8 / 8 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
Fraction | |
100.00% |
8 / 8 |
|
100.00% |
5 / 5 |
5 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getDenominator | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getNumerator | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setDenominator | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setNumerator | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace PhpOffice\Math\Element; |
4 | |
5 | class Fraction extends AbstractElement |
6 | { |
7 | /** |
8 | * @var AbstractElement |
9 | */ |
10 | protected $denominator; |
11 | |
12 | /** |
13 | * @var AbstractElement |
14 | */ |
15 | protected $numerator; |
16 | |
17 | public function __construct(AbstractElement $numerator, AbstractElement $denominator) |
18 | { |
19 | $this->setNumerator($numerator); |
20 | $this->setDenominator($denominator); |
21 | } |
22 | |
23 | public function getDenominator(): AbstractElement |
24 | { |
25 | return $this->denominator; |
26 | } |
27 | |
28 | public function getNumerator(): AbstractElement |
29 | { |
30 | return $this->numerator; |
31 | } |
32 | |
33 | public function setDenominator(AbstractElement $element): self |
34 | { |
35 | $this->denominator = $element; |
36 | |
37 | return $this; |
38 | } |
39 | |
40 | public function setNumerator(AbstractElement $element): self |
41 | { |
42 | $this->numerator = $element; |
43 | |
44 | return $this; |
45 | } |
46 | } |