Passed
Pull Request — master (#4)
by Cesar
03:13
created

Urls::validate()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 4
nc 2
nop 0
dl 0
loc 9
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PagaMasTarde\OrdersApiClient\Model\Order\Configuration;
4
5
use PagaMasTarde\OrdersApiClient\Model\AbstractModel;
6
7
/**
8
 * Class Urls
9
 * @package PagaMasTarde\OrdersApiClient\Model\Order\Configuration
10
 */
11
class Urls extends AbstractModel
12
{
13
    /**
14
     * @var string cancel URL
15
     */
16
    protected $cancel = null;
17
18
    /**
19
     * @var string ko URL
20
     */
21
    protected $ko = null;
22
23
    /**
24
     * @var string $notificationCallback URL
25
     */
26
    protected $notificationCallback = null;
27
28
    /**
29
     * @var string ok URL
30
     */
31
    protected $ok = null;
32
33
    /**
34
     * @param $url
35
     *
36
     * @return bool
37
     */
38
    public static function urlValidate($url)
39
    {
40
        return filter_var($url, FILTER_VALIDATE_URL) !== false;
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getCancel()
47
    {
48
        return $this->cancel;
49
    }
50
51
    /**
52
     * @param $cancel
53
     *
54
     * @return $this
55
     */
56
    public function setCancel($cancel)
57
    {
58
        $this->cancel = $cancel;
59
60
        return $this;
61
    }
62
63
    /**
64
     * @return string
65
     */
66
    public function getKo()
67
    {
68
        return $this->ko;
69
    }
70
71
    /**
72
     * @param $ko
73
     *
74
     * @return $this
75
     */
76
    public function setKo($ko)
77
    {
78
        $this->ko = $ko;
79
80
        return $this;
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getNotificationCallback()
87
    {
88
        return $this->notificationCallback;
89
    }
90
91
    /**
92
     * @param $notificationCallback
93
     *
94
     * @return $this
95
     */
96
    public function setNotificationCallback($notificationCallback)
97
    {
98
        $this->notificationCallback = $notificationCallback;
99
100
        return $this;
101
    }
102
103
    /**
104
     * @return string
105
     */
106
    public function getOk()
107
    {
108
        return $this->ok;
109
    }
110
111
    /**
112
     * @param $ok
113
     *
114
     * @return $this
115
     */
116
    public function setOk($ok)
117
    {
118
        $this->ok = $ok;
119
120
        return $this;
121
    }
122
}
123