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

PixCashoutManual::validate()   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\PixCashoutManualValidator;
7
8 View Code Duplication
class PixCashoutManual 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 = 'Manual';
27
28
    /**
29
     * This validate and return an array
30
     * @return array
31
     */
32
    public function toArray(): array
33
    {
34
        $this->validate();
35
        return json_decode(json_encode($this), true);
36
    }
37
38
    /**
39
     * This function validate the PixCashout type
40
     *
41
     * @return void
42
     */
43
    public function validate(): void
44
    {
45
        $pixCashout = new PixCashoutManualValidator($this);
46
        $pixCashout->validate();
47
    }
48
}
49