1 | <?php |
||
18 | class JoinedOpcode extends Opcode implements PositionInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | private $id; |
||
24 | |||
25 | /** |
||
26 | * @var Readable |
||
27 | */ |
||
28 | private $file; |
||
29 | |||
30 | /** |
||
31 | * @var int |
||
32 | */ |
||
33 | private $offset; |
||
34 | |||
35 | /** |
||
36 | * @var \Closure |
||
37 | */ |
||
38 | private $description; |
||
39 | |||
40 | /** |
||
41 | * JoinableOpcode constructor. |
||
42 | * @param OpcodeInterface|self $opcode |
||
43 | * @param int $id |
||
44 | * @param Readable $file |
||
45 | * @param int $offset |
||
46 | */ |
||
47 | public function __construct(OpcodeInterface $opcode, int $id, Readable $file, int $offset = 0) |
||
59 | |||
60 | /** |
||
61 | * @return int |
||
62 | */ |
||
63 | public function getOffset(): int |
||
67 | |||
68 | /** |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getDescription(): string |
||
77 | |||
78 | /** |
||
79 | * @return Readable |
||
80 | */ |
||
81 | public function getFile(): Readable |
||
85 | |||
86 | /** |
||
87 | * @return PositionInterface |
||
88 | */ |
||
89 | private function getPosition(): PositionInterface |
||
93 | |||
94 | /** |
||
95 | * @return int |
||
96 | */ |
||
97 | public function getLine(): int |
||
101 | |||
102 | /** |
||
103 | * @return int |
||
104 | */ |
||
105 | public function getColumn(): int |
||
109 | |||
110 | /** |
||
111 | * @return int |
||
112 | */ |
||
113 | public function getId(): int |
||
117 | |||
118 | /** |
||
119 | * @return string |
||
120 | */ |
||
121 | public function __toString(): string |
||
130 | } |
||
131 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: