| 1 | <?php | ||
| 9 | class PriceColumn extends DataColumn | ||
| 10 | { | ||
| 11 | /** | ||
| 12 | * @var ShoppingCart | ||
| 13 | */ | ||
| 14 | public $cart; | ||
| 15 | |||
| 16 | public $format = 'html'; | ||
| 17 | |||
| 18 | public $contentOptions = ['style' => 'vertical-align: middle; white-space: nowrap;']; | ||
| 19 | |||
| 20 | /** | ||
| 21 | * @param CartPositionInterface $position | ||
| 22 | * @param mixed $key | ||
| 23 | * @param int $index | ||
| 24 | * @return string | ||
| 25 | */ | ||
| 26 | public function getDataCellValue($position, $key, $index): string | ||
| 38 | } | ||
| 39 | 
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: