Completed
Push — master ( 2a953d...5971d3 )
by
unknown
27s queued 10s
created

BillPayment::validate()   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;
4
5
use Illuminate\Contracts\Support\Arrayable;
6
use WeDevBr\Bankly\Validators\BillPaymentValidator;
7
8
/**
9
 * BillPayment class
10
 *
11
 * PHP version 7.3|7.4|8.0
12
 *
13
 * @author    WeDev Brasil Team <[email protected]>
14
 * @author    Rafael Teixeira <[email protected]>
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