BankAccount::validate()   A
last analyzed

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\Pix;
4
5
use Illuminate\Contracts\Support\Arrayable;
6
use WeDevBr\Bankly\Validators\Pix\BankAccountValidator;
7
8
class BankAccount implements Arrayable
9
{
10
    /** @var \WeDevBr\Bankly\Types\Pix\AddressingAccount */
11
    public $account;
12
13
    /** @var \WeDevBr\Bankly\Types\Pix\Bank */
14
    public $bank;
15
16
    /** @var string */
17
    public $documentNumber;
18
19
    /** @var string */
20
    public $name;
21
22
    /**
23
     * This validate and return an array
24
     * @return array
25
     */
26
    public function toArray(): array
27
    {
28
        $this->validate();
29
        return (array) $this;
30
    }
31
32
    /**
33
     * This function validate the PixCashout type
34
     *
35
     * @return void
36
     */
37
    public function validate()
38
    {
39
        $bankAccount = new BankAccountValidator($this);
40
        $bankAccount->validate();
41
    }
42
}
43