Conditions | 3 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
33 | #[API\Exclude] |
||
34 | public function setSubscriptionLastReview(?Product $subscriptionLastReview): void |
||
35 | { |
||
36 | if ($subscriptionLastReview && !$subscriptionLastReview->getReviewNumber()) { |
||
|
|||
37 | throw new InvalidArgumentException('The last review of a subscription must be a review, not an article'); |
||
38 | } |
||
39 | |||
40 | $this->subscriptionLastReview = $subscriptionLastReview; |
||
41 | } |
||
43 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
integer
values, zero is a special case, in particular the following results might be unexpected: