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

AddressingKey   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\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