1 | <?php |
||
2 | |||
3 | namespace Rezahmady\Smsir\Responses; |
||
4 | |||
5 | class Message |
||
6 | { |
||
7 | /** |
||
8 | * @var int |
||
9 | */ |
||
10 | public $id; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | public $lineNumber; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | public $SMSMessageBody; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | public $mobileNumber; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | public $toBeSentAt; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | public $nativeDeliveryStatus; |
||
36 | |||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | public $typeOfMessage; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | public $sendAtLatin; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | public $sendAtJalali; |
||
51 | |||
52 | /** |
||
53 | * @var bool |
||
54 | */ |
||
55 | public $isChecked; |
||
56 | |||
57 | /** |
||
58 | * @var bool |
||
59 | */ |
||
60 | public $isError; |
||
61 | |||
62 | public function __construct( |
||
63 | int $id, |
||
64 | string $lineNumber, |
||
65 | string $SMSMessageBody, |
||
66 | string $mobileNumber, |
||
67 | string $typeOfMessage, |
||
68 | string $nativeDeliveryStatus, |
||
69 | string $toBeSentAt, |
||
70 | string $sendAtLatin, |
||
71 | string $sendAtJalali, |
||
72 | bool $isChecked, |
||
73 | bool $isError |
||
74 | ) { |
||
75 | $this->id = $id; |
||
76 | $this->lineNumber = $lineNumber; |
||
77 | $this->mobileNumber = $mobileNumber; |
||
78 | $this->SMSMessageBody = $SMSMessageBody; |
||
79 | $this->typeOfMessage = $typeOfMessage; |
||
80 | $this->nativeDeliveryStatus = $nativeDeliveryStatus; |
||
81 | $this->toBeSentAt = $toBeSentAt; |
||
82 | $this->sendAtJalali = $sendAtJalali; |
||
83 | $this->sendAtLatin = $sendAtLatin; |
||
84 | $this->isChecked = ($isChecked === false ? 0 : 1); |
||
0 ignored issues
–
show
|
|||
85 | $this->isError = ($isError === false ? 0 : 1); |
||
0 ignored issues
–
show
The property
$isError was declared of type boolean , but $isError === false ? 0 : 1 is of type integer . Maybe add a type cast?
This check looks for assignments to scalar types that may be of the wrong type. To ensure the code behaves as expected, it may be a good idea to add an explicit type cast. $answer = 42;
$correct = false;
$correct = (bool) $answer;
![]() |
|||
86 | } |
||
87 | } |
||
88 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.