Completed
Pull Request — master (#50)
by
unknown
01:22
created

BankAccount::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace WeDevBr\Bankly\Types\Billet;
4
5
use WeDevBr\Bankly\Validators\Billet\BankAccountValidator;
6
7
class BankAccount
8
{
9
    /** @var string */
10
    public $branch;
11
12
    /** @var string */
13
    public $number;
14
15
    /**
16
     * This validate and return an array
17
     * @return array
18
     */
19
    public function toArray(): array
20
    {
21
        $this->validate();
22
        return (array) $this;
23
    }
24
25
    /**
26
     * This function validate a bank account for deposit billet
27
     */
28
    public function validate()
29
    {
30
        $bankAccountValidator = new BankAccountValidator($this);
31
        $bankAccountValidator->validate();
32
    }
33
}
34