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

PixCashoutStaticQrCode::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
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\Contracts\Pix\PixCashoutInterface;
6
use WeDevBr\Bankly\Validators\Pix\PixCashoutStaticQrCodeValidator;
7
8 View Code Duplication
class PixCashoutStaticQrCode implements PixCashoutInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /** @var string */
11
    public $amount;
12
13
    /** @var string */
14
    public $description;
15
16
    /** @var \WeDevBr\Bankly\Types\Pix\BankAccount */
17
    public $sender;
18
19
    /** @var \WeDevBr\Bankly\Types\Pix\BankAccount */
20
    public $recipient;
21
22
    /**
23
     * [Manual, Key, StaticQrCode, DynamicQrCode]
24
     * @var string
25
     */
26
    public $initializationType = 'StaticQrCode';
27
28
    /** @var string */
29
    public $endToEndId;
30
31
    /**
32
     * This validate and return an array
33
     * @return array
34
     */
35
    public function toArray(): array
36
    {
37
        $this->validate();
38
        return json_decode(json_encode($this), true);
39
    }
40
41
    /**
42
     * This function validate the PixCashoutStaticQrCode type
43
     *
44
     * @return void
45
     */
46
    public function validate(): void
47
    {
48
        $pixCashout = new PixCashoutStaticQrCodeValidator($this);
49
        $pixCashout->validate();
50
    }
51
}
52