Completed
Push — master ( 77cb3d...eaae4c )
by
unknown
24s queued 11s
created

Bank   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 32
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\BankValidator;
7
8
class Bank implements Arrayable
9
{
10
    /** @var string */
11
    public $ispb;
12
13
    /** @var string */
14
    public $compe;
15
16
    /** @var string */
17
    public $name;
18
19
    /**
20
     * This validate and return an array
21
     * @return array
22
     */
23
    public function toArray(): array
24
    {
25
        $this->validate();
26
        return (array) $this;
27
    }
28
29
    /**
30
     * This function validate the PixCashout type
31
     *
32
     * @return void
33
     */
34
    public function validate()
35
    {
36
        $bank = new BankValidator($this);
37
        $bank->validate();
38
    }
39
}
40