PixEntries   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 30
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 5 1
A validate() 0 8 1
1
<?php
2
3
namespace WeDevBr\Bankly\Types\Pix;
4
5
use WeDevBr\Bankly\Types\Pix\AddressingAccount;
6
use WeDevBr\Bankly\Validators\Pix\AddressingAccountValidator;
7
use WeDevBr\Bankly\Validators\Pix\AddressingKeyValidator;
8
9
class PixEntries
10
{
11
    /** @var AddressingKey */
12
    public $addressingKey;
13
14
    /** @var AddressingAccount */
15
    public $account;
16
17
    /**
18
     * This validate and return an array
19
     * @return array
20
     */
21
    public function toArray(): array
22
    {
23
        $this->validate();
24
        return (array) $this;
25
    }
26
27
    /**
28
     * This function validate a Addressing Key
29
     */
30
    public function validate()
31
    {
32
        $addressingKeyValidator = new AddressingKeyValidator($this->addressingKey);
33
        $addressingKeyValidator->validate();
34
35
        $addressingAccountValidator = new AddressingAccountValidator($this->account);
36
        $addressingAccountValidator->validate();
37
    }
38
}
39