Conditions | 4 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
33 | public function canComment($user_guid = 0, $default = null) { |
||
34 | $result = parent::canComment($user_guid, $default); |
||
35 | if ($result == false) { |
||
|
|||
36 | return $result; |
||
37 | } |
||
38 | |||
39 | if ($this->comments_on === 'Off' || $this->status !== 'published') { |
||
40 | return false; |
||
41 | } |
||
42 | |||
43 | return true; |
||
44 | } |
||
62 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.