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

BankAccount   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 27
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\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