BankAccount   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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