Deposit::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace MidasSoft\DominicanBankParser;
4
5
class Deposit
6
{
7
    /**
8
     * The amount of the deposit.
9
     *
10
     * @var float
11
     */
12
    private $amount;
13
14
    /**
15
     * The date of the deposit.
16
     *
17
     * @var string
18
     */
19
    private $date;
20
21
    /**
22
     * The description of the deposit.
23
     *
24
     * @var string
25
     */
26
    private $description;
27
28
    /**
29
     * The term of the deposit.
30
     *
31
     * @var string
32
     */
33
    private $term;
34
35
    /**
36
     * Creates a new Deposit object.
37
     *
38
     * @param float  $amount
39
     * @param string $date
40
     * @param string $description
41
     * @param string $term
42
     */
43 9
    public function __construct($amount, $date, $description, $term)
44
    {
45 9
        $this->amount = $amount;
46 9
        $this->date = $date;
47 9
        $this->description = $description;
48 9
        $this->term = $term;
49 9
    }
50
51
    /**
52
     * Returns the amount property.
53
     *
54
     * @return float
55
     */
56
    public function getAmount()
57
    {
58
        return $this->amount;
59
    }
60
61
    /**
62
     * Returns the date property.
63
     *
64
     * @return string
65
     */
66
    public function getDate()
67
    {
68
        return $this->date;
69
    }
70
71
    /**
72
     * Returns the description property.
73
     *
74
     * @return string
75
     */
76
    public function getDescription()
77
    {
78
        return $this->description;
79
    }
80
81
    /**
82
     * Returns the term property.
83
     *
84
     * @return string
85
     */
86
    public function getTerm()
87
    {
88
        return $this->term;
89
    }
90
91
    /**
92
     * Returns a string representation of the object.
93
     *
94
     * @return string
95
     */
96 1
    public function __toString()
97
    {
98 1
        return sprintf('%s|%s|%s|%s', $this->amount, $this->date, $this->description, $this->term);
99
    }
100
}
101