Completed
Push — master ( 5971d3...dcc755 )
by
unknown
26s queued 11s
created

AddressingAccount::toArray()   A

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 WeDevBr\Bankly\Validators\Pix\AddressingAccountValidator;
6
7
class AddressingAccount
8
{
9
    /** @var string */
10
    public $branch;
11
12
    /** @var string */
13
    public $number;
14
15
    /** @var string */
16
    public $type;
17
18
    /**
19
     * This validate and return an array
20
     * @return array
21
     */
22
    public function toArray(): array
23
    {
24
        $this->validate();
25
        return (array) $this;
26
    }
27
28
    /**
29
     * This function validate a Addressing Account
30
     */
31
    public function validate()
32
    {
33
        $validator = new AddressingAccountValidator($this);
34
        $validator->validate();
35
    }
36
}
37