BankAccount::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * BankAccount class
5
 *
6
 * @author    jesobreira
7
 * @link      https://github.com/jesobreira/bankly-php/blob/master/src/BankAccount.php
8
 */
9
10
namespace WeDevBr\Bankly;
11
12
use WeDevBr\Bankly\Validators\BankAccountValidator;
13
14
class BankAccount extends \stdClass
15
{
16
    public $bankCode = '332';
17
    public $branch;
18
    public $account;
19
    public $document;
20
    public $name;
21
    public $accountType = 'CHECKING';
22
23
    /**
24
     * This validate and return an array
25
     * @return array
26
     */
27
    public function toArray(): array
28
    {
29
        $this->validate();
30
31
        return $this->toArray();
32
    }
33
34
    /**
35
     * This function validate a bank account
36
     */
37
    public function validate()
38
    {
39
        $validator = new BankAccountValidator($this);
40
        $validator->validate();
41
    }
42
}
43