Operation   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 2
b 0
f 0
dl 0
loc 47
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A type() 0 3 1
A numberTwo() 0 3 1
A numberOne() 0 3 1
1
<?php
2
3
namespace Tleckie\DesignPatterns\ChainResponsibility;
4
5
/**
6
 * Class Operation
7
 *
8
 * @package Tleckie\DesignPatterns\ChainOfResponsibility
9
 * @author  Teodoro Leckie Westberg <[email protected]>
10
 */
11
class Operation implements OperationInterface
12
{
13
    /** @var string */
14
    private string $type;
15
16
    /** @var float */
17
    private float $numberOne;
18
19
    /** @var float */
20
    private float $numberTwo;
21
22
    /**
23
     * Operation constructor.
24
     *
25
     * @param string $type
26
     * @param float  $numberOne
27
     * @param float  $numberTwo
28
     */
29
    public function __construct(string $type, float $numberOne, float $numberTwo)
30
    {
31
        $this->type = $type;
32
        $this->numberOne = $numberOne;
33
        $this->numberTwo = $numberTwo;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function type(): string
40
    {
41
        return $this->type;
42
    }
43
44
    /**
45
     * @return float
46
     */
47
    public function numberOne(): float
48
    {
49
        return $this->numberOne;
50
    }
51
52
    /**
53
     * @return float
54
     */
55
    public function numberTwo(): float
56
    {
57
        return $this->numberTwo;
58
    }
59
}
60