BankAccount   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 6 1
A validate() 0 5 1
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