Total Complexity | 5 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class HablameMessage |
||
6 | { |
||
7 | private ?string $phoneNumbers = null; |
||
8 | |||
9 | private ?string $sms = null; |
||
10 | |||
11 | private ?string $datetime = null; |
||
12 | |||
13 | public function __construct( |
||
14 | string $phoneNumber = null, |
||
15 | string $sms = null, |
||
16 | string $datetime = null |
||
17 | ) { |
||
18 | $this->phoneNumbers = $phoneNumber; |
||
19 | |||
20 | $this->sms = $sms; |
||
21 | |||
22 | $this->datetime = $datetime; |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Números telefónicos a enviar SMS separados por coma. |
||
27 | 6 | * |
|
28 | * @param string $phoneNumbers |
||
29 | * @return $this |
||
30 | */ |
||
31 | public function phoneNumbers(string $phoneNumbers): self |
||
32 | { |
||
33 | 6 | $this->phoneNumbers = $phoneNumbers; |
|
34 | |||
35 | 6 | return $this; |
|
36 | } |
||
37 | 6 | ||
38 | /** |
||
39 | 6 | * Mensaje de texto a enviar. |
|
40 | 6 | * |
|
41 | * @param string $sms |
||
42 | * @return $this |
||
43 | */ |
||
44 | public function sms(string $sms): self |
||
45 | { |
||
46 | $this->sms = $sms; |
||
47 | |||
48 | 1 | return $this; |
|
49 | } |
||
50 | 1 | ||
51 | /** |
||
52 | 1 | * [optional] Fecha de envío. Si está vacío, se envía inmediatamente. |
|
53 | * (Ejemplo: 2017-12-31 23:59:59). |
||
54 | * |
||
55 | * @param string|null $datetime |
||
56 | * @return $this |
||
57 | */ |
||
58 | public function datetime(string $datetime = null): self |
||
63 | 1 | } |
|
64 | |||
65 | 1 | public function toArray(): array |
|
71 | ]; |
||
72 | } |
||
73 | } |
||
74 |