Passed
Pull Request — master (#53)
by
unknown
03:07
created

Receipt::getCardNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Shetabit\Multipay\Abstracts;
4
5
use Carbon\Carbon;
6
use Shetabit\Multipay\Contracts\ReceiptInterface;
7
8
abstract class Receipt implements ReceiptInterface
9
{
10
    /**
11
     * A unique ID which is given to the customer whenever the payment is done successfully.
12
     * This ID can be used for financial follow up.
13
     *
14
     * @var string
15
     */
16
    protected $referenceId;
17
18
    /**
19
     * payment driver's name.
20
     *
21
     * @var string
22
     */
23
    protected $driver;
24
25
    /**
26
     * payment CardNumber.
27
     *
28
     * @var string
29
     */
30
    protected $card;
31
32
    /**
33
     * payment cardHash.
34
     *
35
     * @var string
36
     */
37
    protected $hash;
38
39
    /**
40
     * payment date
41
     *
42
     * @var Carbon
43
     */
44
    protected $date;
45
46
    /**
47
     * Receipt constructor.
48
     *
49
     * @param $driver
50
     * @param $referenceId
51
     * @param string $card
52
     * @param string $hash
53
     */
54
    public function __construct($driver, $referenceId,$card="",$hash="")
55
    {
56
        $this->driver = $driver;
57
        $this->referenceId = $referenceId;
58
        $this->card = $card;
59
        $this->hash = $hash;
60
        $this->date = Carbon::now();
61
    }
62
63
    /**
64
     * Retrieve driver's name
65
     *
66
     * @return string
67
     */
68
    public function getDriver() : string
69
    {
70
        return $this->driver;
71
    }
72
73
    /**
74
     * Retrieve payment reference code.
75
     *
76
     * @return string
77
     */
78
    public function getReferenceId() : string
79
    {
80
        return (string) $this->referenceId;
81
    }
82
83
    /**
84
     * Retrieve payment reference code.
85
     *
86
     * @return string
87
     */
88
    public function getCardNumber() : string
89
    {
90
        return (string) $this->card;
91
    }
92
93
    /**
94
     * Retrieve payment reference code.
95
     *
96
     * @return string
97
     */
98
    public function getCardHash() : string
99
    {
100
        return (string) $this->hash;
101
    }
102
103
    /**
104
     * Retrieve payment date
105
     *
106
     * @return Carbon|\Illuminate\Support\Carbon
0 ignored issues
show
Bug introduced by
The type Illuminate\Support\Carbon was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
107
     */
108
    public function getDate() : Carbon
109
    {
110
        return $this->date;
111
    }
112
}
113