Completed
Push — master ( 43aea4...c3be30 )
by Freek
01:47
created

AuthyMessage::doNotForce()   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 0
1
<?php
2
3
namespace NotificationChannels\Authy;
4
5
class AuthyMessage
6
{
7
    /**
8
     * Determine whether to force the notification over cellphone network.
9
     *
10
     * @var bool
11
     */
12
    public $force = false;
13
14
    /**
15
     * The notification method (sms/call).
16
     *
17
     * @var string
18
     */
19
    public $method = 'sms';
20
21
    /**
22
     * Create a new Authy message instance.
23
     *
24
     * @return static
25
     */
26
    public static function create()
27
    {
28
        return new static();
29
    }
30
31
    /**
32
     * Indicate that the notification is forced over cellphone network.
33
     *
34
     *
35
     * @return $this
36
     */
37
    public function force()
38
    {
39
        $this->force = true;
40
41
        return $this;
42
    }
43
44
    /**
45
     * Indicate that the notification is not forced over cellphone network.
46
     *
47
     * @return $this
48
     */
49
    public function doNotForce()
50
    {
51
        $this->force = false;
52
53
        return $this;
54
    }
55
56
    /**
57
     * Set the method of the Authy message.
58
     *
59
     * @param string $method
60
     *
61
     * @return $this
62
     */
63
    public function method($method)
64
    {
65
        $this->method = $method === 'call' ? 'call' : 'sms';
66
67
        return $this;
68
    }
69
}
70