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

AddressingKey::validate()   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\AddressingKeyValidator;
6
7
class AddressingKey
8
{
9
    /** @var string */
10
    public $type;
11
12
    /** @var string */
13
    public $value;
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 Addressing Key
27
     */
28
    public function validate()
29
    {
30
        $validator = new AddressingKeyValidator($this);
31
        $validator->validate();
32
    }
33
}
34