Conditions | 3 |
Paths | 4 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Tests | 17 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
88 | 5 | public function __destruct() |
|
89 | { |
||
90 | 5 | if ($this->text) { |
|
|
|||
91 | 3 | SendMessage::dispatch( |
|
92 | 3 | $this->channel, |
|
93 | 3 | $this->chat, |
|
94 | 3 | $this->user, |
|
95 | 3 | $this->text, |
|
96 | 3 | $this->template |
|
97 | 3 | )->delay($this->delay); |
|
98 | } |
||
99 | |||
100 | 5 | if ($this->attachment) { |
|
101 | 2 | SendAttachment::dispatch( |
|
102 | 2 | $this->channel, |
|
103 | 2 | $this->chat, |
|
104 | 2 | $this->user, |
|
105 | 2 | $this->attachment |
|
106 | 2 | )->delay($this->delay); |
|
107 | } |
||
108 | 5 | } |
|
109 | } |
||
110 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: