我有界面:
interface AbstractMapper { public function objectToArray(ActiveRecordBase $object); }
和课程:
class ActiveRecordBase { ... } class Product extends ActiveRecordBase { ... }
========
但我不能这样做:
interface ExactMapper implements AbstractMapper { public function objectToArray(Product $object); }
或这个:
interface ExactMapper extends AbstractMapper { public function objectToArray(Product $object); }
我有错误“声明必须兼容”
那么,有没有办法在PHP中执行此操作?