| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | public function testUnaccessiblePropertiesThrowsCatchableError( |
||
| 46 | IStrictPropertiesContainer $obj, |
||
| 47 | $property, |
||
| 48 | $value = null |
||
| 49 | ) { |
||
| 50 | |||
| 51 | if ($value === null) { |
||
| 52 | // Getter exception |
||
| 53 | $actual = $obj->$property; |
||
| 54 | } else { |
||
| 55 | // Setter exception |
||
| 56 | $obj->$property = $value; |
||
| 57 | } |
||
| 58 | } |
||
| 59 | } |
||
| 60 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@returndoc comment to communicate to implementors of these methods what they are expected to return.