GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

AbstractOrder::getType()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace IndependentReserve\Object;
4
5
use DateTime;
6
7
abstract class AbstractOrder extends AbstractObject
8
{
9
    /**
10
     * Order limit price in secondary currency.
11
     * @return double
12
     */
13 3
    public function getPrice()
14
    {
15 3
        return $this->object->Price;
16
    }
17
18
    /**
19
     * Type of order.
20
     * @see \IndependentReserve\OrderType
21
     * @return string
22
     */
23 4
    public function getType()
24
    {
25 4
        if (isset($this->object->Type)) {
26 2
            return $this->object->Type;
27
        }
28 2
        return $this->object->OrderType;
29
    }
30
31
    /**
32
     * UTC timestamp of when order was created.
33
     * @return DateTime
34
     */
35 7
    public function getCreatedTimestamp()
36
    {
37 7
        return new DateTime($this->object->CreatedTimestampUtc);
38
    }
39
40
    /**
41
     * Primary currency of order.
42
     * @return string
43
     */
44 4
    public function getPrimaryCurrencyCode()
45
    {
46 4
        return $this->object->PrimaryCurrencyCode;
47
    }
48
49
    /**
50
     * Secondary currency of order.
51
     * @return string
52
     */
53 4
    public function getSecondaryCurrencyCode()
54
    {
55 4
        return $this->object->SecondaryCurrencyCode;
56
    }
57
58
    /**
59
     * Order status.
60
     * @return string
61
     */
62 4
    public function getStatus()
63
    {
64 4
        return $this->object->Status;
65
    }
66
67
    /**
68
     * Unique identifier of the order.
69
     * @return string
70
     */
71 4
    public function getGuid()
72
    {
73 4
        return $this->object->OrderGuid;
74
    }
75
}
76