Completed
Push — master ( 77cb3d...eaae4c )
by
unknown
24s queued 11s
created

DepositBillet   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 48
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 5 1
A validate() 0 5 1
1
<?php
2
3
namespace WeDevBr\Bankly\Types\Billet;
4
5
use WeDevBr\Bankly\Validators\Billet\DepositBilletValidator;
6
7
class DepositBillet
8
{
9
    /** @var BankAccount */
10
    public $account;
11
12
    /** @var Payer */
13
    public $payer;
14
15
    /** @var string */
16
    public $alias;
17
18
    /** @var string */
19
    public $documentNumber;
20
21
    /** @var string */
22
    public $amount;
23
24
    /** @var string */
25
    public $dueDate;
26
27
    /** @var bool */
28
    public $emissionFee;
29
30
    /**
31
     * [Deposit, Levy]
32
     * @var string
33
     * */
34
    public $type;
35
36
    /**
37
     * This validate and return an array
38
     * @return array
39
     */
40
    public function toArray(): array
41
    {
42
        $this->validate();
43
        return json_decode(json_encode($this), true);;
44
    }
45
46
    /**
47
     * This function validate a virtual card address
48
     */
49
    public function validate()
50
    {
51
        $depositBilletValidator = new DepositBilletValidator($this);
52
        $depositBilletValidator->validate();
53
    }
54
}
55