| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4.0466 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 4 | public function isEligible(DiscountSubjectContract $subject, DiscountContract $discount) |
|
| 21 | { |
||
| 22 | 4 | if (!$discount->hasRules()) { |
|
| 23 | return true; |
||
| 24 | } |
||
| 25 | |||
| 26 | 4 | foreach ($discount->getRules() as $rule) { |
|
| 27 | 4 | if (!$this->isEligibleToRule($subject, $rule, $discount)) { |
|
| 28 | 4 | return false; |
|
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | 3 | return true; |
|
| 33 | } |
||
| 34 | |||
| 44 |
Since your code implements the magic getter
_get, this function will be called for any read access on an undefined variable. You can add the@propertyannotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.