Non-abstract property hook must have a body¶
Description¶
Property hooks, both set and get, may be made abstract by replacing the body block by a semi-colon. And, just like methods, property hooks must use the abstract property, although the property definition has to support the option, not the property hook itself.
Example¶
<?php
class X {
// This is an error. A property hook must have a body
public $property {
get;
}
// This is OK. The property is marked as abstract
public abstract $abstractProperty {
get;
}
}
?>
Solutions¶
Add a body to the property hook.
Add the abstract keyword to the property definition.