I have an interface:
interface AbstractMapper { public function objectToArray(ActiveRecordBase $object); }
And classes:
class ActiveRecordBase { ... } class Product extends ActiveRecordBase { ... }
========
But I can not do this:
interface ExactMapper implements AbstractMapper { public function objectToArray(Product $object); }
or that:
interface ExactMapper extends AbstractMapper { public function objectToArray(Product $object); }
I have an error "Ad must be compatible "
So, is there a way to do this in PHP?
inheritance php interface
violarium
source share