Total Complexity | 4 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class PaymentDraftBuilder extends Builder |
||
6 | { |
||
7 | /** |
||
8 | * An optional title |
||
9 | * |
||
10 | * @var string |
||
11 | */ |
||
12 | public $title; |
||
13 | |||
14 | /** |
||
15 | * An optional future date |
||
16 | * |
||
17 | * @var string |
||
18 | */ |
||
19 | public $schedule_for; |
||
20 | |||
21 | /** |
||
22 | * The payments included in the draft |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | public $payments; |
||
27 | |||
28 | /** |
||
29 | * Set an optional title for the draft |
||
30 | * |
||
31 | * @param string $title |
||
32 | * @return self |
||
33 | */ |
||
34 | public function title(string $title) |
||
35 | { |
||
36 | return $this->setAttribute('title', $title); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Set an optional future date to schedule the payments |
||
41 | * |
||
42 | * @param string $date |
||
43 | * @return self |
||
44 | */ |
||
45 | public function schedule(string $date) |
||
46 | { |
||
47 | return $this->setAttribute('schedule_for', $date); |
||
48 | } |
||
49 | |||
50 | /** |
||
51 | * Set the payments included in the draft |
||
52 | * |
||
53 | * @param array $payments |
||
54 | * @return self |
||
55 | */ |
||
56 | public function payments(array $payments) |
||
57 | { |
||
58 | return $this->setAttribute('payments', $payments); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * Add a payment to the draft |
||
63 | * |
||
64 | * @param array $payment |
||
65 | * @return self |
||
66 | */ |
||
67 | public function addPayment(array $payment) |
||
70 | } |
||
71 | } |
||
72 |