Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | public static function fromObject($object): RowData |
||
23 | { |
||
24 | if (!is_object($object)) { |
||
25 | throw new \InvalidArgumentException(sprintf( |
||
26 | 'Object must be an object, got: "%s"', |
||
27 | gettype($object) |
||
28 | )); |
||
29 | } |
||
30 | |||
31 | $instance = new self(); |
||
32 | $instance->object = $object; |
||
33 | |||
34 | return $instance; |
||
35 | } |
||
36 | |||
74 |
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.