Code Duplication    Length = 27-33 lines in 3 locations

src/BillPayment.php 1 location

@@ 18-44 (lines=27) @@
15
 * @copyright 2020 We Dev Tecnologia Ltda
16
 * @link      https://github.com/wedevBr/bankly-laravel/
17
 */
18
class BillPayment extends \stdClass implements Arrayable
19
{
20
    public $amount;
21
    public $bankBranch;
22
    public $bankAccount;
23
    public $description;
24
    public $id;
25
26
    /**
27
     * This validate and return an array
28
     * @return array
29
     */
30
    public function toArray(): array
31
    {
32
        $this->validate();
33
        return (array) $this;
34
    }
35
36
    /**
37
     * This function validate a bill payment
38
     */
39
    public function validate()
40
    {
41
        $validator = new BillPaymentValidator($this);
42
        $validator->validate();
43
    }
44
}
45

src/Types/Card/ChangeStatus.php 1 location

@@ 8-40 (lines=33) @@
5
use Illuminate\Contracts\Support\Arrayable;
6
use WeDevBr\Bankly\Validators\Card\ChangeStatusValidator;
7
8
class ChangeStatus extends \stdClass implements Arrayable
9
{
10
    /** @var string */
11
    public $password;
12
13
    /** @var string */
14
    public $status;
15
16
    /** @var bool */
17
    public $updateCardBinded = false;
18
19
    /**
20
     * This validate and return an array
21
     * @return array
22
     */
23
    public function toArray(): array
24
    {
25
        $this->validate();
26
27
        return (array) $this;
28
    }
29
30
    /**
31
     * This function validate a change status
32
     */
33
    public function validate()
34
    {
35
        $validator = new ChangeStatusValidator($this);
36
        $validator->validate();
37
38
        return $this;
39
    }
40
}
41

src/Types/Card/Wallet.php 1 location

@@ 8-40 (lines=33) @@
5
use Illuminate\Contracts\Support\Arrayable;
6
use WeDevBr\Bankly\Validators\Card\WalletValidator;
7
8
class Wallet extends \stdClass implements Arrayable
9
{
10
    /** @var string */
11
    public $proxy;
12
13
    /** @var string */
14
    public $wallet;
15
16
    /** @var string */
17
    public $brand;
18
19
    /**
20
     * This validate and return an array
21
     * @return array
22
     */
23
    public function toArray(): array
24
    {
25
        $this->validate();
26
27
        return (array) $this;
28
    }
29
30
    /**
31
     * This function validate a digital wallet
32
     */
33
    public function validate()
34
    {
35
        $validator = new WalletValidator($this);
36
        $validator->validate();
37
38
        return $this;
39
    }
40
}
41