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

Bank::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 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