Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
39 | public function get( $id ) |
||
40 | { |
||
41 | if (!empty( $this->instances[ $id ])) |
||
42 | return $this->instances[ $id ]; |
||
43 | |||
44 | if (!$instance = $sheet_factory( $id )) |
||
|
|||
45 | throw new CouponSheetNotFoundException("Could not find a coupon sheet with ID $id"); |
||
46 | |||
47 | |||
48 | $this->instances[ $id ] = $instance; |
||
49 | return $instance; |
||
50 | } |
||
51 | |||
54 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.