Completed
Push — master ( dae486...0e58a3 )
by Abdelrahman
01:49
created

AuthyMessage::action()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace NotificationChannels\Authy;
4
5
class AuthyMessage
6
{
7
    /**
8
     * The notification method (sms/call).
9
     *
10
     * @var string
11
     */
12
    public $method = 'sms';
13
14
    /**
15
     * Determine whether to force the notification over cellphone network.
16
     *
17
     * @var bool
18
     */
19
    public $force = false;
20
21
    /**
22
     * The notification message action.
23
     *
24
     * @var string
25
     */
26
    public $action;
27
28
    /**
29
     * The notification message action message.
30
     *
31
     * @var string
32
     */
33
    public $actionMessage;
34
35
    /**
36
     * Create a new Authy message instance.
37
     *
38
     * @return static
39
     */
40
    public static function create()
41
    {
42
        return new static();
43
    }
44
45
    /**
46
     * Set the method of the Authy message.
47
     *
48
     * @param string $method
49
     *
50
     * @return $this
51
     */
52
    public function method($method)
53
    {
54
        $this->method = $method === 'call' ? 'call' : 'sms';
55
56
        return $this;
57
    }
58
59
    /**
60
     * Indicate that the notification is forced over cellphone network.
61
     *
62
     * @return $this
63
     */
64
    public function force()
65
    {
66
        $this->force = true;
67
68
        return $this;
69
    }
70
71
    /**
72
     * Set the notification action.
73
     *
74
     * @param string $action
75
     *
76
     * @return $this
77
     */
78
    public function action($action)
79
    {
80
        $this->action = $action;
81
82
        return $this;
83
    }
84
85
    /**
86
     * Set the notification action message.
87
     *
88
     * @param string $actionMessage
89
     *
90
     * @return $this
91
     */
92
    public function actionMessage($actionMessage)
93
    {
94
        $this->actionMessage = $actionMessage;
95
96
        return $this;
97
    }
98
}
99