| 1 | <?php |
||
| 18 | class Type implements TypeInterface |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $name; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var integer |
||
| 27 | */ |
||
| 28 | protected $id; |
||
| 29 | |||
| 30 | 7 | public function __construct($name, $id = null) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | public function getId() |
||
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritdoc} |
||
| 46 | */ |
||
| 47 | 4 | public function getName() |
|
| 51 | |||
| 52 | public function getUniqueId() |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @return string |
||
| 59 | */ |
||
| 60 | 4 | public function equals(TypeInterface $other) |
|
| 66 | |||
| 67 | public function jsonSerialize() |
||
| 74 | } |
||
| 75 |
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: