Completed
Push — master ( 028b55...c232a2 )
by Jean
08:31 queued 03:12
created

Deal::getPrice()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * @author Jean Silva <[email protected]>
4
 * @license MIT
5
 */
6
namespace Jeancsil\FlightSpy\Notifier;
7
8
use Jeancsil\FlightSpy\Api\DataTransfer\SessionParameters;
9
10
class Deal
11
{
12
    /**
13
     * @var SessionParameters
14
     */
15
    private $sessionParameters;
16
17
    /**
18
     * @var float
19
     */
20
    private $price;
21
22
    /**
23
     * @var string
24
     */
25
    private $agentName;
26
27
    /**
28
     * @var string
29
     */
30
    private $deepLinkUrl;
31
32
    public function __construct(SessionParameters $sessionParameters, $price, $agentName, $deepLinkUrl)
33
    {
34
        $this->sessionParameters = $sessionParameters;
35
        $this->price = $price;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 13 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
36
        $this->agentName = $agentName;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 9 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
37
        $this->deepLinkUrl = $deepLinkUrl;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 7 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
38
    }
39
40
    /**
41
     * @return float
42
     */
43
    public function getPrice()
44
    {
45
        return $this->price;
46
    }
47
48
    /**
49
     * @return string
50
     */
51
    public function getAgentName()
52
    {
53
        return $this->agentName;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getDeepLinkUrl()
60
    {
61
        return $this->deepLinkUrl;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getIdentifier()
68
    {
69
        return md5(
70
            sprintf(
71
                '%s%s%s',
72
                $this->agentName,
73
                $this->price,
74
                $this->sessionParameters
75
            )
76
        );
77
    }
78
}
79