Completed
Push — master ( 678ccb...583462 )
by Abdelrahman
10:00 queued 11s
created

AuthyMessage::method()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

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